1 #ifndef LDK_C_BINDINGS_H
2 #define LDK_C_BINDINGS_H
4 /* Generated with cbindgen:0.20.0 */
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_InvalidRecoveryId,
348 * Invalid tweak for add_assign or mul_assign
350 LDKSecp256k1Error_InvalidTweak,
352 * tweak_add_check failed on an xonly public key
354 LDKSecp256k1Error_TweakCheckFailed,
356 * Didn't pass enough memory to context creation with preallocated memory
358 LDKSecp256k1Error_NotEnoughMemory,
360 * Must be last for serialization purposes
362 LDKSecp256k1Error_Sentinel,
366 * Errors that may occur when converting a `RawInvoice` to an `Invoice`. They relate to the
367 * requirements sections in BOLT #11
369 typedef enum LDKSemanticError {
371 * The invoice is missing the mandatory payment hash
373 LDKSemanticError_NoPaymentHash,
375 * The invoice has multiple payment hashes which isn't allowed
377 LDKSemanticError_MultiplePaymentHashes,
379 * No description or description hash are part of the invoice
381 LDKSemanticError_NoDescription,
383 * The invoice contains multiple descriptions and/or description hashes which isn't allowed
385 LDKSemanticError_MultipleDescriptions,
387 * The invoice is missing the mandatory payment secret, which all modern lightning nodes
390 LDKSemanticError_NoPaymentSecret,
392 * The invoice contains multiple payment secrets
394 LDKSemanticError_MultiplePaymentSecrets,
396 * The invoice's features are invalid
398 LDKSemanticError_InvalidFeatures,
400 * The recovery id doesn't fit the signature/pub key
402 LDKSemanticError_InvalidRecoveryId,
404 * The invoice's signature is invalid
406 LDKSemanticError_InvalidSignature,
408 * The invoice's amount was not a whole number of millisatoshis
410 LDKSemanticError_ImpreciseAmount,
412 * Must be last for serialization purposes
414 LDKSemanticError_Sentinel,
418 * SI prefixes for the human readable part
420 typedef enum LDKSiPrefix {
438 * Must be last for serialization purposes
440 LDKSiPrefix_Sentinel,
444 * A Rust str object, ie a reference to a UTF8-valid string.
445 * This is *not* null-terminated so cannot be used directly as a C string!
447 typedef struct LDKStr {
449 * A pointer to the string's bytes, in UTF8 encoding
451 const uint8_t *chars;
453 * The number of bytes (not characters!) pointed to by `chars`
457 * Whether the data pointed to by `chars` should be freed or not.
463 * A serialized transaction, in (pointer, length) form.
465 * This type optionally owns its own memory, and thus the semantics around access change based on
466 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
467 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
468 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
469 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
470 * you would be invalid.
472 * Note that, while it may change in the future, because transactions on the Rust side are stored
473 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
474 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
475 * `data_is_owned` either set or unset at your discretion.
477 typedef struct LDKTransaction {
479 * The serialized transaction data.
481 * This is non-const for your convenience, an object passed to Rust is never written to.
485 * The length of the serialized transaction
489 * Whether the data pointed to by `data` should be freed or not.
495 * A dynamically-allocated array of u8s of arbitrary size.
496 * This corresponds to std::vector in C++
498 typedef struct LDKCVec_u8Z {
500 * The elements in the array.
501 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
505 * The number of elements pointed to by `data`.
511 * A transaction output including a scriptPubKey and value.
512 * This type *does* own its own memory, so must be free'd appropriately.
514 typedef struct LDKTxOut {
516 * The script_pubkey in this output
518 struct LDKCVec_u8Z script_pubkey;
520 * The value, in satoshis, of this output
526 * The contents of CResult_NoneNoneZ
528 typedef union LDKCResult_NoneNoneZPtr {
530 * Note that this value is always NULL, as there are no contents in the OK variant
534 * Note that this value is always NULL, as there are no contents in the Err variant
537 } LDKCResult_NoneNoneZPtr;
540 * A CResult_NoneNoneZ represents the result of a fallible operation,
541 * containing a () on success and a () on failure.
542 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
544 typedef struct LDKCResult_NoneNoneZ {
546 * The contents of this CResult_NoneNoneZ, accessible via either
547 * `err` or `result` depending on the state of `result_ok`.
549 union LDKCResult_NoneNoneZPtr contents;
551 * Whether this CResult_NoneNoneZ represents a success state.
554 } LDKCResult_NoneNoneZ;
559 * Implements the per-commitment secret storage scheme from
560 * [BOLT 3](https://github.com/lightningnetwork/lightning-rfc/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
562 * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
565 typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
567 * A pointer to the opaque Rust object.
568 * Nearly everywhere, inner must be non-null, however in places where
569 * the Rust equivalent takes an Option, it may be set to null to indicate None.
571 LDKnativeCounterpartyCommitmentSecrets *inner;
573 * Indicates that this is the only struct which contains the same pointer.
574 * Rust functions which take ownership of an object provided via an argument require
575 * this to be true and invalidate the object pointed to by inner.
578 } LDKCounterpartyCommitmentSecrets;
583 * An error in decoding a message or struct.
585 typedef struct MUST_USE_STRUCT LDKDecodeError {
587 * A pointer to the opaque Rust object.
588 * Nearly everywhere, inner must be non-null, however in places where
589 * the Rust equivalent takes an Option, it may be set to null to indicate None.
591 LDKnativeDecodeError *inner;
593 * Indicates that this is the only struct which contains the same pointer.
594 * Rust functions which take ownership of an object provided via an argument require
595 * this to be true and invalidate the object pointed to by inner.
601 * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
603 typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
605 * A pointer to the contents in the success state.
606 * Reading from this pointer when `result_ok` is not set is undefined.
608 struct LDKCounterpartyCommitmentSecrets *result;
610 * A pointer to the contents in the error state.
611 * Reading from this pointer when `result_ok` is set is undefined.
613 struct LDKDecodeError *err;
614 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
617 * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
618 * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
619 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
621 typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
623 * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
624 * `err` or `result` depending on the state of `result_ok`.
626 union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
628 * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
631 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
634 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
636 typedef struct LDKSecretKey {
638 * The bytes of the secret key
644 * The contents of CResult_SecretKeyErrorZ
646 typedef union LDKCResult_SecretKeyErrorZPtr {
648 * A pointer to the contents in the success state.
649 * Reading from this pointer when `result_ok` is not set is undefined.
651 struct LDKSecretKey *result;
653 * A pointer to the contents in the error state.
654 * Reading from this pointer when `result_ok` is set is undefined.
656 enum LDKSecp256k1Error *err;
657 } LDKCResult_SecretKeyErrorZPtr;
660 * A CResult_SecretKeyErrorZ represents the result of a fallible operation,
661 * containing a crate::c_types::SecretKey on success and a crate::c_types::Secp256k1Error on failure.
662 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
664 typedef struct LDKCResult_SecretKeyErrorZ {
666 * The contents of this CResult_SecretKeyErrorZ, accessible via either
667 * `err` or `result` depending on the state of `result_ok`.
669 union LDKCResult_SecretKeyErrorZPtr contents;
671 * Whether this CResult_SecretKeyErrorZ represents a success state.
674 } LDKCResult_SecretKeyErrorZ;
677 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
679 typedef struct LDKPublicKey {
681 * The bytes of the public key
683 uint8_t compressed_form[33];
687 * The contents of CResult_PublicKeyErrorZ
689 typedef union LDKCResult_PublicKeyErrorZPtr {
691 * A pointer to the contents in the success state.
692 * Reading from this pointer when `result_ok` is not set is undefined.
694 struct LDKPublicKey *result;
696 * A pointer to the contents in the error state.
697 * Reading from this pointer when `result_ok` is set is undefined.
699 enum LDKSecp256k1Error *err;
700 } LDKCResult_PublicKeyErrorZPtr;
703 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
704 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
705 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
707 typedef struct LDKCResult_PublicKeyErrorZ {
709 * The contents of this CResult_PublicKeyErrorZ, accessible via either
710 * `err` or `result` depending on the state of `result_ok`.
712 union LDKCResult_PublicKeyErrorZPtr contents;
714 * Whether this CResult_PublicKeyErrorZ represents a success state.
717 } LDKCResult_PublicKeyErrorZ;
722 * The set of public keys which are used in the creation of one commitment transaction.
723 * These are derived from the channel base keys and per-commitment data.
725 * A broadcaster key is provided from potential broadcaster of the computed transaction.
726 * A countersignatory key is coming from a protocol participant unable to broadcast the
729 * These keys are assumed to be good, either because the code derived them from
730 * channel basepoints via the new function, or they were obtained via
731 * CommitmentTransaction.trust().keys() because we trusted the source of the
732 * pre-calculated keys.
734 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
736 * A pointer to the opaque Rust object.
737 * Nearly everywhere, inner must be non-null, however in places where
738 * the Rust equivalent takes an Option, it may be set to null to indicate None.
740 LDKnativeTxCreationKeys *inner;
742 * Indicates that this is the only struct which contains the same pointer.
743 * Rust functions which take ownership of an object provided via an argument require
744 * this to be true and invalidate the object pointed to by inner.
750 * The contents of CResult_TxCreationKeysDecodeErrorZ
752 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
754 * A pointer to the contents in the success state.
755 * Reading from this pointer when `result_ok` is not set is undefined.
757 struct LDKTxCreationKeys *result;
759 * A pointer to the contents in the error state.
760 * Reading from this pointer when `result_ok` is set is undefined.
762 struct LDKDecodeError *err;
763 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
766 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
767 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
768 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
770 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
772 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
773 * `err` or `result` depending on the state of `result_ok`.
775 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
777 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
780 } LDKCResult_TxCreationKeysDecodeErrorZ;
785 * One counterparty's public keys which do not change over the life of a channel.
787 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
789 * A pointer to the opaque Rust object.
790 * Nearly everywhere, inner must be non-null, however in places where
791 * the Rust equivalent takes an Option, it may be set to null to indicate None.
793 LDKnativeChannelPublicKeys *inner;
795 * Indicates that this is the only struct which contains the same pointer.
796 * Rust functions which take ownership of an object provided via an argument require
797 * this to be true and invalidate the object pointed to by inner.
800 } LDKChannelPublicKeys;
803 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
805 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
807 * A pointer to the contents in the success state.
808 * Reading from this pointer when `result_ok` is not set is undefined.
810 struct LDKChannelPublicKeys *result;
812 * A pointer to the contents in the error state.
813 * Reading from this pointer when `result_ok` is set is undefined.
815 struct LDKDecodeError *err;
816 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
819 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
820 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
821 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
823 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
825 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
826 * `err` or `result` depending on the state of `result_ok`.
828 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
830 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
833 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
836 * The contents of CResult_TxCreationKeysErrorZ
838 typedef union LDKCResult_TxCreationKeysErrorZPtr {
840 * A pointer to the contents in the success state.
841 * Reading from this pointer when `result_ok` is not set is undefined.
843 struct LDKTxCreationKeys *result;
845 * A pointer to the contents in the error state.
846 * Reading from this pointer when `result_ok` is set is undefined.
848 enum LDKSecp256k1Error *err;
849 } LDKCResult_TxCreationKeysErrorZPtr;
852 * A CResult_TxCreationKeysErrorZ represents the result of a fallible operation,
853 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::c_types::Secp256k1Error on failure.
854 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
856 typedef struct LDKCResult_TxCreationKeysErrorZ {
858 * The contents of this CResult_TxCreationKeysErrorZ, accessible via either
859 * `err` or `result` depending on the state of `result_ok`.
861 union LDKCResult_TxCreationKeysErrorZPtr contents;
863 * Whether this CResult_TxCreationKeysErrorZ represents a success state.
866 } LDKCResult_TxCreationKeysErrorZ;
869 * An enum which can either contain a u32 or not
871 typedef enum LDKCOption_u32Z_Tag {
873 * When we're in this state, this COption_u32Z contains a u32
875 LDKCOption_u32Z_Some,
877 * When we're in this state, this COption_u32Z contains nothing
879 LDKCOption_u32Z_None,
881 * Must be last for serialization purposes
883 LDKCOption_u32Z_Sentinel,
884 } LDKCOption_u32Z_Tag;
886 typedef struct LDKCOption_u32Z {
887 LDKCOption_u32Z_Tag tag;
898 * Information about an HTLC as it appears in a commitment transaction
900 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
902 * A pointer to the opaque Rust object.
903 * Nearly everywhere, inner must be non-null, however in places where
904 * the Rust equivalent takes an Option, it may be set to null to indicate None.
906 LDKnativeHTLCOutputInCommitment *inner;
908 * Indicates that this is the only struct which contains the same pointer.
909 * Rust functions which take ownership of an object provided via an argument require
910 * this to be true and invalidate the object pointed to by inner.
913 } LDKHTLCOutputInCommitment;
916 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
918 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
920 * A pointer to the contents in the success state.
921 * Reading from this pointer when `result_ok` is not set is undefined.
923 struct LDKHTLCOutputInCommitment *result;
925 * A pointer to the contents in the error state.
926 * Reading from this pointer when `result_ok` is set is undefined.
928 struct LDKDecodeError *err;
929 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
932 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
933 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
934 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
936 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
938 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
939 * `err` or `result` depending on the state of `result_ok`.
941 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
943 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
946 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
951 * Late-bound per-channel counterparty data used to build transactions.
953 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
955 * A pointer to the opaque Rust object.
956 * Nearly everywhere, inner must be non-null, however in places where
957 * the Rust equivalent takes an Option, it may be set to null to indicate None.
959 LDKnativeCounterpartyChannelTransactionParameters *inner;
961 * Indicates that this is the only struct which contains the same pointer.
962 * Rust functions which take ownership of an object provided via an argument require
963 * this to be true and invalidate the object pointed to by inner.
966 } LDKCounterpartyChannelTransactionParameters;
969 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
971 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
973 * A pointer to the contents in the success state.
974 * Reading from this pointer when `result_ok` is not set is undefined.
976 struct LDKCounterpartyChannelTransactionParameters *result;
978 * A pointer to the contents in the error state.
979 * Reading from this pointer when `result_ok` is set is undefined.
981 struct LDKDecodeError *err;
982 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
985 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
986 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
987 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
989 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
991 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
992 * `err` or `result` depending on the state of `result_ok`.
994 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
996 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
999 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
1004 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
1005 * The fields are organized by holder/counterparty.
1007 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
1008 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
1010 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
1012 * A pointer to the opaque Rust object.
1013 * Nearly everywhere, inner must be non-null, however in places where
1014 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1016 LDKnativeChannelTransactionParameters *inner;
1018 * Indicates that this is the only struct which contains the same pointer.
1019 * Rust functions which take ownership of an object provided via an argument require
1020 * this to be true and invalidate the object pointed to by inner.
1023 } LDKChannelTransactionParameters;
1026 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
1028 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
1030 * A pointer to the contents in the success state.
1031 * Reading from this pointer when `result_ok` is not set is undefined.
1033 struct LDKChannelTransactionParameters *result;
1035 * A pointer to the contents in the error state.
1036 * Reading from this pointer when `result_ok` is set is undefined.
1038 struct LDKDecodeError *err;
1039 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
1042 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
1043 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1044 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1046 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
1048 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
1049 * `err` or `result` depending on the state of `result_ok`.
1051 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
1053 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
1056 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
1059 * Represents a secp256k1 signature serialized as two 32-byte numbers
1061 typedef struct LDKSignature {
1063 * The bytes of the signature in "compact" form
1065 uint8_t compact_form[64];
1069 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
1070 * This corresponds to std::vector in C++
1072 typedef struct LDKCVec_SignatureZ {
1074 * The elements in the array.
1075 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1077 struct LDKSignature *data;
1079 * The number of elements pointed to by `data`.
1082 } LDKCVec_SignatureZ;
1087 * Information needed to build and sign a holder's commitment transaction.
1089 * The transaction is only signed once we are ready to broadcast.
1091 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
1093 * A pointer to the opaque Rust object.
1094 * Nearly everywhere, inner must be non-null, however in places where
1095 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1097 LDKnativeHolderCommitmentTransaction *inner;
1099 * Indicates that this is the only struct which contains the same pointer.
1100 * Rust functions which take ownership of an object provided via an argument require
1101 * this to be true and invalidate the object pointed to by inner.
1104 } LDKHolderCommitmentTransaction;
1107 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
1109 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
1111 * A pointer to the contents in the success state.
1112 * Reading from this pointer when `result_ok` is not set is undefined.
1114 struct LDKHolderCommitmentTransaction *result;
1116 * A pointer to the contents in the error state.
1117 * Reading from this pointer when `result_ok` is set is undefined.
1119 struct LDKDecodeError *err;
1120 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
1123 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1124 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1125 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1127 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
1129 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
1130 * `err` or `result` depending on the state of `result_ok`.
1132 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
1134 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
1137 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
1142 * A pre-built Bitcoin commitment transaction and its txid.
1144 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
1146 * A pointer to the opaque Rust object.
1147 * Nearly everywhere, inner must be non-null, however in places where
1148 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1150 LDKnativeBuiltCommitmentTransaction *inner;
1152 * Indicates that this is the only struct which contains the same pointer.
1153 * Rust functions which take ownership of an object provided via an argument require
1154 * this to be true and invalidate the object pointed to by inner.
1157 } LDKBuiltCommitmentTransaction;
1160 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
1162 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
1164 * A pointer to the contents in the success state.
1165 * Reading from this pointer when `result_ok` is not set is undefined.
1167 struct LDKBuiltCommitmentTransaction *result;
1169 * A pointer to the contents in the error state.
1170 * Reading from this pointer when `result_ok` is set is undefined.
1172 struct LDKDecodeError *err;
1173 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
1176 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1177 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1178 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1180 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
1182 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
1183 * `err` or `result` depending on the state of `result_ok`.
1185 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
1187 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
1190 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
1195 * A wrapper on ClosingTransaction indicating that the built bitcoin
1196 * transaction is trusted.
1198 * See trust() and verify() functions on CommitmentTransaction.
1200 * This structure implements Deref.
1202 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
1204 * A pointer to the opaque Rust object.
1205 * Nearly everywhere, inner must be non-null, however in places where
1206 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1208 LDKnativeTrustedClosingTransaction *inner;
1210 * Indicates that this is the only struct which contains the same pointer.
1211 * Rust functions which take ownership of an object provided via an argument require
1212 * this to be true and invalidate the object pointed to by inner.
1215 } LDKTrustedClosingTransaction;
1218 * The contents of CResult_TrustedClosingTransactionNoneZ
1220 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
1222 * A pointer to the contents in the success state.
1223 * Reading from this pointer when `result_ok` is not set is undefined.
1225 struct LDKTrustedClosingTransaction *result;
1227 * Note that this value is always NULL, as there are no contents in the Err variant
1230 } LDKCResult_TrustedClosingTransactionNoneZPtr;
1233 * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
1234 * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
1235 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1237 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
1239 * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
1240 * `err` or `result` depending on the state of `result_ok`.
1242 union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
1244 * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
1247 } LDKCResult_TrustedClosingTransactionNoneZ;
1252 * This class tracks the per-transaction information needed to build a commitment transaction and will
1253 * actually build it and sign. It is used for holder transactions that we sign only when needed
1254 * and for transactions we sign for the counterparty.
1256 * This class can be used inside a signer implementation to generate a signature given the relevant
1259 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
1261 * A pointer to the opaque Rust object.
1262 * Nearly everywhere, inner must be non-null, however in places where
1263 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1265 LDKnativeCommitmentTransaction *inner;
1267 * Indicates that this is the only struct which contains the same pointer.
1268 * Rust functions which take ownership of an object provided via an argument require
1269 * this to be true and invalidate the object pointed to by inner.
1272 } LDKCommitmentTransaction;
1275 * The contents of CResult_CommitmentTransactionDecodeErrorZ
1277 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
1279 * A pointer to the contents in the success state.
1280 * Reading from this pointer when `result_ok` is not set is undefined.
1282 struct LDKCommitmentTransaction *result;
1284 * A pointer to the contents in the error state.
1285 * Reading from this pointer when `result_ok` is set is undefined.
1287 struct LDKDecodeError *err;
1288 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
1291 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1292 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1293 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1295 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
1297 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
1298 * `err` or `result` depending on the state of `result_ok`.
1300 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
1302 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
1305 } LDKCResult_CommitmentTransactionDecodeErrorZ;
1310 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
1311 * transaction and the transaction creation keys) are trusted.
1313 * See trust() and verify() functions on CommitmentTransaction.
1315 * This structure implements Deref.
1317 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
1319 * A pointer to the opaque Rust object.
1320 * Nearly everywhere, inner must be non-null, however in places where
1321 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1323 LDKnativeTrustedCommitmentTransaction *inner;
1325 * Indicates that this is the only struct which contains the same pointer.
1326 * Rust functions which take ownership of an object provided via an argument require
1327 * this to be true and invalidate the object pointed to by inner.
1330 } LDKTrustedCommitmentTransaction;
1333 * The contents of CResult_TrustedCommitmentTransactionNoneZ
1335 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
1337 * A pointer to the contents in the success state.
1338 * Reading from this pointer when `result_ok` is not set is undefined.
1340 struct LDKTrustedCommitmentTransaction *result;
1342 * Note that this value is always NULL, as there are no contents in the Err variant
1345 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
1348 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
1349 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
1350 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1352 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
1354 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
1355 * `err` or `result` depending on the state of `result_ok`.
1357 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
1359 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
1362 } LDKCResult_TrustedCommitmentTransactionNoneZ;
1365 * The contents of CResult_CVec_SignatureZNoneZ
1367 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
1369 * A pointer to the contents in the success state.
1370 * Reading from this pointer when `result_ok` is not set is undefined.
1372 struct LDKCVec_SignatureZ *result;
1374 * Note that this value is always NULL, as there are no contents in the Err variant
1377 } LDKCResult_CVec_SignatureZNoneZPtr;
1380 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
1381 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
1382 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1384 typedef struct LDKCResult_CVec_SignatureZNoneZ {
1386 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
1387 * `err` or `result` depending on the state of `result_ok`.
1389 union LDKCResult_CVec_SignatureZNoneZPtr contents;
1391 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
1394 } LDKCResult_CVec_SignatureZNoneZ;
1399 * A script pubkey for shutting down a channel as defined by [BOLT #2].
1401 * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md
1403 typedef struct MUST_USE_STRUCT LDKShutdownScript {
1405 * A pointer to the opaque Rust object.
1406 * Nearly everywhere, inner must be non-null, however in places where
1407 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1409 LDKnativeShutdownScript *inner;
1411 * Indicates that this is the only struct which contains the same pointer.
1412 * Rust functions which take ownership of an object provided via an argument require
1413 * this to be true and invalidate the object pointed to by inner.
1416 } LDKShutdownScript;
1419 * The contents of CResult_ShutdownScriptDecodeErrorZ
1421 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
1423 * A pointer to the contents in the success state.
1424 * Reading from this pointer when `result_ok` is not set is undefined.
1426 struct LDKShutdownScript *result;
1428 * A pointer to the contents in the error state.
1429 * Reading from this pointer when `result_ok` is set is undefined.
1431 struct LDKDecodeError *err;
1432 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
1435 * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
1436 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
1437 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1439 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
1441 * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
1442 * `err` or `result` depending on the state of `result_ok`.
1444 union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
1446 * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
1449 } LDKCResult_ShutdownScriptDecodeErrorZ;
1454 * An error occurring when converting from [`Script`] to [`ShutdownScript`].
1456 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
1458 * A pointer to the opaque Rust object.
1459 * Nearly everywhere, inner must be non-null, however in places where
1460 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1462 LDKnativeInvalidShutdownScript *inner;
1464 * Indicates that this is the only struct which contains the same pointer.
1465 * Rust functions which take ownership of an object provided via an argument require
1466 * this to be true and invalidate the object pointed to by inner.
1469 } LDKInvalidShutdownScript;
1472 * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
1474 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
1476 * A pointer to the contents in the success state.
1477 * Reading from this pointer when `result_ok` is not set is undefined.
1479 struct LDKShutdownScript *result;
1481 * A pointer to the contents in the error state.
1482 * Reading from this pointer when `result_ok` is set is undefined.
1484 struct LDKInvalidShutdownScript *err;
1485 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
1488 * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
1489 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
1490 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1492 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
1494 * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
1495 * `err` or `result` depending on the state of `result_ok`.
1497 union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
1499 * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
1502 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
1505 * The contents of CResult_NoneErrorZ
1507 typedef union LDKCResult_NoneErrorZPtr {
1509 * Note that this value is always NULL, as there are no contents in the OK variant
1513 * A pointer to the contents in the error state.
1514 * Reading from this pointer when `result_ok` is set is undefined.
1516 enum LDKIOError *err;
1517 } LDKCResult_NoneErrorZPtr;
1520 * A CResult_NoneErrorZ represents the result of a fallible operation,
1521 * containing a () on success and a crate::c_types::IOError on failure.
1522 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1524 typedef struct LDKCResult_NoneErrorZ {
1526 * The contents of this CResult_NoneErrorZ, accessible via either
1527 * `err` or `result` depending on the state of `result_ok`.
1529 union LDKCResult_NoneErrorZPtr contents;
1531 * Whether this CResult_NoneErrorZ represents a success state.
1534 } LDKCResult_NoneErrorZ;
1541 typedef struct MUST_USE_STRUCT LDKRouteHop {
1543 * A pointer to the opaque Rust object.
1544 * Nearly everywhere, inner must be non-null, however in places where
1545 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1547 LDKnativeRouteHop *inner;
1549 * Indicates that this is the only struct which contains the same pointer.
1550 * Rust functions which take ownership of an object provided via an argument require
1551 * this to be true and invalidate the object pointed to by inner.
1557 * The contents of CResult_RouteHopDecodeErrorZ
1559 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
1561 * A pointer to the contents in the success state.
1562 * Reading from this pointer when `result_ok` is not set is undefined.
1564 struct LDKRouteHop *result;
1566 * A pointer to the contents in the error state.
1567 * Reading from this pointer when `result_ok` is set is undefined.
1569 struct LDKDecodeError *err;
1570 } LDKCResult_RouteHopDecodeErrorZPtr;
1573 * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
1574 * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
1575 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1577 typedef struct LDKCResult_RouteHopDecodeErrorZ {
1579 * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
1580 * `err` or `result` depending on the state of `result_ok`.
1582 union LDKCResult_RouteHopDecodeErrorZPtr contents;
1584 * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
1587 } LDKCResult_RouteHopDecodeErrorZ;
1590 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
1591 * This corresponds to std::vector in C++
1593 typedef struct LDKCVec_RouteHopZ {
1595 * The elements in the array.
1596 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1598 struct LDKRouteHop *data;
1600 * The number of elements pointed to by `data`.
1603 } LDKCVec_RouteHopZ;
1606 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
1607 * This corresponds to std::vector in C++
1609 typedef struct LDKCVec_CVec_RouteHopZZ {
1611 * The elements in the array.
1612 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1614 struct LDKCVec_RouteHopZ *data;
1616 * The number of elements pointed to by `data`.
1619 } LDKCVec_CVec_RouteHopZZ;
1624 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
1625 * it can take multiple paths. Each path is composed of one or more hops through the network.
1627 typedef struct MUST_USE_STRUCT LDKRoute {
1629 * A pointer to the opaque Rust object.
1630 * Nearly everywhere, inner must be non-null, however in places where
1631 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1633 LDKnativeRoute *inner;
1635 * Indicates that this is the only struct which contains the same pointer.
1636 * Rust functions which take ownership of an object provided via an argument require
1637 * this to be true and invalidate the object pointed to by inner.
1643 * The contents of CResult_RouteDecodeErrorZ
1645 typedef union LDKCResult_RouteDecodeErrorZPtr {
1647 * A pointer to the contents in the success state.
1648 * Reading from this pointer when `result_ok` is not set is undefined.
1650 struct LDKRoute *result;
1652 * A pointer to the contents in the error state.
1653 * Reading from this pointer when `result_ok` is set is undefined.
1655 struct LDKDecodeError *err;
1656 } LDKCResult_RouteDecodeErrorZPtr;
1659 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
1660 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
1661 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1663 typedef struct LDKCResult_RouteDecodeErrorZ {
1665 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
1666 * `err` or `result` depending on the state of `result_ok`.
1668 union LDKCResult_RouteDecodeErrorZPtr contents;
1670 * Whether this CResult_RouteDecodeErrorZ represents a success state.
1673 } LDKCResult_RouteDecodeErrorZ;
1678 * Parameters needed to find a [`Route`].
1680 * Passed to [`find_route`] and also provided in [`Event::PaymentPathFailed`] for retrying a failed
1683 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
1685 typedef struct MUST_USE_STRUCT LDKRouteParameters {
1687 * A pointer to the opaque Rust object.
1688 * Nearly everywhere, inner must be non-null, however in places where
1689 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1691 LDKnativeRouteParameters *inner;
1693 * Indicates that this is the only struct which contains the same pointer.
1694 * Rust functions which take ownership of an object provided via an argument require
1695 * this to be true and invalidate the object pointed to by inner.
1698 } LDKRouteParameters;
1701 * The contents of CResult_RouteParametersDecodeErrorZ
1703 typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
1705 * A pointer to the contents in the success state.
1706 * Reading from this pointer when `result_ok` is not set is undefined.
1708 struct LDKRouteParameters *result;
1710 * A pointer to the contents in the error state.
1711 * Reading from this pointer when `result_ok` is set is undefined.
1713 struct LDKDecodeError *err;
1714 } LDKCResult_RouteParametersDecodeErrorZPtr;
1717 * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
1718 * containing a crate::lightning::routing::router::RouteParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1719 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1721 typedef struct LDKCResult_RouteParametersDecodeErrorZ {
1723 * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
1724 * `err` or `result` depending on the state of `result_ok`.
1726 union LDKCResult_RouteParametersDecodeErrorZPtr contents;
1728 * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
1731 } LDKCResult_RouteParametersDecodeErrorZ;
1736 * A list of hops along a payment path terminating with a channel to the recipient.
1738 typedef struct MUST_USE_STRUCT LDKRouteHint {
1740 * A pointer to the opaque Rust object.
1741 * Nearly everywhere, inner must be non-null, however in places where
1742 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1744 LDKnativeRouteHint *inner;
1746 * Indicates that this is the only struct which contains the same pointer.
1747 * Rust functions which take ownership of an object provided via an argument require
1748 * this to be true and invalidate the object pointed to by inner.
1754 * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
1755 * This corresponds to std::vector in C++
1757 typedef struct LDKCVec_RouteHintZ {
1759 * The elements in the array.
1760 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1762 struct LDKRouteHint *data;
1764 * The number of elements pointed to by `data`.
1767 } LDKCVec_RouteHintZ;
1770 * An enum which can either contain a u64 or not
1772 typedef enum LDKCOption_u64Z_Tag {
1774 * When we're in this state, this COption_u64Z contains a u64
1776 LDKCOption_u64Z_Some,
1778 * When we're in this state, this COption_u64Z contains nothing
1780 LDKCOption_u64Z_None,
1782 * Must be last for serialization purposes
1784 LDKCOption_u64Z_Sentinel,
1785 } LDKCOption_u64Z_Tag;
1787 typedef struct LDKCOption_u64Z {
1788 LDKCOption_u64Z_Tag tag;
1799 * The recipient of a payment.
1801 typedef struct MUST_USE_STRUCT LDKPaymentParameters {
1803 * A pointer to the opaque Rust object.
1804 * Nearly everywhere, inner must be non-null, however in places where
1805 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1807 LDKnativePaymentParameters *inner;
1809 * Indicates that this is the only struct which contains the same pointer.
1810 * Rust functions which take ownership of an object provided via an argument require
1811 * this to be true and invalidate the object pointed to by inner.
1814 } LDKPaymentParameters;
1817 * The contents of CResult_PaymentParametersDecodeErrorZ
1819 typedef union LDKCResult_PaymentParametersDecodeErrorZPtr {
1821 * A pointer to the contents in the success state.
1822 * Reading from this pointer when `result_ok` is not set is undefined.
1824 struct LDKPaymentParameters *result;
1826 * A pointer to the contents in the error state.
1827 * Reading from this pointer when `result_ok` is set is undefined.
1829 struct LDKDecodeError *err;
1830 } LDKCResult_PaymentParametersDecodeErrorZPtr;
1833 * A CResult_PaymentParametersDecodeErrorZ represents the result of a fallible operation,
1834 * containing a crate::lightning::routing::router::PaymentParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1835 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1837 typedef struct LDKCResult_PaymentParametersDecodeErrorZ {
1839 * The contents of this CResult_PaymentParametersDecodeErrorZ, accessible via either
1840 * `err` or `result` depending on the state of `result_ok`.
1842 union LDKCResult_PaymentParametersDecodeErrorZPtr contents;
1844 * Whether this CResult_PaymentParametersDecodeErrorZ represents a success state.
1847 } LDKCResult_PaymentParametersDecodeErrorZ;
1852 * A channel descriptor for a hop along a payment path.
1854 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
1856 * A pointer to the opaque Rust object.
1857 * Nearly everywhere, inner must be non-null, however in places where
1858 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1860 LDKnativeRouteHintHop *inner;
1862 * Indicates that this is the only struct which contains the same pointer.
1863 * Rust functions which take ownership of an object provided via an argument require
1864 * this to be true and invalidate the object pointed to by inner.
1870 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
1871 * This corresponds to std::vector in C++
1873 typedef struct LDKCVec_RouteHintHopZ {
1875 * The elements in the array.
1876 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1878 struct LDKRouteHintHop *data;
1880 * The number of elements pointed to by `data`.
1883 } LDKCVec_RouteHintHopZ;
1886 * The contents of CResult_RouteHintDecodeErrorZ
1888 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
1890 * A pointer to the contents in the success state.
1891 * Reading from this pointer when `result_ok` is not set is undefined.
1893 struct LDKRouteHint *result;
1895 * A pointer to the contents in the error state.
1896 * Reading from this pointer when `result_ok` is set is undefined.
1898 struct LDKDecodeError *err;
1899 } LDKCResult_RouteHintDecodeErrorZPtr;
1902 * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
1903 * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
1904 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1906 typedef struct LDKCResult_RouteHintDecodeErrorZ {
1908 * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
1909 * `err` or `result` depending on the state of `result_ok`.
1911 union LDKCResult_RouteHintDecodeErrorZPtr contents;
1913 * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
1916 } LDKCResult_RouteHintDecodeErrorZ;
1919 * The contents of CResult_RouteHintHopDecodeErrorZ
1921 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
1923 * A pointer to the contents in the success state.
1924 * Reading from this pointer when `result_ok` is not set is undefined.
1926 struct LDKRouteHintHop *result;
1928 * A pointer to the contents in the error state.
1929 * Reading from this pointer when `result_ok` is set is undefined.
1931 struct LDKDecodeError *err;
1932 } LDKCResult_RouteHintHopDecodeErrorZPtr;
1935 * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
1936 * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
1937 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1939 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
1941 * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
1942 * `err` or `result` depending on the state of `result_ok`.
1944 union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
1946 * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
1949 } LDKCResult_RouteHintHopDecodeErrorZ;
1954 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
1956 typedef struct MUST_USE_STRUCT LDKChannelDetails {
1958 * A pointer to the opaque Rust object.
1959 * Nearly everywhere, inner must be non-null, however in places where
1960 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1962 LDKnativeChannelDetails *inner;
1964 * Indicates that this is the only struct which contains the same pointer.
1965 * Rust functions which take ownership of an object provided via an argument require
1966 * this to be true and invalidate the object pointed to by inner.
1969 } LDKChannelDetails;
1972 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
1973 * This corresponds to std::vector in C++
1975 typedef struct LDKCVec_ChannelDetailsZ {
1977 * The elements in the array.
1978 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1980 struct LDKChannelDetails *data;
1982 * The number of elements pointed to by `data`.
1985 } LDKCVec_ChannelDetailsZ;
1990 * An Err type for failure to process messages.
1992 typedef struct MUST_USE_STRUCT LDKLightningError {
1994 * A pointer to the opaque Rust object.
1995 * Nearly everywhere, inner must be non-null, however in places where
1996 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1998 LDKnativeLightningError *inner;
2000 * Indicates that this is the only struct which contains the same pointer.
2001 * Rust functions which take ownership of an object provided via an argument require
2002 * this to be true and invalidate the object pointed to by inner.
2005 } LDKLightningError;
2008 * The contents of CResult_RouteLightningErrorZ
2010 typedef union LDKCResult_RouteLightningErrorZPtr {
2012 * A pointer to the contents in the success state.
2013 * Reading from this pointer when `result_ok` is not set is undefined.
2015 struct LDKRoute *result;
2017 * A pointer to the contents in the error state.
2018 * Reading from this pointer when `result_ok` is set is undefined.
2020 struct LDKLightningError *err;
2021 } LDKCResult_RouteLightningErrorZPtr;
2024 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
2025 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
2026 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2028 typedef struct LDKCResult_RouteLightningErrorZ {
2030 * The contents of this CResult_RouteLightningErrorZ, accessible via either
2031 * `err` or `result` depending on the state of `result_ok`.
2033 union LDKCResult_RouteLightningErrorZPtr contents;
2035 * Whether this CResult_RouteLightningErrorZ represents a success state.
2038 } LDKCResult_RouteLightningErrorZ;
2041 * The contents of CResult_TxOutAccessErrorZ
2043 typedef union LDKCResult_TxOutAccessErrorZPtr {
2045 * A pointer to the contents in the success state.
2046 * Reading from this pointer when `result_ok` is not set is undefined.
2048 struct LDKTxOut *result;
2050 * A pointer to the contents in the error state.
2051 * Reading from this pointer when `result_ok` is set is undefined.
2053 enum LDKAccessError *err;
2054 } LDKCResult_TxOutAccessErrorZPtr;
2057 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
2058 * containing a crate::c_types::TxOut on success and a crate::lightning::chain::AccessError on failure.
2059 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2061 typedef struct LDKCResult_TxOutAccessErrorZ {
2063 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
2064 * `err` or `result` depending on the state of `result_ok`.
2066 union LDKCResult_TxOutAccessErrorZPtr contents;
2068 * Whether this CResult_TxOutAccessErrorZ represents a success state.
2071 } LDKCResult_TxOutAccessErrorZ;
2074 * A tuple of 2 elements. See the individual fields for the types contained.
2076 typedef struct LDKC2Tuple_usizeTransactionZ {
2078 * The element at position 0
2082 * The element at position 1
2084 struct LDKTransaction b;
2085 } LDKC2Tuple_usizeTransactionZ;
2088 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
2089 * This corresponds to std::vector in C++
2091 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
2093 * The elements in the array.
2094 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2096 struct LDKC2Tuple_usizeTransactionZ *data;
2098 * The number of elements pointed to by `data`.
2101 } LDKCVec_C2Tuple_usizeTransactionZZ;
2104 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
2105 * look up the corresponding function in rust-lightning's docs.
2107 typedef struct LDKThirtyTwoBytes {
2109 * The thirty-two bytes
2112 } LDKThirtyTwoBytes;
2115 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
2116 * This corresponds to std::vector in C++
2118 typedef struct LDKCVec_TxidZ {
2120 * The elements in the array.
2121 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2123 struct LDKThirtyTwoBytes *data;
2125 * The number of elements pointed to by `data`.
2131 * The contents of CResult_NoneChannelMonitorUpdateErrZ
2133 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
2135 * Note that this value is always NULL, as there are no contents in the OK variant
2139 * A pointer to the contents in the error state.
2140 * Reading from this pointer when `result_ok` is set is undefined.
2142 enum LDKChannelMonitorUpdateErr *err;
2143 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
2146 * A CResult_NoneChannelMonitorUpdateErrZ represents the result of a fallible operation,
2147 * containing a () on success and a crate::lightning::chain::ChannelMonitorUpdateErr on failure.
2148 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2150 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
2152 * The contents of this CResult_NoneChannelMonitorUpdateErrZ, accessible via either
2153 * `err` or `result` depending on the state of `result_ok`.
2155 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
2157 * Whether this CResult_NoneChannelMonitorUpdateErrZ represents a success state.
2160 } LDKCResult_NoneChannelMonitorUpdateErrZ;
2165 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
2166 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
2167 * preimage claim backward will lead to loss of funds.
2169 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
2171 * A pointer to the opaque Rust object.
2172 * Nearly everywhere, inner must be non-null, however in places where
2173 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2175 LDKnativeHTLCUpdate *inner;
2177 * Indicates that this is the only struct which contains the same pointer.
2178 * Rust functions which take ownership of an object provided via an argument require
2179 * this to be true and invalidate the object pointed to by inner.
2187 * A reference to a transaction output.
2189 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
2190 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
2192 typedef struct MUST_USE_STRUCT LDKOutPoint {
2194 * A pointer to the opaque Rust object.
2195 * Nearly everywhere, inner must be non-null, however in places where
2196 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2198 LDKnativeOutPoint *inner;
2200 * Indicates that this is the only struct which contains the same pointer.
2201 * Rust functions which take ownership of an object provided via an argument require
2202 * this to be true and invalidate the object pointed to by inner.
2208 * An event to be processed by the ChannelManager.
2210 typedef enum LDKMonitorEvent_Tag {
2212 * A monitor event containing an HTLCUpdate.
2214 LDKMonitorEvent_HTLCEvent,
2216 * A monitor event that the Channel's commitment transaction was confirmed.
2218 LDKMonitorEvent_CommitmentTxConfirmed,
2220 * Indicates a [`ChannelMonitor`] update has completed. See
2221 * [`ChannelMonitorUpdateErr::TemporaryFailure`] for more information on how this is used.
2223 * [`ChannelMonitorUpdateErr::TemporaryFailure`]: super::ChannelMonitorUpdateErr::TemporaryFailure
2225 LDKMonitorEvent_UpdateCompleted,
2227 * Indicates a [`ChannelMonitor`] update has failed. See
2228 * [`ChannelMonitorUpdateErr::PermanentFailure`] for more information on how this is used.
2230 * [`ChannelMonitorUpdateErr::PermanentFailure`]: super::ChannelMonitorUpdateErr::PermanentFailure
2232 LDKMonitorEvent_UpdateFailed,
2234 * Must be last for serialization purposes
2236 LDKMonitorEvent_Sentinel,
2237 } LDKMonitorEvent_Tag;
2239 typedef struct LDKMonitorEvent_LDKUpdateCompleted_Body {
2241 * The funding outpoint of the [`ChannelMonitor`] that was updated
2243 struct LDKOutPoint funding_txo;
2245 * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
2246 * [`ChannelMonitor::get_latest_update_id`].
2248 * Note that this should only be set to a given update's ID if all previous updates for the
2249 * same [`ChannelMonitor`] have been applied and persisted.
2251 uint64_t monitor_update_id;
2252 } LDKMonitorEvent_LDKUpdateCompleted_Body;
2254 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
2255 LDKMonitorEvent_Tag tag;
2258 struct LDKHTLCUpdate htlc_event;
2261 struct LDKOutPoint commitment_tx_confirmed;
2263 LDKMonitorEvent_LDKUpdateCompleted_Body update_completed;
2265 struct LDKOutPoint update_failed;
2271 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
2272 * This corresponds to std::vector in C++
2274 typedef struct LDKCVec_MonitorEventZ {
2276 * The elements in the array.
2277 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2279 struct LDKMonitorEvent *data;
2281 * The number of elements pointed to by `data`.
2284 } LDKCVec_MonitorEventZ;
2287 * An enum which can either contain a crate::c_types::derived::C2Tuple_usizeTransactionZ or not
2289 typedef enum LDKCOption_C2Tuple_usizeTransactionZZ_Tag {
2291 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains a crate::c_types::derived::C2Tuple_usizeTransactionZ
2293 LDKCOption_C2Tuple_usizeTransactionZZ_Some,
2295 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains nothing
2297 LDKCOption_C2Tuple_usizeTransactionZZ_None,
2299 * Must be last for serialization purposes
2301 LDKCOption_C2Tuple_usizeTransactionZZ_Sentinel,
2302 } LDKCOption_C2Tuple_usizeTransactionZZ_Tag;
2304 typedef struct LDKCOption_C2Tuple_usizeTransactionZZ {
2305 LDKCOption_C2Tuple_usizeTransactionZZ_Tag tag;
2308 struct LDKC2Tuple_usizeTransactionZ some;
2311 } LDKCOption_C2Tuple_usizeTransactionZZ;
2314 * The reason the channel was closed. See individual variants more details.
2316 typedef enum LDKClosureReason_Tag {
2318 * Closure generated from receiving a peer error message.
2320 * Our counterparty may have broadcasted their latest commitment state, and we have
2323 LDKClosureReason_CounterpartyForceClosed,
2325 * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
2327 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
2329 LDKClosureReason_HolderForceClosed,
2331 * The channel was closed after negotiating a cooperative close and we've now broadcasted
2332 * the cooperative close transaction. Note the shutdown may have been initiated by us.
2334 LDKClosureReason_CooperativeClosure,
2336 * A commitment transaction was confirmed on chain, closing the channel. Most likely this
2337 * commitment transaction came from our counterparty, but it may also have come from
2338 * a copy of our own `ChannelMonitor`.
2340 LDKClosureReason_CommitmentTxConfirmed,
2342 * The funding transaction failed to confirm in a timely manner on an inbound channel.
2344 LDKClosureReason_FundingTimedOut,
2346 * Closure generated from processing an event, likely a HTLC forward/relay/reception.
2348 LDKClosureReason_ProcessingError,
2350 * The `PeerManager` informed us that we've disconnected from the peer. We close channels
2351 * if the `PeerManager` informed us that it is unlikely we'll be able to connect to the
2352 * peer again in the future or if the peer disconnected before we finished negotiating
2353 * the channel open. The first case may be caused by incompatible features which our
2354 * counterparty, or we, require.
2356 LDKClosureReason_DisconnectedPeer,
2358 * Closure generated from `ChannelManager::read` if the ChannelMonitor is newer than
2359 * the ChannelManager deserialized.
2361 LDKClosureReason_OutdatedChannelManager,
2363 * Must be last for serialization purposes
2365 LDKClosureReason_Sentinel,
2366 } LDKClosureReason_Tag;
2368 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
2370 * The error which the peer sent us.
2372 * The string should be sanitized before it is used (e.g emitted to logs
2373 * or printed to stdout). Otherwise, a well crafted error message may exploit
2374 * a security vulnerability in the terminal emulator or the logging subsystem.
2376 struct LDKStr peer_msg;
2377 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
2379 typedef struct LDKClosureReason_LDKProcessingError_Body {
2381 * A developer-readable error message which we generated.
2384 } LDKClosureReason_LDKProcessingError_Body;
2386 typedef struct MUST_USE_STRUCT LDKClosureReason {
2387 LDKClosureReason_Tag tag;
2389 LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
2390 LDKClosureReason_LDKProcessingError_Body processing_error;
2395 * An enum which can either contain a crate::lightning::util::events::ClosureReason or not
2397 typedef enum LDKCOption_ClosureReasonZ_Tag {
2399 * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::util::events::ClosureReason
2401 LDKCOption_ClosureReasonZ_Some,
2403 * When we're in this state, this COption_ClosureReasonZ contains nothing
2405 LDKCOption_ClosureReasonZ_None,
2407 * Must be last for serialization purposes
2409 LDKCOption_ClosureReasonZ_Sentinel,
2410 } LDKCOption_ClosureReasonZ_Tag;
2412 typedef struct LDKCOption_ClosureReasonZ {
2413 LDKCOption_ClosureReasonZ_Tag tag;
2416 struct LDKClosureReason some;
2419 } LDKCOption_ClosureReasonZ;
2422 * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
2424 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
2426 * A pointer to the contents in the success state.
2427 * Reading from this pointer when `result_ok` is not set is undefined.
2429 struct LDKCOption_ClosureReasonZ *result;
2431 * A pointer to the contents in the error state.
2432 * Reading from this pointer when `result_ok` is set is undefined.
2434 struct LDKDecodeError *err;
2435 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
2438 * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
2439 * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
2440 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2442 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
2444 * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
2445 * `err` or `result` depending on the state of `result_ok`.
2447 union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
2449 * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
2452 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
2457 * A channel_update message to be sent or received from a peer
2459 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
2461 * A pointer to the opaque Rust object.
2462 * Nearly everywhere, inner must be non-null, however in places where
2463 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2465 LDKnativeChannelUpdate *inner;
2467 * Indicates that this is the only struct which contains the same pointer.
2468 * Rust functions which take ownership of an object provided via an argument require
2469 * this to be true and invalidate the object pointed to by inner.
2475 * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
2476 * return packet by a node along the route. See [BOLT #4] for details.
2478 * [BOLT #4]: https://github.com/lightningnetwork/lightning-rfc/blob/master/04-onion-routing.md
2480 typedef enum LDKNetworkUpdate_Tag {
2482 * An error indicating a `channel_update` messages should be applied via
2483 * [`NetworkGraph::update_channel`].
2485 LDKNetworkUpdate_ChannelUpdateMessage,
2487 * An error indicating only that a channel has been closed, which should be applied via
2488 * [`NetworkGraph::close_channel_from_update`].
2490 LDKNetworkUpdate_ChannelClosed,
2492 * An error indicating only that a node has failed, which should be applied via
2493 * [`NetworkGraph::fail_node`].
2495 LDKNetworkUpdate_NodeFailure,
2497 * Must be last for serialization purposes
2499 LDKNetworkUpdate_Sentinel,
2500 } LDKNetworkUpdate_Tag;
2502 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
2504 * The update to apply via [`NetworkGraph::update_channel`].
2506 struct LDKChannelUpdate msg;
2507 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
2509 typedef struct LDKNetworkUpdate_LDKChannelClosed_Body {
2511 * The short channel id of the closed channel.
2513 uint64_t short_channel_id;
2515 * Whether the channel should be permanently removed or temporarily disabled until a new
2516 * `channel_update` message is received.
2519 } LDKNetworkUpdate_LDKChannelClosed_Body;
2521 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
2523 * The node id of the failed node.
2525 struct LDKPublicKey node_id;
2527 * Whether the node should be permanently removed from consideration or can be restored
2528 * when a new `channel_update` message is received.
2531 } LDKNetworkUpdate_LDKNodeFailure_Body;
2533 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
2534 LDKNetworkUpdate_Tag tag;
2536 LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
2537 LDKNetworkUpdate_LDKChannelClosed_Body channel_closed;
2538 LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
2543 * An enum which can either contain a crate::lightning::routing::network_graph::NetworkUpdate or not
2545 typedef enum LDKCOption_NetworkUpdateZ_Tag {
2547 * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::network_graph::NetworkUpdate
2549 LDKCOption_NetworkUpdateZ_Some,
2551 * When we're in this state, this COption_NetworkUpdateZ contains nothing
2553 LDKCOption_NetworkUpdateZ_None,
2555 * Must be last for serialization purposes
2557 LDKCOption_NetworkUpdateZ_Sentinel,
2558 } LDKCOption_NetworkUpdateZ_Tag;
2560 typedef struct LDKCOption_NetworkUpdateZ {
2561 LDKCOption_NetworkUpdateZ_Tag tag;
2564 struct LDKNetworkUpdate some;
2567 } LDKCOption_NetworkUpdateZ;
2572 * Information about a spendable output to a P2WSH script. See
2573 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
2575 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
2577 * A pointer to the opaque Rust object.
2578 * Nearly everywhere, inner must be non-null, however in places where
2579 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2581 LDKnativeDelayedPaymentOutputDescriptor *inner;
2583 * Indicates that this is the only struct which contains the same pointer.
2584 * Rust functions which take ownership of an object provided via an argument require
2585 * this to be true and invalidate the object pointed to by inner.
2588 } LDKDelayedPaymentOutputDescriptor;
2593 * Information about a spendable output to our \"payment key\". See
2594 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
2596 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
2598 * A pointer to the opaque Rust object.
2599 * Nearly everywhere, inner must be non-null, however in places where
2600 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2602 LDKnativeStaticPaymentOutputDescriptor *inner;
2604 * Indicates that this is the only struct which contains the same pointer.
2605 * Rust functions which take ownership of an object provided via an argument require
2606 * this to be true and invalidate the object pointed to by inner.
2609 } LDKStaticPaymentOutputDescriptor;
2612 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
2613 * claim at any point in the future) an event is generated which you must track and be able to
2614 * spend on-chain. The information needed to do this is provided in this enum, including the
2615 * outpoint describing which txid and output index is available, the full output which exists at
2616 * that txid/index, and any keys or other information required to sign.
2618 typedef enum LDKSpendableOutputDescriptor_Tag {
2620 * An output to a script which was provided via KeysInterface directly, either from
2621 * `get_destination_script()` or `get_shutdown_scriptpubkey()`, thus you should already know
2622 * how to spend it. No secret keys are provided as rust-lightning was never given any key.
2623 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
2624 * on-chain using the payment preimage or after it has timed out.
2626 LDKSpendableOutputDescriptor_StaticOutput,
2628 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
2630 * The witness in the spending input should be:
2631 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
2633 * Note that the nSequence field in the spending input must be set to to_self_delay
2634 * (which means the transaction is not broadcastable until at least to_self_delay
2635 * blocks after the outpoint confirms).
2637 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
2638 * it is an output from an old state which we broadcast (which should never happen).
2640 * To derive the delayed_payment key which is used to sign for this input, you must pass the
2641 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
2642 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
2643 * chan_utils::derive_private_key. The public key can be generated without the secret key
2644 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
2647 * To derive the revocation_pubkey provided here (which is used in the witness
2648 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
2649 * call to Sign::ready_channel) and the provided per_commitment point
2650 * to chan_utils::derive_public_revocation_key.
2652 * The witness script which is hashed and included in the output script_pubkey may be
2653 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
2654 * (derived as above), and the to_self_delay contained here to
2655 * chan_utils::get_revokeable_redeemscript.
2657 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
2659 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
2660 * corresponds to the public key in Sign::pubkeys().payment_point).
2661 * The witness in the spending input, is, thus, simply:
2662 * <BIP 143 signature> <payment key>
2664 * These are generally the result of our counterparty having broadcast the current state,
2665 * allowing us to claim the non-HTLC-encumbered outputs immediately.
2667 LDKSpendableOutputDescriptor_StaticPaymentOutput,
2669 * Must be last for serialization purposes
2671 LDKSpendableOutputDescriptor_Sentinel,
2672 } LDKSpendableOutputDescriptor_Tag;
2674 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
2676 * The outpoint which is spendable
2678 struct LDKOutPoint outpoint;
2680 * The output which is referenced by the given outpoint.
2682 struct LDKTxOut output;
2683 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
2685 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
2686 LDKSpendableOutputDescriptor_Tag tag;
2688 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
2690 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
2693 struct LDKStaticPaymentOutputDescriptor static_payment_output;
2696 } LDKSpendableOutputDescriptor;
2699 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
2700 * This corresponds to std::vector in C++
2702 typedef struct LDKCVec_SpendableOutputDescriptorZ {
2704 * The elements in the array.
2705 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2707 struct LDKSpendableOutputDescriptor *data;
2709 * The number of elements pointed to by `data`.
2712 } LDKCVec_SpendableOutputDescriptorZ;
2715 * Some information provided on receipt of payment depends on whether the payment received is a
2716 * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
2718 typedef enum LDKPaymentPurpose_Tag {
2720 * Information for receiving a payment that we generated an invoice for.
2722 LDKPaymentPurpose_InvoicePayment,
2724 * Because this is a spontaneous payment, the payer generated their own preimage rather than us
2725 * (the payee) providing a preimage.
2727 LDKPaymentPurpose_SpontaneousPayment,
2729 * Must be last for serialization purposes
2731 LDKPaymentPurpose_Sentinel,
2732 } LDKPaymentPurpose_Tag;
2734 typedef struct LDKPaymentPurpose_LDKInvoicePayment_Body {
2736 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
2737 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
2738 * [`ChannelManager::claim_funds`].
2740 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2741 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2743 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2745 struct LDKThirtyTwoBytes payment_preimage;
2747 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
2748 * number of deanonymization attacks during the routing process.
2749 * It is provided here for your reference, however its accuracy is enforced directly by
2750 * [`ChannelManager`] using the values you previously provided to
2751 * [`ChannelManager::create_inbound_payment`] or
2752 * [`ChannelManager::create_inbound_payment_for_hash`].
2754 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2755 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2756 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
2758 struct LDKThirtyTwoBytes payment_secret;
2759 } LDKPaymentPurpose_LDKInvoicePayment_Body;
2761 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
2762 LDKPaymentPurpose_Tag tag;
2764 LDKPaymentPurpose_LDKInvoicePayment_Body invoice_payment;
2766 struct LDKThirtyTwoBytes spontaneous_payment;
2769 } LDKPaymentPurpose;
2772 * An Event which you should probably take some action in response to.
2774 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
2775 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
2776 * written as it makes no sense to respond to it after reconnecting to peers).
2778 typedef enum LDKEvent_Tag {
2780 * Used to indicate that the client should generate a funding transaction with the given
2781 * parameters and then call [`ChannelManager::funding_transaction_generated`].
2782 * Generated in [`ChannelManager`] message handling.
2783 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
2784 * counterparty can steal your funds!
2786 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2787 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
2789 LDKEvent_FundingGenerationReady,
2791 * Indicates we've received money! Just gotta dig out that payment preimage and feed it to
2792 * [`ChannelManager::claim_funds`] to get it....
2793 * Note that if the preimage is not known, you should call
2794 * [`ChannelManager::fail_htlc_backwards`] to free up resources for this HTLC and avoid
2795 * network congestion.
2796 * If you fail to call either [`ChannelManager::claim_funds`] or
2797 * [`ChannelManager::fail_htlc_backwards`] within the HTLC's timeout, the HTLC will be
2798 * automatically failed.
2801 * LDK will not stop an inbound payment from being paid multiple times, so multiple
2802 * `PaymentReceived` events may be generated for the same payment.
2804 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2805 * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
2807 LDKEvent_PaymentReceived,
2809 * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
2810 * and we got back the payment preimage for it).
2812 * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
2813 * event. In this situation, you SHOULD treat this payment as having succeeded.
2815 LDKEvent_PaymentSent,
2817 * Indicates an outbound HTLC we sent failed. Probably some intermediary node dropped
2818 * something. You may wish to retry with a different route.
2820 * Note that this does *not* indicate that all paths for an MPP payment have failed, see
2821 * [`Event::PaymentFailed`] and [`all_paths_failed`].
2823 * [`all_paths_failed`]: Self::PaymentPathFailed::all_paths_failed
2825 LDKEvent_PaymentPathFailed,
2827 * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
2828 * provide failure information for each MPP part in the payment.
2830 * This event is provided once there are no further pending HTLCs for the payment and the
2831 * payment is no longer retryable, either due to a several-block timeout or because
2832 * [`ChannelManager::abandon_payment`] was previously called for the corresponding payment.
2834 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
2836 LDKEvent_PaymentFailed,
2838 * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
2839 * a time in the future.
2841 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
2843 LDKEvent_PendingHTLCsForwardable,
2845 * Used to indicate that an output which you should know how to spend was confirmed on chain
2846 * and is now spendable.
2847 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
2848 * counterparty spending them due to some kind of timeout. Thus, you need to store them
2849 * somewhere and spend them when you create on-chain transactions.
2851 LDKEvent_SpendableOutputs,
2853 * This event is generated when a payment has been successfully forwarded through us and a
2854 * forwarding fee earned.
2856 LDKEvent_PaymentForwarded,
2858 * Used to indicate that a channel with the given `channel_id` is in the process of closure.
2860 LDKEvent_ChannelClosed,
2862 * Used to indicate to the user that they can abandon the funding transaction and recycle the
2863 * inputs for another purpose.
2865 LDKEvent_DiscardFunding,
2867 * Indicates that a path for an outbound payment was successful.
2869 * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
2870 * [`Event::PaymentSent`] for obtaining the payment preimage.
2872 LDKEvent_PaymentPathSuccessful,
2874 * Indicates a request to open a new channel by a peer.
2876 * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the
2877 * request, call [`ChannelManager::force_close_channel`].
2879 * The event is only triggered when a new open channel request is received and the
2880 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
2882 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
2883 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel
2884 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
2886 LDKEvent_OpenChannelRequest,
2888 * Must be last for serialization purposes
2893 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
2895 * The random channel_id we picked which you'll need to pass into
2896 * ChannelManager::funding_transaction_generated.
2898 struct LDKThirtyTwoBytes temporary_channel_id;
2900 * The value, in satoshis, that the output should have.
2902 uint64_t channel_value_satoshis;
2904 * The script which should be used in the transaction output.
2906 struct LDKCVec_u8Z output_script;
2908 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or 0 for
2909 * an inbound channel.
2911 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
2913 uint64_t user_channel_id;
2914 } LDKEvent_LDKFundingGenerationReady_Body;
2916 typedef struct LDKEvent_LDKPaymentReceived_Body {
2918 * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
2919 * not stop you from registering duplicate payment hashes for inbound payments.
2921 struct LDKThirtyTwoBytes payment_hash;
2923 * The value, in thousandths of a satoshi, that this payment is for.
2927 * Information for claiming this received payment, based on whether the purpose of the
2928 * payment is to pay an invoice or to send a spontaneous payment.
2930 struct LDKPaymentPurpose purpose;
2931 } LDKEvent_LDKPaymentReceived_Body;
2933 typedef struct LDKEvent_LDKPaymentSent_Body {
2935 * The id returned by [`ChannelManager::send_payment`] and used with
2936 * [`ChannelManager::retry_payment`].
2938 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
2939 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
2941 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2943 struct LDKThirtyTwoBytes payment_id;
2945 * The preimage to the hash given to ChannelManager::send_payment.
2946 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
2949 struct LDKThirtyTwoBytes payment_preimage;
2951 * The hash that was given to [`ChannelManager::send_payment`].
2953 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
2955 struct LDKThirtyTwoBytes payment_hash;
2957 * The total fee which was spent at intermediate hops in this payment, across all paths.
2959 * Note that, like [`Route::get_total_fees`] this does *not* include any potential
2960 * overpayment to the recipient node.
2962 * If the recipient or an intermediate node misbehaves and gives us free money, this may
2963 * overstate the amount paid, though this is unlikely.
2965 * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
2967 struct LDKCOption_u64Z fee_paid_msat;
2968 } LDKEvent_LDKPaymentSent_Body;
2970 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
2972 * The id returned by [`ChannelManager::send_payment`] and used with
2973 * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
2975 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
2976 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
2977 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
2979 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2981 struct LDKThirtyTwoBytes payment_id;
2983 * The hash that was given to [`ChannelManager::send_payment`].
2985 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
2987 struct LDKThirtyTwoBytes payment_hash;
2989 * Indicates the payment was rejected for some reason by the recipient. This implies that
2990 * the payment has failed, not just the route in question. If this is not set, you may
2991 * retry the payment via a different route.
2993 bool rejected_by_dest;
2995 * Any failure information conveyed via the Onion return packet by a node along the failed
2998 * Should be applied to the [`NetworkGraph`] so that routing decisions can take into
2999 * account the update. [`NetGraphMsgHandler`] is capable of doing this.
3001 * [`NetworkGraph`]: crate::routing::network_graph::NetworkGraph
3002 * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler
3004 struct LDKCOption_NetworkUpdateZ network_update;
3006 * For both single-path and multi-path payments, this is set if all paths of the payment have
3007 * failed. This will be set to false if (1) this is an MPP payment and (2) other parts of the
3008 * larger MPP payment were still in flight when this event was generated.
3010 * Note that if you are retrying individual MPP parts, using this value to determine if a
3011 * payment has fully failed is race-y. Because multiple failures can happen prior to events
3012 * being processed, you may retry in response to a first failure, with a second failure
3013 * (with `all_paths_failed` set) still pending. Then, when the second failure is processed
3014 * you will see `all_paths_failed` set even though the retry of the first failure still
3015 * has an associated in-flight HTLC. See (1) for an example of such a failure.
3017 * If you wish to retry individual MPP parts and learn when a payment has failed, you must
3018 * call [`ChannelManager::abandon_payment`] and wait for a [`Event::PaymentFailed`] event.
3020 * (1) <https://github.com/lightningdevkit/rust-lightning/issues/1164>
3022 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3024 bool all_paths_failed;
3026 * The payment path that failed.
3028 struct LDKCVec_RouteHopZ path;
3030 * The channel responsible for the failed payment path.
3032 * If this is `Some`, then the corresponding channel should be avoided when the payment is
3033 * retried. May be `None` for older [`Event`] serializations.
3035 struct LDKCOption_u64Z short_channel_id;
3037 * Parameters needed to compute a new [`Route`] when retrying the failed payment path.
3039 * See [`find_route`] for details.
3041 * [`Route`]: crate::routing::router::Route
3042 * [`find_route`]: crate::routing::router::find_route
3044 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3046 struct LDKRouteParameters retry;
3047 } LDKEvent_LDKPaymentPathFailed_Body;
3049 typedef struct LDKEvent_LDKPaymentFailed_Body {
3051 * The id returned by [`ChannelManager::send_payment`] and used with
3052 * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
3054 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3055 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3056 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3058 struct LDKThirtyTwoBytes payment_id;
3060 * The hash that was given to [`ChannelManager::send_payment`].
3062 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3064 struct LDKThirtyTwoBytes payment_hash;
3065 } LDKEvent_LDKPaymentFailed_Body;
3067 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
3069 * The minimum amount of time that should be waited prior to calling
3070 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
3071 * you should wait a random amount of time in roughly the range (now + time_forwardable,
3072 * now + 5*time_forwardable).
3074 uint64_t time_forwardable;
3075 } LDKEvent_LDKPendingHTLCsForwardable_Body;
3077 typedef struct LDKEvent_LDKSpendableOutputs_Body {
3079 * The outputs which you should store as spendable by you.
3081 struct LDKCVec_SpendableOutputDescriptorZ outputs;
3082 } LDKEvent_LDKSpendableOutputs_Body;
3084 typedef struct LDKEvent_LDKPaymentForwarded_Body {
3086 * The fee, in milli-satoshis, which was earned as a result of the payment.
3088 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
3089 * was pending, the amount the next hop claimed will have been rounded down to the nearest
3090 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
3091 * claimed the full value in millisatoshis from the source. In this case,
3092 * `claim_from_onchain_tx` will be set.
3094 * If the channel which sent us the payment has been force-closed, we will claim the funds
3095 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
3096 * fees which we will spend and will instead set this to `None`. It is possible duplicate
3097 * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
3100 struct LDKCOption_u64Z fee_earned_msat;
3102 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
3105 bool claim_from_onchain_tx;
3106 } LDKEvent_LDKPaymentForwarded_Body;
3108 typedef struct LDKEvent_LDKChannelClosed_Body {
3110 * The channel_id of the channel which has been closed. Note that on-chain transactions
3111 * resolving the channel are likely still awaiting confirmation.
3113 struct LDKThirtyTwoBytes channel_id;
3115 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or 0 for
3116 * an inbound channel. This will always be zero for objects serialized with LDK versions
3119 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
3121 uint64_t user_channel_id;
3123 * The reason the channel was closed.
3125 struct LDKClosureReason reason;
3126 } LDKEvent_LDKChannelClosed_Body;
3128 typedef struct LDKEvent_LDKDiscardFunding_Body {
3130 * The channel_id of the channel which has been closed.
3132 struct LDKThirtyTwoBytes channel_id;
3134 * The full transaction received from the user
3136 struct LDKTransaction transaction;
3137 } LDKEvent_LDKDiscardFunding_Body;
3139 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
3141 * The id returned by [`ChannelManager::send_payment`] and used with
3142 * [`ChannelManager::retry_payment`].
3144 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3145 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3147 struct LDKThirtyTwoBytes payment_id;
3149 * The hash that was given to [`ChannelManager::send_payment`].
3151 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3153 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3155 struct LDKThirtyTwoBytes payment_hash;
3157 * The payment path that was successful.
3159 * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
3161 struct LDKCVec_RouteHopZ path;
3162 } LDKEvent_LDKPaymentPathSuccessful_Body;
3164 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
3166 * The temporary channel ID of the channel requested to be opened.
3168 * When responding to the request, the `temporary_channel_id` should be passed
3169 * back to the ChannelManager with [`ChannelManager::accept_inbound_channel`] to accept,
3170 * or to [`ChannelManager::force_close_channel`] to reject.
3172 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3173 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel
3175 struct LDKThirtyTwoBytes temporary_channel_id;
3177 * The node_id of the counterparty requesting to open the channel.
3179 struct LDKPublicKey counterparty_node_id;
3181 * The channel value of the requested channel.
3183 uint64_t funding_satoshis;
3185 * Our starting balance in the channel if the request is accepted, in milli-satoshi.
3188 } LDKEvent_LDKOpenChannelRequest_Body;
3190 typedef struct MUST_USE_STRUCT LDKEvent {
3193 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
3194 LDKEvent_LDKPaymentReceived_Body payment_received;
3195 LDKEvent_LDKPaymentSent_Body payment_sent;
3196 LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
3197 LDKEvent_LDKPaymentFailed_Body payment_failed;
3198 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
3199 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
3200 LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
3201 LDKEvent_LDKChannelClosed_Body channel_closed;
3202 LDKEvent_LDKDiscardFunding_Body discard_funding;
3203 LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
3204 LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
3209 * An enum which can either contain a crate::lightning::util::events::Event or not
3211 typedef enum LDKCOption_EventZ_Tag {
3213 * When we're in this state, this COption_EventZ contains a crate::lightning::util::events::Event
3215 LDKCOption_EventZ_Some,
3217 * When we're in this state, this COption_EventZ contains nothing
3219 LDKCOption_EventZ_None,
3221 * Must be last for serialization purposes
3223 LDKCOption_EventZ_Sentinel,
3224 } LDKCOption_EventZ_Tag;
3226 typedef struct LDKCOption_EventZ {
3227 LDKCOption_EventZ_Tag tag;
3230 struct LDKEvent some;
3233 } LDKCOption_EventZ;
3236 * The contents of CResult_COption_EventZDecodeErrorZ
3238 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
3240 * A pointer to the contents in the success state.
3241 * Reading from this pointer when `result_ok` is not set is undefined.
3243 struct LDKCOption_EventZ *result;
3245 * A pointer to the contents in the error state.
3246 * Reading from this pointer when `result_ok` is set is undefined.
3248 struct LDKDecodeError *err;
3249 } LDKCResult_COption_EventZDecodeErrorZPtr;
3252 * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
3253 * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
3254 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3256 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
3258 * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
3259 * `err` or `result` depending on the state of `result_ok`.
3261 union LDKCResult_COption_EventZDecodeErrorZPtr contents;
3263 * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
3266 } LDKCResult_COption_EventZDecodeErrorZ;
3271 * An accept_channel message to be sent or received from a peer
3273 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
3275 * A pointer to the opaque Rust object.
3276 * Nearly everywhere, inner must be non-null, however in places where
3277 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3279 LDKnativeAcceptChannel *inner;
3281 * Indicates that this is the only struct which contains the same pointer.
3282 * Rust functions which take ownership of an object provided via an argument require
3283 * this to be true and invalidate the object pointed to by inner.
3291 * An open_channel message to be sent or received from a peer
3293 typedef struct MUST_USE_STRUCT LDKOpenChannel {
3295 * A pointer to the opaque Rust object.
3296 * Nearly everywhere, inner must be non-null, however in places where
3297 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3299 LDKnativeOpenChannel *inner;
3301 * Indicates that this is the only struct which contains the same pointer.
3302 * Rust functions which take ownership of an object provided via an argument require
3303 * this to be true and invalidate the object pointed to by inner.
3311 * A funding_created message to be sent or received from a peer
3313 typedef struct MUST_USE_STRUCT LDKFundingCreated {
3315 * A pointer to the opaque Rust object.
3316 * Nearly everywhere, inner must be non-null, however in places where
3317 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3319 LDKnativeFundingCreated *inner;
3321 * Indicates that this is the only struct which contains the same pointer.
3322 * Rust functions which take ownership of an object provided via an argument require
3323 * this to be true and invalidate the object pointed to by inner.
3326 } LDKFundingCreated;
3331 * A funding_signed message to be sent or received from a peer
3333 typedef struct MUST_USE_STRUCT LDKFundingSigned {
3335 * A pointer to the opaque Rust object.
3336 * Nearly everywhere, inner must be non-null, however in places where
3337 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3339 LDKnativeFundingSigned *inner;
3341 * Indicates that this is the only struct which contains the same pointer.
3342 * Rust functions which take ownership of an object provided via an argument require
3343 * this to be true and invalidate the object pointed to by inner.
3351 * A funding_locked message to be sent or received from a peer
3353 typedef struct MUST_USE_STRUCT LDKFundingLocked {
3355 * A pointer to the opaque Rust object.
3356 * Nearly everywhere, inner must be non-null, however in places where
3357 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3359 LDKnativeFundingLocked *inner;
3361 * Indicates that this is the only struct which contains the same pointer.
3362 * Rust functions which take ownership of an object provided via an argument require
3363 * this to be true and invalidate the object pointed to by inner.
3371 * An announcement_signatures message to be sent or received from a peer
3373 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
3375 * A pointer to the opaque Rust object.
3376 * Nearly everywhere, inner must be non-null, however in places where
3377 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3379 LDKnativeAnnouncementSignatures *inner;
3381 * Indicates that this is the only struct which contains the same pointer.
3382 * Rust functions which take ownership of an object provided via an argument require
3383 * this to be true and invalidate the object pointed to by inner.
3386 } LDKAnnouncementSignatures;
3391 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
3392 * transaction updates if they were pending.
3394 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
3396 * A pointer to the opaque Rust object.
3397 * Nearly everywhere, inner must be non-null, however in places where
3398 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3400 LDKnativeCommitmentUpdate *inner;
3402 * Indicates that this is the only struct which contains the same pointer.
3403 * Rust functions which take ownership of an object provided via an argument require
3404 * this to be true and invalidate the object pointed to by inner.
3407 } LDKCommitmentUpdate;
3412 * A revoke_and_ack message to be sent or received from a peer
3414 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
3416 * A pointer to the opaque Rust object.
3417 * Nearly everywhere, inner must be non-null, however in places where
3418 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3420 LDKnativeRevokeAndACK *inner;
3422 * Indicates that this is the only struct which contains the same pointer.
3423 * Rust functions which take ownership of an object provided via an argument require
3424 * this to be true and invalidate the object pointed to by inner.
3432 * A closing_signed message to be sent or received from a peer
3434 typedef struct MUST_USE_STRUCT LDKClosingSigned {
3436 * A pointer to the opaque Rust object.
3437 * Nearly everywhere, inner must be non-null, however in places where
3438 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3440 LDKnativeClosingSigned *inner;
3442 * Indicates that this is the only struct which contains the same pointer.
3443 * Rust functions which take ownership of an object provided via an argument require
3444 * this to be true and invalidate the object pointed to by inner.
3452 * A shutdown message to be sent or received from a peer
3454 typedef struct MUST_USE_STRUCT LDKShutdown {
3456 * A pointer to the opaque Rust object.
3457 * Nearly everywhere, inner must be non-null, however in places where
3458 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3460 LDKnativeShutdown *inner;
3462 * Indicates that this is the only struct which contains the same pointer.
3463 * Rust functions which take ownership of an object provided via an argument require
3464 * this to be true and invalidate the object pointed to by inner.
3472 * A channel_reestablish message to be sent or received from a peer
3474 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
3476 * A pointer to the opaque Rust object.
3477 * Nearly everywhere, inner must be non-null, however in places where
3478 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3480 LDKnativeChannelReestablish *inner;
3482 * Indicates that this is the only struct which contains the same pointer.
3483 * Rust functions which take ownership of an object provided via an argument require
3484 * this to be true and invalidate the object pointed to by inner.
3487 } LDKChannelReestablish;
3492 * A channel_announcement message to be sent or received from a peer
3494 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
3496 * A pointer to the opaque Rust object.
3497 * Nearly everywhere, inner must be non-null, however in places where
3498 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3500 LDKnativeChannelAnnouncement *inner;
3502 * Indicates that this is the only struct which contains the same pointer.
3503 * Rust functions which take ownership of an object provided via an argument require
3504 * this to be true and invalidate the object pointed to by inner.
3507 } LDKChannelAnnouncement;
3512 * A node_announcement message to be sent or received from a peer
3514 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
3516 * A pointer to the opaque Rust object.
3517 * Nearly everywhere, inner must be non-null, however in places where
3518 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3520 LDKnativeNodeAnnouncement *inner;
3522 * Indicates that this is the only struct which contains the same pointer.
3523 * Rust functions which take ownership of an object provided via an argument require
3524 * this to be true and invalidate the object pointed to by inner.
3527 } LDKNodeAnnouncement;
3532 * An error message to be sent or received from a peer
3534 typedef struct MUST_USE_STRUCT LDKErrorMessage {
3536 * A pointer to the opaque Rust object.
3537 * Nearly everywhere, inner must be non-null, however in places where
3538 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3540 LDKnativeErrorMessage *inner;
3542 * Indicates that this is the only struct which contains the same pointer.
3543 * Rust functions which take ownership of an object provided via an argument require
3544 * this to be true and invalidate the object pointed to by inner.
3552 * A warning message to be sent or received from a peer
3554 typedef struct MUST_USE_STRUCT LDKWarningMessage {
3556 * A pointer to the opaque Rust object.
3557 * Nearly everywhere, inner must be non-null, however in places where
3558 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3560 LDKnativeWarningMessage *inner;
3562 * Indicates that this is the only struct which contains the same pointer.
3563 * Rust functions which take ownership of an object provided via an argument require
3564 * this to be true and invalidate the object pointed to by inner.
3567 } LDKWarningMessage;
3570 * Used to put an error message in a LightningError
3572 typedef enum LDKErrorAction_Tag {
3574 * The peer took some action which made us think they were useless. Disconnect them.
3576 LDKErrorAction_DisconnectPeer,
3578 * The peer did something harmless that we weren't able to process, just log and ignore
3580 LDKErrorAction_IgnoreError,
3582 * The peer did something harmless that we weren't able to meaningfully process.
3583 * If the error is logged, log it at the given level.
3585 LDKErrorAction_IgnoreAndLog,
3587 * The peer provided us with a gossip message which we'd already seen. In most cases this
3588 * should be ignored, but it may result in the message being forwarded if it is a duplicate of
3589 * our own channel announcements.
3591 LDKErrorAction_IgnoreDuplicateGossip,
3593 * The peer did something incorrect. Tell them.
3595 LDKErrorAction_SendErrorMessage,
3597 * The peer did something incorrect. Tell them without closing any channels.
3599 LDKErrorAction_SendWarningMessage,
3601 * Must be last for serialization purposes
3603 LDKErrorAction_Sentinel,
3604 } LDKErrorAction_Tag;
3606 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
3608 * An error message which we should make an effort to send before we disconnect.
3610 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3612 struct LDKErrorMessage msg;
3613 } LDKErrorAction_LDKDisconnectPeer_Body;
3615 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
3617 * The message to send.
3619 struct LDKErrorMessage msg;
3620 } LDKErrorAction_LDKSendErrorMessage_Body;
3622 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
3624 * The message to send.
3626 struct LDKWarningMessage msg;
3628 * The peer may have done something harmless that we weren't able to meaningfully process,
3629 * though we should still tell them about it.
3630 * If this event is logged, log it at the given level.
3632 enum LDKLevel log_level;
3633 } LDKErrorAction_LDKSendWarningMessage_Body;
3635 typedef struct MUST_USE_STRUCT LDKErrorAction {
3636 LDKErrorAction_Tag tag;
3638 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
3640 enum LDKLevel ignore_and_log;
3642 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
3643 LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
3650 * A query_channel_range message is used to query a peer for channel
3651 * UTXOs in a range of blocks. The recipient of a query makes a best
3652 * effort to reply to the query using one or more reply_channel_range
3655 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
3657 * A pointer to the opaque Rust object.
3658 * Nearly everywhere, inner must be non-null, however in places where
3659 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3661 LDKnativeQueryChannelRange *inner;
3663 * Indicates that this is the only struct which contains the same pointer.
3664 * Rust functions which take ownership of an object provided via an argument require
3665 * this to be true and invalidate the object pointed to by inner.
3668 } LDKQueryChannelRange;
3673 * A query_short_channel_ids message is used to query a peer for
3674 * routing gossip messages related to one or more short_channel_ids.
3675 * The query recipient will reply with the latest, if available,
3676 * channel_announcement, channel_update and node_announcement messages
3677 * it maintains for the requested short_channel_ids followed by a
3678 * reply_short_channel_ids_end message. The short_channel_ids sent in
3679 * this query are encoded. We only support encoding_type=0 uncompressed
3680 * serialization and do not support encoding_type=1 zlib serialization.
3682 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
3684 * A pointer to the opaque Rust object.
3685 * Nearly everywhere, inner must be non-null, however in places where
3686 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3688 LDKnativeQueryShortChannelIds *inner;
3690 * Indicates that this is the only struct which contains the same pointer.
3691 * Rust functions which take ownership of an object provided via an argument require
3692 * this to be true and invalidate the object pointed to by inner.
3695 } LDKQueryShortChannelIds;
3700 * A reply_channel_range message is a reply to a query_channel_range
3701 * message. Multiple reply_channel_range messages can be sent in reply
3702 * to a single query_channel_range message. The query recipient makes a
3703 * best effort to respond based on their local network view which may
3704 * not be a perfect view of the network. The short_channel_ids in the
3705 * reply are encoded. We only support encoding_type=0 uncompressed
3706 * serialization and do not support encoding_type=1 zlib serialization.
3708 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
3710 * A pointer to the opaque Rust object.
3711 * Nearly everywhere, inner must be non-null, however in places where
3712 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3714 LDKnativeReplyChannelRange *inner;
3716 * Indicates that this is the only struct which contains the same pointer.
3717 * Rust functions which take ownership of an object provided via an argument require
3718 * this to be true and invalidate the object pointed to by inner.
3721 } LDKReplyChannelRange;
3724 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
3725 * broadcast to most peers).
3726 * These events are handled by PeerManager::process_events if you are using a PeerManager.
3728 typedef enum LDKMessageSendEvent_Tag {
3730 * Used to indicate that we've accepted a channel open and should send the accept_channel
3731 * message provided to the given peer.
3733 LDKMessageSendEvent_SendAcceptChannel,
3735 * Used to indicate that we've initiated a channel open and should send the open_channel
3736 * message provided to the given peer.
3738 LDKMessageSendEvent_SendOpenChannel,
3740 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
3742 LDKMessageSendEvent_SendFundingCreated,
3744 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
3746 LDKMessageSendEvent_SendFundingSigned,
3748 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
3750 LDKMessageSendEvent_SendFundingLocked,
3752 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
3754 LDKMessageSendEvent_SendAnnouncementSignatures,
3756 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
3757 * message should be sent to the peer with the given node_id.
3759 LDKMessageSendEvent_UpdateHTLCs,
3761 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
3763 LDKMessageSendEvent_SendRevokeAndACK,
3765 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
3767 LDKMessageSendEvent_SendClosingSigned,
3769 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
3771 LDKMessageSendEvent_SendShutdown,
3773 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
3775 LDKMessageSendEvent_SendChannelReestablish,
3777 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
3778 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
3780 * Note that after doing so, you very likely (unless you did so very recently) want to call
3781 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
3782 * This ensures that any nodes which see our channel_announcement also have a relevant
3783 * node_announcement, including relevant feature flags which may be important for routing
3786 LDKMessageSendEvent_BroadcastChannelAnnouncement,
3788 * Used to indicate that a node_announcement should be broadcast to all peers.
3790 LDKMessageSendEvent_BroadcastNodeAnnouncement,
3792 * Used to indicate that a channel_update should be broadcast to all peers.
3794 LDKMessageSendEvent_BroadcastChannelUpdate,
3796 * Used to indicate that a channel_update should be sent to a single peer.
3797 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
3798 * private channel and we shouldn't be informing all of our peers of channel parameters.
3800 LDKMessageSendEvent_SendChannelUpdate,
3802 * Broadcast an error downstream to be handled
3804 LDKMessageSendEvent_HandleError,
3806 * Query a peer for channels with funding transaction UTXOs in a block range.
3808 LDKMessageSendEvent_SendChannelRangeQuery,
3810 * Request routing gossip messages from a peer for a list of channels identified by
3811 * their short_channel_ids.
3813 LDKMessageSendEvent_SendShortIdsQuery,
3815 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
3816 * emitted during processing of the query.
3818 LDKMessageSendEvent_SendReplyChannelRange,
3820 * Must be last for serialization purposes
3822 LDKMessageSendEvent_Sentinel,
3823 } LDKMessageSendEvent_Tag;
3825 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
3827 * The node_id of the node which should receive this message
3829 struct LDKPublicKey node_id;
3831 * The message which should be sent.
3833 struct LDKAcceptChannel msg;
3834 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
3836 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
3838 * The node_id of the node which should receive this message
3840 struct LDKPublicKey node_id;
3842 * The message which should be sent.
3844 struct LDKOpenChannel msg;
3845 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
3847 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
3849 * The node_id of the node which should receive this message
3851 struct LDKPublicKey node_id;
3853 * The message which should be sent.
3855 struct LDKFundingCreated msg;
3856 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
3858 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
3860 * The node_id of the node which should receive this message
3862 struct LDKPublicKey node_id;
3864 * The message which should be sent.
3866 struct LDKFundingSigned msg;
3867 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
3869 typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
3871 * The node_id of the node which should receive these message(s)
3873 struct LDKPublicKey node_id;
3875 * The funding_locked message which should be sent.
3877 struct LDKFundingLocked msg;
3878 } LDKMessageSendEvent_LDKSendFundingLocked_Body;
3880 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
3882 * The node_id of the node which should receive these message(s)
3884 struct LDKPublicKey node_id;
3886 * The announcement_signatures message which should be sent.
3888 struct LDKAnnouncementSignatures msg;
3889 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
3891 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
3893 * The node_id of the node which should receive these message(s)
3895 struct LDKPublicKey node_id;
3897 * The update messages which should be sent. ALL messages in the struct should be sent!
3899 struct LDKCommitmentUpdate updates;
3900 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
3902 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
3904 * The node_id of the node which should receive this message
3906 struct LDKPublicKey node_id;
3908 * The message which should be sent.
3910 struct LDKRevokeAndACK msg;
3911 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
3913 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
3915 * The node_id of the node which should receive this message
3917 struct LDKPublicKey node_id;
3919 * The message which should be sent.
3921 struct LDKClosingSigned msg;
3922 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
3924 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
3926 * The node_id of the node which should receive this message
3928 struct LDKPublicKey node_id;
3930 * The message which should be sent.
3932 struct LDKShutdown msg;
3933 } LDKMessageSendEvent_LDKSendShutdown_Body;
3935 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
3937 * The node_id of the node which should receive this message
3939 struct LDKPublicKey node_id;
3941 * The message which should be sent.
3943 struct LDKChannelReestablish msg;
3944 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
3946 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
3948 * The channel_announcement which should be sent.
3950 struct LDKChannelAnnouncement msg;
3952 * The followup channel_update which should be sent.
3954 struct LDKChannelUpdate update_msg;
3955 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
3957 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
3959 * The node_announcement which should be sent.
3961 struct LDKNodeAnnouncement msg;
3962 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
3964 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
3966 * The channel_update which should be sent.
3968 struct LDKChannelUpdate msg;
3969 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
3971 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
3973 * The node_id of the node which should receive this message
3975 struct LDKPublicKey node_id;
3977 * The channel_update which should be sent.
3979 struct LDKChannelUpdate msg;
3980 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
3982 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
3984 * The node_id of the node which should receive this message
3986 struct LDKPublicKey node_id;
3988 * The action which should be taken.
3990 struct LDKErrorAction action;
3991 } LDKMessageSendEvent_LDKHandleError_Body;
3993 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
3995 * The node_id of this message recipient
3997 struct LDKPublicKey node_id;
3999 * The query_channel_range which should be sent.
4001 struct LDKQueryChannelRange msg;
4002 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
4004 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
4006 * The node_id of this message recipient
4008 struct LDKPublicKey node_id;
4010 * The query_short_channel_ids which should be sent.
4012 struct LDKQueryShortChannelIds msg;
4013 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
4015 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
4017 * The node_id of this message recipient
4019 struct LDKPublicKey node_id;
4021 * The reply_channel_range which should be sent.
4023 struct LDKReplyChannelRange msg;
4024 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
4026 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
4027 LDKMessageSendEvent_Tag tag;
4029 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
4030 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
4031 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
4032 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
4033 LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
4034 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
4035 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
4036 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
4037 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
4038 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
4039 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
4040 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
4041 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
4042 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
4043 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
4044 LDKMessageSendEvent_LDKHandleError_Body handle_error;
4045 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
4046 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
4047 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
4049 } LDKMessageSendEvent;
4052 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
4053 * This corresponds to std::vector in C++
4055 typedef struct LDKCVec_MessageSendEventZ {
4057 * The elements in the array.
4058 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4060 struct LDKMessageSendEvent *data;
4062 * The number of elements pointed to by `data`.
4065 } LDKCVec_MessageSendEventZ;
4070 * [`Score`] implementation that uses a fixed penalty.
4072 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
4074 * A pointer to the opaque Rust object.
4075 * Nearly everywhere, inner must be non-null, however in places where
4076 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4078 LDKnativeFixedPenaltyScorer *inner;
4080 * Indicates that this is the only struct which contains the same pointer.
4081 * Rust functions which take ownership of an object provided via an argument require
4082 * this to be true and invalidate the object pointed to by inner.
4085 } LDKFixedPenaltyScorer;
4088 * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
4090 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
4092 * A pointer to the contents in the success state.
4093 * Reading from this pointer when `result_ok` is not set is undefined.
4095 struct LDKFixedPenaltyScorer *result;
4097 * A pointer to the contents in the error state.
4098 * Reading from this pointer when `result_ok` is set is undefined.
4100 struct LDKDecodeError *err;
4101 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
4104 * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
4105 * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4106 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4108 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
4110 * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
4111 * `err` or `result` depending on the state of `result_ok`.
4113 union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
4115 * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
4118 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
4123 * Parameters for configuring [`Scorer`].
4125 typedef struct MUST_USE_STRUCT LDKScoringParameters {
4127 * A pointer to the opaque Rust object.
4128 * Nearly everywhere, inner must be non-null, however in places where
4129 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4131 LDKnativeScoringParameters *inner;
4133 * Indicates that this is the only struct which contains the same pointer.
4134 * Rust functions which take ownership of an object provided via an argument require
4135 * this to be true and invalidate the object pointed to by inner.
4138 } LDKScoringParameters;
4141 * The contents of CResult_ScoringParametersDecodeErrorZ
4143 typedef union LDKCResult_ScoringParametersDecodeErrorZPtr {
4145 * A pointer to the contents in the success state.
4146 * Reading from this pointer when `result_ok` is not set is undefined.
4148 struct LDKScoringParameters *result;
4150 * A pointer to the contents in the error state.
4151 * Reading from this pointer when `result_ok` is set is undefined.
4153 struct LDKDecodeError *err;
4154 } LDKCResult_ScoringParametersDecodeErrorZPtr;
4157 * A CResult_ScoringParametersDecodeErrorZ represents the result of a fallible operation,
4158 * containing a crate::lightning::routing::scoring::ScoringParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
4159 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4161 typedef struct LDKCResult_ScoringParametersDecodeErrorZ {
4163 * The contents of this CResult_ScoringParametersDecodeErrorZ, accessible via either
4164 * `err` or `result` depending on the state of `result_ok`.
4166 union LDKCResult_ScoringParametersDecodeErrorZPtr contents;
4168 * Whether this CResult_ScoringParametersDecodeErrorZ represents a success state.
4171 } LDKCResult_ScoringParametersDecodeErrorZ;
4176 * [`Score`] implementation that provides reasonable default behavior.
4178 * Used to apply a fixed penalty to each channel, thus avoiding long paths when shorter paths with
4179 * slightly higher fees are available. Will further penalize channels that fail to relay payments.
4181 * See [module-level documentation] for usage and [`ScoringParameters`] for customization.
4185 * Mixing the `no-std` feature between serialization and deserialization results in undefined
4188 * [module-level documentation]: crate::routing::scoring
4190 typedef struct MUST_USE_STRUCT LDKScorer {
4192 * A pointer to the opaque Rust object.
4193 * Nearly everywhere, inner must be non-null, however in places where
4194 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4196 LDKnativeScorer *inner;
4198 * Indicates that this is the only struct which contains the same pointer.
4199 * Rust functions which take ownership of an object provided via an argument require
4200 * this to be true and invalidate the object pointed to by inner.
4206 * The contents of CResult_ScorerDecodeErrorZ
4208 typedef union LDKCResult_ScorerDecodeErrorZPtr {
4210 * A pointer to the contents in the success state.
4211 * Reading from this pointer when `result_ok` is not set is undefined.
4213 struct LDKScorer *result;
4215 * A pointer to the contents in the error state.
4216 * Reading from this pointer when `result_ok` is set is undefined.
4218 struct LDKDecodeError *err;
4219 } LDKCResult_ScorerDecodeErrorZPtr;
4222 * A CResult_ScorerDecodeErrorZ represents the result of a fallible operation,
4223 * containing a crate::lightning::routing::scoring::Scorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4224 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4226 typedef struct LDKCResult_ScorerDecodeErrorZ {
4228 * The contents of this CResult_ScorerDecodeErrorZ, accessible via either
4229 * `err` or `result` depending on the state of `result_ok`.
4231 union LDKCResult_ScorerDecodeErrorZPtr contents;
4233 * Whether this CResult_ScorerDecodeErrorZ represents a success state.
4236 } LDKCResult_ScorerDecodeErrorZ;
4241 * Parameters for configuring [`ProbabilisticScorer`].
4243 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringParameters {
4245 * A pointer to the opaque Rust object.
4246 * Nearly everywhere, inner must be non-null, however in places where
4247 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4249 LDKnativeProbabilisticScoringParameters *inner;
4251 * Indicates that this is the only struct which contains the same pointer.
4252 * Rust functions which take ownership of an object provided via an argument require
4253 * this to be true and invalidate the object pointed to by inner.
4256 } LDKProbabilisticScoringParameters;
4259 * The contents of CResult_ProbabilisticScoringParametersDecodeErrorZ
4261 typedef union LDKCResult_ProbabilisticScoringParametersDecodeErrorZPtr {
4263 * A pointer to the contents in the success state.
4264 * Reading from this pointer when `result_ok` is not set is undefined.
4266 struct LDKProbabilisticScoringParameters *result;
4268 * A pointer to the contents in the error state.
4269 * Reading from this pointer when `result_ok` is set is undefined.
4271 struct LDKDecodeError *err;
4272 } LDKCResult_ProbabilisticScoringParametersDecodeErrorZPtr;
4275 * A CResult_ProbabilisticScoringParametersDecodeErrorZ represents the result of a fallible operation,
4276 * containing a crate::lightning::routing::scoring::ProbabilisticScoringParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
4277 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4279 typedef struct LDKCResult_ProbabilisticScoringParametersDecodeErrorZ {
4281 * The contents of this CResult_ProbabilisticScoringParametersDecodeErrorZ, accessible via either
4282 * `err` or `result` depending on the state of `result_ok`.
4284 union LDKCResult_ProbabilisticScoringParametersDecodeErrorZPtr contents;
4286 * Whether this CResult_ProbabilisticScoringParametersDecodeErrorZ represents a success state.
4289 } LDKCResult_ProbabilisticScoringParametersDecodeErrorZ;
4294 * Represents the network as nodes and channels between them
4296 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
4298 * A pointer to the opaque Rust object.
4299 * Nearly everywhere, inner must be non-null, however in places where
4300 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4302 LDKnativeNetworkGraph *inner;
4304 * Indicates that this is the only struct which contains the same pointer.
4305 * Rust functions which take ownership of an object provided via an argument require
4306 * this to be true and invalidate the object pointed to by inner.
4312 * A tuple of 2 elements. See the individual fields for the types contained.
4314 typedef struct LDKC2Tuple_ProbabilisticScoringParametersNetworkGraphZ {
4316 * The element at position 0
4318 struct LDKProbabilisticScoringParameters a;
4320 * The element at position 1
4322 struct LDKNetworkGraph b;
4323 } LDKC2Tuple_ProbabilisticScoringParametersNetworkGraphZ;
4328 * [`Score`] implementation using channel success probability distributions.
4330 * Based on *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
4331 * and Stefan Richter [[1]]. Given the uncertainty of channel liquidity balances, probability
4332 * distributions are defined based on knowledge learned from successful and unsuccessful attempts.
4333 * Then the negative `log10` of the success probability is used to determine the cost of routing a
4334 * specific HTLC amount through a channel.
4336 * Knowledge about channel liquidity balances takes the form of upper and lower bounds on the
4337 * possible liquidity. Certainty of the bounds is decreased over time using a decay function. See
4338 * [`ProbabilisticScoringParameters`] for details.
4340 * Since the scorer aims to learn the current channel liquidity balances, it works best for nodes
4341 * with high payment volume or that actively probe the [`NetworkGraph`]. Nodes with low payment
4342 * volume are more likely to experience failed payment paths, which would need to be retried.
4346 * Mixing the `no-std` feature between serialization and deserialization results in undefined
4349 * [1]: https://arxiv.org/abs/2107.05322
4351 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
4353 * A pointer to the opaque Rust object.
4354 * Nearly everywhere, inner must be non-null, however in places where
4355 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4357 LDKnativeProbabilisticScorer *inner;
4359 * Indicates that this is the only struct which contains the same pointer.
4360 * Rust functions which take ownership of an object provided via an argument require
4361 * this to be true and invalidate the object pointed to by inner.
4364 } LDKProbabilisticScorer;
4367 * The contents of CResult_ProbabilisticScorerDecodeErrorZ
4369 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
4371 * A pointer to the contents in the success state.
4372 * Reading from this pointer when `result_ok` is not set is undefined.
4374 struct LDKProbabilisticScorer *result;
4376 * A pointer to the contents in the error state.
4377 * Reading from this pointer when `result_ok` is set is undefined.
4379 struct LDKDecodeError *err;
4380 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
4383 * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
4384 * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4385 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4387 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
4389 * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
4390 * `err` or `result` depending on the state of `result_ok`.
4392 union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
4394 * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
4397 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
4402 * Features used within an `init` message.
4404 typedef struct MUST_USE_STRUCT LDKInitFeatures {
4406 * A pointer to the opaque Rust object.
4407 * Nearly everywhere, inner must be non-null, however in places where
4408 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4410 LDKnativeInitFeatures *inner;
4412 * Indicates that this is the only struct which contains the same pointer.
4413 * Rust functions which take ownership of an object provided via an argument require
4414 * this to be true and invalidate the object pointed to by inner.
4420 * The contents of CResult_InitFeaturesDecodeErrorZ
4422 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
4424 * A pointer to the contents in the success state.
4425 * Reading from this pointer when `result_ok` is not set is undefined.
4427 struct LDKInitFeatures *result;
4429 * A pointer to the contents in the error state.
4430 * Reading from this pointer when `result_ok` is set is undefined.
4432 struct LDKDecodeError *err;
4433 } LDKCResult_InitFeaturesDecodeErrorZPtr;
4436 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
4437 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4438 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4440 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
4442 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
4443 * `err` or `result` depending on the state of `result_ok`.
4445 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
4447 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
4450 } LDKCResult_InitFeaturesDecodeErrorZ;
4455 * Features used within a `channel_announcement` message.
4457 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
4459 * A pointer to the opaque Rust object.
4460 * Nearly everywhere, inner must be non-null, however in places where
4461 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4463 LDKnativeChannelFeatures *inner;
4465 * Indicates that this is the only struct which contains the same pointer.
4466 * Rust functions which take ownership of an object provided via an argument require
4467 * this to be true and invalidate the object pointed to by inner.
4470 } LDKChannelFeatures;
4473 * The contents of CResult_ChannelFeaturesDecodeErrorZ
4475 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
4477 * A pointer to the contents in the success state.
4478 * Reading from this pointer when `result_ok` is not set is undefined.
4480 struct LDKChannelFeatures *result;
4482 * A pointer to the contents in the error state.
4483 * Reading from this pointer when `result_ok` is set is undefined.
4485 struct LDKDecodeError *err;
4486 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
4489 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
4490 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4491 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4493 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
4495 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
4496 * `err` or `result` depending on the state of `result_ok`.
4498 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
4500 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
4503 } LDKCResult_ChannelFeaturesDecodeErrorZ;
4508 * Features used within a `node_announcement` message.
4510 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
4512 * A pointer to the opaque Rust object.
4513 * Nearly everywhere, inner must be non-null, however in places where
4514 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4516 LDKnativeNodeFeatures *inner;
4518 * Indicates that this is the only struct which contains the same pointer.
4519 * Rust functions which take ownership of an object provided via an argument require
4520 * this to be true and invalidate the object pointed to by inner.
4526 * The contents of CResult_NodeFeaturesDecodeErrorZ
4528 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
4530 * A pointer to the contents in the success state.
4531 * Reading from this pointer when `result_ok` is not set is undefined.
4533 struct LDKNodeFeatures *result;
4535 * A pointer to the contents in the error state.
4536 * Reading from this pointer when `result_ok` is set is undefined.
4538 struct LDKDecodeError *err;
4539 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
4542 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
4543 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4544 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4546 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
4548 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
4549 * `err` or `result` depending on the state of `result_ok`.
4551 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
4553 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
4556 } LDKCResult_NodeFeaturesDecodeErrorZ;
4561 * Features used within an invoice.
4563 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
4565 * A pointer to the opaque Rust object.
4566 * Nearly everywhere, inner must be non-null, however in places where
4567 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4569 LDKnativeInvoiceFeatures *inner;
4571 * Indicates that this is the only struct which contains the same pointer.
4572 * Rust functions which take ownership of an object provided via an argument require
4573 * this to be true and invalidate the object pointed to by inner.
4576 } LDKInvoiceFeatures;
4579 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
4581 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
4583 * A pointer to the contents in the success state.
4584 * Reading from this pointer when `result_ok` is not set is undefined.
4586 struct LDKInvoiceFeatures *result;
4588 * A pointer to the contents in the error state.
4589 * Reading from this pointer when `result_ok` is set is undefined.
4591 struct LDKDecodeError *err;
4592 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
4595 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
4596 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4597 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4599 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
4601 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
4602 * `err` or `result` depending on the state of `result_ok`.
4604 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
4606 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
4609 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
4614 * Features used within the channel_type field in an OpenChannel message.
4616 * A channel is always of some known \"type\", describing the transaction formats used and the exact
4617 * semantics of our interaction with our peer.
4619 * Note that because a channel is a specific type which is proposed by the opener and accepted by
4620 * the counterparty, only required features are allowed here.
4622 * This is serialized differently from other feature types - it is not prefixed by a length, and
4623 * thus must only appear inside a TLV where its length is known in advance.
4625 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
4627 * A pointer to the opaque Rust object.
4628 * Nearly everywhere, inner must be non-null, however in places where
4629 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4631 LDKnativeChannelTypeFeatures *inner;
4633 * Indicates that this is the only struct which contains the same pointer.
4634 * Rust functions which take ownership of an object provided via an argument require
4635 * this to be true and invalidate the object pointed to by inner.
4638 } LDKChannelTypeFeatures;
4641 * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
4643 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
4645 * A pointer to the contents in the success state.
4646 * Reading from this pointer when `result_ok` is not set is undefined.
4648 struct LDKChannelTypeFeatures *result;
4650 * A pointer to the contents in the error state.
4651 * Reading from this pointer when `result_ok` is set is undefined.
4653 struct LDKDecodeError *err;
4654 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
4657 * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
4658 * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4659 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4661 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
4663 * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
4664 * `err` or `result` depending on the state of `result_ok`.
4666 union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
4668 * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
4671 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
4674 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
4676 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
4678 * A pointer to the contents in the success state.
4679 * Reading from this pointer when `result_ok` is not set is undefined.
4681 struct LDKDelayedPaymentOutputDescriptor *result;
4683 * A pointer to the contents in the error state.
4684 * Reading from this pointer when `result_ok` is set is undefined.
4686 struct LDKDecodeError *err;
4687 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
4690 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
4691 * containing a crate::lightning::chain::keysinterface::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
4692 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4694 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
4696 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
4697 * `err` or `result` depending on the state of `result_ok`.
4699 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
4701 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
4704 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
4707 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
4709 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
4711 * A pointer to the contents in the success state.
4712 * Reading from this pointer when `result_ok` is not set is undefined.
4714 struct LDKStaticPaymentOutputDescriptor *result;
4716 * A pointer to the contents in the error state.
4717 * Reading from this pointer when `result_ok` is set is undefined.
4719 struct LDKDecodeError *err;
4720 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
4723 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
4724 * containing a crate::lightning::chain::keysinterface::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
4725 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4727 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
4729 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
4730 * `err` or `result` depending on the state of `result_ok`.
4732 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
4734 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
4737 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
4740 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
4742 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
4744 * A pointer to the contents in the success state.
4745 * Reading from this pointer when `result_ok` is not set is undefined.
4747 struct LDKSpendableOutputDescriptor *result;
4749 * A pointer to the contents in the error state.
4750 * Reading from this pointer when `result_ok` is set is undefined.
4752 struct LDKDecodeError *err;
4753 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
4756 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
4757 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
4758 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4760 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
4762 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
4763 * `err` or `result` depending on the state of `result_ok`.
4765 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
4767 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
4770 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
4773 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
4774 * This corresponds to std::vector in C++
4776 typedef struct LDKCVec_PaymentPreimageZ {
4778 * The elements in the array.
4779 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4781 struct LDKThirtyTwoBytes *data;
4783 * The number of elements pointed to by `data`.
4786 } LDKCVec_PaymentPreimageZ;
4789 * A tuple of 2 elements. See the individual fields for the types contained.
4791 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
4793 * The element at position 0
4795 struct LDKSignature a;
4797 * The element at position 1
4799 struct LDKCVec_SignatureZ b;
4800 } LDKC2Tuple_SignatureCVec_SignatureZZ;
4803 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
4805 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
4807 * A pointer to the contents in the success state.
4808 * Reading from this pointer when `result_ok` is not set is undefined.
4810 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
4812 * Note that this value is always NULL, as there are no contents in the Err variant
4815 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
4818 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
4819 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
4820 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4822 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
4824 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
4825 * `err` or `result` depending on the state of `result_ok`.
4827 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
4829 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
4832 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
4835 * The contents of CResult_SignatureNoneZ
4837 typedef union LDKCResult_SignatureNoneZPtr {
4839 * A pointer to the contents in the success state.
4840 * Reading from this pointer when `result_ok` is not set is undefined.
4842 struct LDKSignature *result;
4844 * Note that this value is always NULL, as there are no contents in the Err variant
4847 } LDKCResult_SignatureNoneZPtr;
4850 * A CResult_SignatureNoneZ represents the result of a fallible operation,
4851 * containing a crate::c_types::Signature on success and a () on failure.
4852 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4854 typedef struct LDKCResult_SignatureNoneZ {
4856 * The contents of this CResult_SignatureNoneZ, accessible via either
4857 * `err` or `result` depending on the state of `result_ok`.
4859 union LDKCResult_SignatureNoneZPtr contents;
4861 * Whether this CResult_SignatureNoneZ represents a success state.
4864 } LDKCResult_SignatureNoneZ;
4867 * A tuple of 2 elements. See the individual fields for the types contained.
4869 typedef struct LDKC2Tuple_SignatureSignatureZ {
4871 * The element at position 0
4873 struct LDKSignature a;
4875 * The element at position 1
4877 struct LDKSignature b;
4878 } LDKC2Tuple_SignatureSignatureZ;
4881 * The contents of CResult_C2Tuple_SignatureSignatureZNoneZ
4883 typedef union LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr {
4885 * A pointer to the contents in the success state.
4886 * Reading from this pointer when `result_ok` is not set is undefined.
4888 struct LDKC2Tuple_SignatureSignatureZ *result;
4890 * Note that this value is always NULL, as there are no contents in the Err variant
4893 } LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr;
4896 * A CResult_C2Tuple_SignatureSignatureZNoneZ represents the result of a fallible operation,
4897 * containing a crate::c_types::derived::C2Tuple_SignatureSignatureZ on success and a () on failure.
4898 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4900 typedef struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ {
4902 * The contents of this CResult_C2Tuple_SignatureSignatureZNoneZ, accessible via either
4903 * `err` or `result` depending on the state of `result_ok`.
4905 union LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr contents;
4907 * Whether this CResult_C2Tuple_SignatureSignatureZNoneZ represents a success state.
4910 } LDKCResult_C2Tuple_SignatureSignatureZNoneZ;
4913 * The contents of CResult_SecretKeyNoneZ
4915 typedef union LDKCResult_SecretKeyNoneZPtr {
4917 * A pointer to the contents in the success state.
4918 * Reading from this pointer when `result_ok` is not set is undefined.
4920 struct LDKSecretKey *result;
4922 * Note that this value is always NULL, as there are no contents in the Err variant
4925 } LDKCResult_SecretKeyNoneZPtr;
4928 * A CResult_SecretKeyNoneZ represents the result of a fallible operation,
4929 * containing a crate::c_types::SecretKey on success and a () on failure.
4930 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4932 typedef struct LDKCResult_SecretKeyNoneZ {
4934 * The contents of this CResult_SecretKeyNoneZ, accessible via either
4935 * `err` or `result` depending on the state of `result_ok`.
4937 union LDKCResult_SecretKeyNoneZPtr contents;
4939 * Whether this CResult_SecretKeyNoneZ represents a success state.
4942 } LDKCResult_SecretKeyNoneZ;
4947 * This class tracks the per-transaction information needed to build a closing transaction and will
4948 * actually build it and sign.
4950 * This class can be used inside a signer implementation to generate a signature given the relevant
4953 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
4955 * A pointer to the opaque Rust object.
4956 * Nearly everywhere, inner must be non-null, however in places where
4957 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4959 LDKnativeClosingTransaction *inner;
4961 * Indicates that this is the only struct which contains the same pointer.
4962 * Rust functions which take ownership of an object provided via an argument require
4963 * this to be true and invalidate the object pointed to by inner.
4966 } LDKClosingTransaction;
4971 * The unsigned part of a channel_announcement
4973 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
4975 * A pointer to the opaque Rust object.
4976 * Nearly everywhere, inner must be non-null, however in places where
4977 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4979 LDKnativeUnsignedChannelAnnouncement *inner;
4981 * Indicates that this is the only struct which contains the same pointer.
4982 * Rust functions which take ownership of an object provided via an argument require
4983 * this to be true and invalidate the object pointed to by inner.
4986 } LDKUnsignedChannelAnnouncement;
4989 * A trait to sign lightning channel transactions as described in BOLT 3.
4991 * Signing services could be implemented on a hardware wallet. In this case,
4992 * the current Sign would be a front-end on top of a communication
4993 * channel connected to your secure device and lightning key material wouldn't
4994 * reside on a hot server. Nevertheless, a this deployment would still need
4995 * to trust the ChannelManager to avoid loss of funds as this latest component
4996 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
4998 * A more secure iteration would be to use hashlock (or payment points) to pair
4999 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
5000 * at the price of more state and computation on the hardware wallet side. In the future,
5001 * we are looking forward to design such interface.
5003 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
5004 * to act, as liveness and breach reply correctness are always going to be hard requirements
5005 * of LN security model, orthogonal of key management issues.
5007 typedef struct LDKBaseSign {
5009 * An opaque pointer which is passed to your function implementations as an argument.
5010 * This has no meaning in the LDK, and can be NULL or any other value.
5014 * Gets the per-commitment point for a specific commitment number
5016 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
5018 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
5020 * Gets the commitment secret for a specific commitment number as part of the revocation process
5022 * An external signer implementation should error here if the commitment was already signed
5023 * and should refuse to sign it in the future.
5025 * May be called more than once for the same index.
5027 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
5029 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
5031 * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
5033 * This is required in order for the signer to make sure that releasing a commitment
5034 * secret won't leave us without a broadcastable holder transaction.
5035 * Policy checks should be implemented in this function, including checking the amount
5036 * sent to us and checking the HTLCs.
5038 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
5039 * A validating signer should ensure that an HTLC output is removed only when the matching
5040 * preimage is provided, or when the value to holder is restored.
5042 * NOTE: all the relevant preimages will be provided, but there may also be additional
5043 * irrelevant or duplicate preimages.
5045 struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_PaymentPreimageZ preimages);
5047 * Gets the holder's channel public keys and basepoints
5049 struct LDKChannelPublicKeys pubkeys;
5051 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
5052 * Note that this takes a pointer to this object, not the this_ptr like other methods do
5053 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
5055 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
5057 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
5058 * some SpendableOutputDescriptor types. This should be sufficient to identify this
5059 * Sign object uniquely and lookup or re-derive its keys.
5061 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
5063 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
5065 * Note that if signing fails or is rejected, the channel will be force-closed.
5067 * Policy checks should be implemented in this function, including checking the amount
5068 * sent to us and checking the HTLCs.
5070 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
5071 * A validating signer should ensure that an HTLC output is removed only when the matching
5072 * preimage is provided, or when the value to holder is restored.
5074 * NOTE: all the relevant preimages will be provided, but there may also be additional
5075 * irrelevant or duplicate preimages.
5077 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_PaymentPreimageZ preimages);
5079 * Validate the counterparty's revocation.
5081 * This is required in order for the signer to make sure that the state has moved
5082 * forward and it is safe to sign the next counterparty commitment.
5084 struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
5086 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
5087 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
5088 * latest commitment_tx when we initiate a force-close.
5089 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
5090 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
5092 * This may be called multiple times for the same transaction.
5094 * An external signer implementation should check that the commitment has not been revoked.
5096 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
5098 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
5100 * Create a signature for the given input in a transaction spending an HTLC transaction output
5101 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
5103 * A justice transaction may claim multiple outputs at the same time if timelocks are
5104 * similar, but only a signature for the input at index `input` should be signed for here.
5105 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
5106 * to an upcoming timelock expiration.
5108 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
5110 * per_commitment_key is revocation secret which was provided by our counterparty when they
5111 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
5112 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
5115 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]);
5117 * Create a signature for the given input in a transaction spending a commitment transaction
5118 * HTLC output when our counterparty broadcasts an old state.
5120 * A justice transaction may claim multiple outputs at the same time if timelocks are
5121 * similar, but only a signature for the input at index `input` should be signed for here.
5122 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
5123 * to an upcoming timelock expiration.
5125 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
5127 * per_commitment_key is revocation secret which was provided by our counterparty when they
5128 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
5129 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
5132 * htlc holds HTLC elements (hash, timelock), thus changing the format of the witness script
5133 * (which is committed to in the BIP 143 signatures).
5135 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);
5137 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
5138 * transaction, either offered or received.
5140 * Such a transaction may claim multiples offered outputs at same time if we know the
5141 * preimage for each when we create it, but only the input at index `input` should be
5142 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
5143 * needed with regards to an upcoming timelock expiration.
5145 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
5148 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
5150 * Per_commitment_point is the dynamic point corresponding to the channel state
5151 * detected onchain. It has been generated by our counterparty and is used to derive
5152 * channel state keys, which are then included in the witness script and committed to in the
5153 * BIP 143 signature.
5155 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);
5157 * Create a signature for a (proposed) closing transaction.
5159 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
5160 * chosen to forgo their output as dust.
5162 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
5164 * Signs a channel announcement message with our funding key and our node secret key (aka
5165 * node_id or network_key), proving it comes from one of the channel participants.
5167 * The first returned signature should be from our node secret key, the second from our
5170 * Note that if this fails or is rejected, the channel will not be publicly announced and
5171 * our counterparty may (though likely will not) close the channel on us for violating the
5174 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
5176 * Set the counterparty static channel data, including basepoints,
5177 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
5178 * This is done as soon as the funding outpoint is known. Since these are static channel data,
5179 * they MUST NOT be allowed to change to different values once set.
5181 * channel_parameters.is_populated() MUST be true.
5183 * We bind holder_selected_contest_delay late here for API convenience.
5185 * Will be called before any signatures are applied.
5187 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
5189 * Frees any resources associated with this object given its this_arg pointer.
5190 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5192 void (*free)(void *this_arg);
5196 * A cloneable signer.
5198 * Although we require signers to be cloneable, it may be useful for developers to be able to use
5199 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
5200 * which implies Sized, into this derived trait.
5202 typedef struct LDKSign {
5204 * An opaque pointer which is passed to your function implementations as an argument.
5205 * This has no meaning in the LDK, and can be NULL or any other value.
5209 * Implementation of BaseSign for this object.
5211 struct LDKBaseSign BaseSign;
5213 * Serialize the object into a byte array
5215 struct LDKCVec_u8Z (*write)(const void *this_arg);
5217 * Called, if set, after this Sign has been cloned into a duplicate object.
5218 * The new Sign is provided, and should be mutated as needed to perform a
5219 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
5221 void (*cloned)(struct LDKSign *NONNULL_PTR new_Sign);
5223 * Frees any resources associated with this object given its this_arg pointer.
5224 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5226 void (*free)(void *this_arg);
5230 * The contents of CResult_SignDecodeErrorZ
5232 typedef union LDKCResult_SignDecodeErrorZPtr {
5234 * A pointer to the contents in the success state.
5235 * Reading from this pointer when `result_ok` is not set is undefined.
5237 struct LDKSign *result;
5239 * A pointer to the contents in the error state.
5240 * Reading from this pointer when `result_ok` is set is undefined.
5242 struct LDKDecodeError *err;
5243 } LDKCResult_SignDecodeErrorZPtr;
5246 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
5247 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
5248 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5250 typedef struct LDKCResult_SignDecodeErrorZ {
5252 * The contents of this CResult_SignDecodeErrorZ, accessible via either
5253 * `err` or `result` depending on the state of `result_ok`.
5255 union LDKCResult_SignDecodeErrorZPtr contents;
5257 * Whether this CResult_SignDecodeErrorZ represents a success state.
5260 } LDKCResult_SignDecodeErrorZ;
5263 * Integer in the range `0..32`
5265 typedef struct LDKu5 {
5270 * A dynamically-allocated array of crate::c_types::u5s of arbitrary size.
5271 * This corresponds to std::vector in C++
5273 typedef struct LDKCVec_u5Z {
5275 * The elements in the array.
5276 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5280 * The number of elements pointed to by `data`.
5286 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
5287 * allows recovering the exact public key which created the signature given the message.
5289 typedef struct LDKRecoverableSignature {
5291 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
5294 uint8_t serialized_form[68];
5295 } LDKRecoverableSignature;
5298 * The contents of CResult_RecoverableSignatureNoneZ
5300 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
5302 * A pointer to the contents in the success state.
5303 * Reading from this pointer when `result_ok` is not set is undefined.
5305 struct LDKRecoverableSignature *result;
5307 * Note that this value is always NULL, as there are no contents in the Err variant
5310 } LDKCResult_RecoverableSignatureNoneZPtr;
5313 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
5314 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
5315 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5317 typedef struct LDKCResult_RecoverableSignatureNoneZ {
5319 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
5320 * `err` or `result` depending on the state of `result_ok`.
5322 union LDKCResult_RecoverableSignatureNoneZPtr contents;
5324 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
5327 } LDKCResult_RecoverableSignatureNoneZ;
5330 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
5331 * This corresponds to std::vector in C++
5333 typedef struct LDKCVec_CVec_u8ZZ {
5335 * The elements in the array.
5336 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5338 struct LDKCVec_u8Z *data;
5340 * The number of elements pointed to by `data`.
5343 } LDKCVec_CVec_u8ZZ;
5346 * The contents of CResult_CVec_CVec_u8ZZNoneZ
5348 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
5350 * A pointer to the contents in the success state.
5351 * Reading from this pointer when `result_ok` is not set is undefined.
5353 struct LDKCVec_CVec_u8ZZ *result;
5355 * Note that this value is always NULL, as there are no contents in the Err variant
5358 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
5361 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
5362 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
5363 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5365 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
5367 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
5368 * `err` or `result` depending on the state of `result_ok`.
5370 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
5372 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
5375 } LDKCResult_CVec_CVec_u8ZZNoneZ;
5380 * A simple implementation of Sign that just keeps the private keys in memory.
5382 * This implementation performs no policy checks and is insufficient by itself as
5383 * a secure external signer.
5385 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
5387 * A pointer to the opaque Rust object.
5388 * Nearly everywhere, inner must be non-null, however in places where
5389 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5391 LDKnativeInMemorySigner *inner;
5393 * Indicates that this is the only struct which contains the same pointer.
5394 * Rust functions which take ownership of an object provided via an argument require
5395 * this to be true and invalidate the object pointed to by inner.
5398 } LDKInMemorySigner;
5401 * The contents of CResult_InMemorySignerDecodeErrorZ
5403 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
5405 * A pointer to the contents in the success state.
5406 * Reading from this pointer when `result_ok` is not set is undefined.
5408 struct LDKInMemorySigner *result;
5410 * A pointer to the contents in the error state.
5411 * Reading from this pointer when `result_ok` is set is undefined.
5413 struct LDKDecodeError *err;
5414 } LDKCResult_InMemorySignerDecodeErrorZPtr;
5417 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
5418 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
5419 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5421 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
5423 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
5424 * `err` or `result` depending on the state of `result_ok`.
5426 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
5428 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
5431 } LDKCResult_InMemorySignerDecodeErrorZ;
5434 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
5435 * This corresponds to std::vector in C++
5437 typedef struct LDKCVec_TxOutZ {
5439 * The elements in the array.
5440 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5442 struct LDKTxOut *data;
5444 * The number of elements pointed to by `data`.
5450 * The contents of CResult_TransactionNoneZ
5452 typedef union LDKCResult_TransactionNoneZPtr {
5454 * A pointer to the contents in the success state.
5455 * Reading from this pointer when `result_ok` is not set is undefined.
5457 struct LDKTransaction *result;
5459 * Note that this value is always NULL, as there are no contents in the Err variant
5462 } LDKCResult_TransactionNoneZPtr;
5465 * A CResult_TransactionNoneZ represents the result of a fallible operation,
5466 * containing a crate::c_types::Transaction on success and a () on failure.
5467 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5469 typedef struct LDKCResult_TransactionNoneZ {
5471 * The contents of this CResult_TransactionNoneZ, accessible via either
5472 * `err` or `result` depending on the state of `result_ok`.
5474 union LDKCResult_TransactionNoneZPtr contents;
5476 * Whether this CResult_TransactionNoneZ represents a success state.
5479 } LDKCResult_TransactionNoneZ;
5484 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
5485 * on-chain transactions to ensure no loss of funds occurs.
5487 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
5488 * information and are actively monitoring the chain.
5490 * Pending Events or updated HTLCs which have not yet been read out by
5491 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
5492 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
5493 * gotten are fully handled before re-serializing the new state.
5495 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
5496 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
5497 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
5498 * returned block hash and the the current chain and then reconnecting blocks to get to the
5499 * best chain) upon deserializing the object!
5501 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
5503 * A pointer to the opaque Rust object.
5504 * Nearly everywhere, inner must be non-null, however in places where
5505 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5507 LDKnativeChannelMonitor *inner;
5509 * Indicates that this is the only struct which contains the same pointer.
5510 * Rust functions which take ownership of an object provided via an argument require
5511 * this to be true and invalidate the object pointed to by inner.
5514 } LDKChannelMonitor;
5517 * A tuple of 2 elements. See the individual fields for the types contained.
5519 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
5521 * The element at position 0
5523 struct LDKThirtyTwoBytes a;
5525 * The element at position 1
5527 struct LDKChannelMonitor b;
5528 } LDKC2Tuple_BlockHashChannelMonitorZ;
5531 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
5532 * This corresponds to std::vector in C++
5534 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
5536 * The elements in the array.
5537 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5539 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
5541 * The number of elements pointed to by `data`.
5544 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
5547 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
5549 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
5551 * A pointer to the contents in the success state.
5552 * Reading from this pointer when `result_ok` is not set is undefined.
5554 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
5556 * A pointer to the contents in the error state.
5557 * Reading from this pointer when `result_ok` is set is undefined.
5559 enum LDKIOError *err;
5560 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
5563 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
5564 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
5565 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5567 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
5569 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
5570 * `err` or `result` depending on the state of `result_ok`.
5572 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
5574 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
5577 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
5580 * An enum which can either contain a u16 or not
5582 typedef enum LDKCOption_u16Z_Tag {
5584 * When we're in this state, this COption_u16Z contains a u16
5586 LDKCOption_u16Z_Some,
5588 * When we're in this state, this COption_u16Z contains nothing
5590 LDKCOption_u16Z_None,
5592 * Must be last for serialization purposes
5594 LDKCOption_u16Z_Sentinel,
5595 } LDKCOption_u16Z_Tag;
5597 typedef struct LDKCOption_u16Z {
5598 LDKCOption_u16Z_Tag tag;
5607 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
5610 typedef enum LDKAPIError_Tag {
5612 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
5613 * are documented, but generally indicates some precondition of a function was violated.
5615 LDKAPIError_APIMisuseError,
5617 * Due to a high feerate, we were unable to complete the request.
5618 * For example, this may be returned if the feerate implies we cannot open a channel at the
5619 * requested value, but opening a larger channel would succeed.
5621 LDKAPIError_FeeRateTooHigh,
5623 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
5624 * too-many-hops, etc).
5626 LDKAPIError_RouteError,
5628 * We were unable to complete the request as the Channel required to do so is unable to
5629 * complete the request (or was not found). This can take many forms, including disconnected
5630 * peer, channel at capacity, channel shutting down, etc.
5632 LDKAPIError_ChannelUnavailable,
5634 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
5635 * attempted action to fail.
5637 LDKAPIError_MonitorUpdateFailed,
5639 * [`KeysInterface::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
5640 * with the channel counterparty as negotiated in [`InitFeatures`].
5642 * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
5643 * a channel or cooperatively close one with this peer (and will have to force-close instead).
5645 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
5646 * [`InitFeatures`]: crate::ln::features::InitFeatures
5648 LDKAPIError_IncompatibleShutdownScript,
5650 * Must be last for serialization purposes
5652 LDKAPIError_Sentinel,
5655 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
5657 * A human-readable error message
5660 } LDKAPIError_LDKAPIMisuseError_Body;
5662 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
5664 * A human-readable error message
5668 * The feerate which was too high.
5671 } LDKAPIError_LDKFeeRateTooHigh_Body;
5673 typedef struct LDKAPIError_LDKRouteError_Body {
5675 * A human-readable error message
5678 } LDKAPIError_LDKRouteError_Body;
5680 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
5682 * A human-readable error message
5685 } LDKAPIError_LDKChannelUnavailable_Body;
5687 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
5689 * The incompatible shutdown script.
5691 struct LDKShutdownScript script;
5692 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
5694 typedef struct MUST_USE_STRUCT LDKAPIError {
5695 LDKAPIError_Tag tag;
5697 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
5698 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
5699 LDKAPIError_LDKRouteError_Body route_error;
5700 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
5701 LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
5706 * The contents of CResult_NoneAPIErrorZ
5708 typedef union LDKCResult_NoneAPIErrorZPtr {
5710 * Note that this value is always NULL, as there are no contents in the OK variant
5714 * A pointer to the contents in the error state.
5715 * Reading from this pointer when `result_ok` is set is undefined.
5717 struct LDKAPIError *err;
5718 } LDKCResult_NoneAPIErrorZPtr;
5721 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
5722 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
5723 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5725 typedef struct LDKCResult_NoneAPIErrorZ {
5727 * The contents of this CResult_NoneAPIErrorZ, accessible via either
5728 * `err` or `result` depending on the state of `result_ok`.
5730 union LDKCResult_NoneAPIErrorZPtr contents;
5732 * Whether this CResult_NoneAPIErrorZ represents a success state.
5735 } LDKCResult_NoneAPIErrorZ;
5738 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
5739 * This corresponds to std::vector in C++
5741 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
5743 * The elements in the array.
5744 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5746 struct LDKCResult_NoneAPIErrorZ *data;
5748 * The number of elements pointed to by `data`.
5751 } LDKCVec_CResult_NoneAPIErrorZZ;
5754 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
5755 * This corresponds to std::vector in C++
5757 typedef struct LDKCVec_APIErrorZ {
5759 * The elements in the array.
5760 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5762 struct LDKAPIError *data;
5764 * The number of elements pointed to by `data`.
5767 } LDKCVec_APIErrorZ;
5770 * The contents of CResult__u832APIErrorZ
5772 typedef union LDKCResult__u832APIErrorZPtr {
5774 * A pointer to the contents in the success state.
5775 * Reading from this pointer when `result_ok` is not set is undefined.
5777 struct LDKThirtyTwoBytes *result;
5779 * A pointer to the contents in the error state.
5780 * Reading from this pointer when `result_ok` is set is undefined.
5782 struct LDKAPIError *err;
5783 } LDKCResult__u832APIErrorZPtr;
5786 * A CResult__u832APIErrorZ represents the result of a fallible operation,
5787 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
5788 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5790 typedef struct LDKCResult__u832APIErrorZ {
5792 * The contents of this CResult__u832APIErrorZ, accessible via either
5793 * `err` or `result` depending on the state of `result_ok`.
5795 union LDKCResult__u832APIErrorZPtr contents;
5797 * Whether this CResult__u832APIErrorZ represents a success state.
5800 } LDKCResult__u832APIErrorZ;
5803 * If a payment fails to send, it can be in one of several states. This enum is returned as the
5804 * Err() type describing which state the payment is in, see the description of individual enum
5807 typedef enum LDKPaymentSendFailure_Tag {
5809 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
5810 * send the payment at all. No channel state has been changed or messages sent to peers, and
5811 * once you've changed the parameter at error, you can freely retry the payment in full.
5813 LDKPaymentSendFailure_ParameterError,
5815 * A parameter in a single path which was passed to send_payment was invalid, preventing us
5816 * from attempting to send the payment at all. No channel state has been changed or messages
5817 * sent to peers, and once you've changed the parameter at error, you can freely retry the
5820 * The results here are ordered the same as the paths in the route object which was passed to
5823 LDKPaymentSendFailure_PathParameterError,
5825 * All paths which were attempted failed to send, with no channel state change taking place.
5826 * You can freely retry the payment in full (though you probably want to do so over different
5827 * paths than the ones selected).
5829 LDKPaymentSendFailure_AllFailedRetrySafe,
5831 * Some paths which were attempted failed to send, though possibly not all. At least some
5832 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
5833 * in over-/re-payment.
5835 * The results here are ordered the same as the paths in the route object which was passed to
5836 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
5837 * retried (though there is currently no API with which to do so).
5839 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
5840 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
5841 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
5842 * with the latest update_id.
5844 LDKPaymentSendFailure_PartialFailure,
5846 * Must be last for serialization purposes
5848 LDKPaymentSendFailure_Sentinel,
5849 } LDKPaymentSendFailure_Tag;
5851 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
5853 * The errors themselves, in the same order as the route hops.
5855 struct LDKCVec_CResult_NoneAPIErrorZZ results;
5857 * If some paths failed without irrevocably committing to the new HTLC(s), this will
5858 * contain a [`RouteParameters`] object which can be used to calculate a new route that
5859 * will pay all remaining unpaid balance.
5861 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
5863 struct LDKRouteParameters failed_paths_retry;
5865 * The payment id for the payment, which is now at least partially pending.
5867 struct LDKThirtyTwoBytes payment_id;
5868 } LDKPaymentSendFailure_LDKPartialFailure_Body;
5870 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
5871 LDKPaymentSendFailure_Tag tag;
5874 struct LDKAPIError parameter_error;
5877 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
5880 struct LDKCVec_APIErrorZ all_failed_retry_safe;
5882 LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
5884 } LDKPaymentSendFailure;
5887 * The contents of CResult_PaymentIdPaymentSendFailureZ
5889 typedef union LDKCResult_PaymentIdPaymentSendFailureZPtr {
5891 * A pointer to the contents in the success state.
5892 * Reading from this pointer when `result_ok` is not set is undefined.
5894 struct LDKThirtyTwoBytes *result;
5896 * A pointer to the contents in the error state.
5897 * Reading from this pointer when `result_ok` is set is undefined.
5899 struct LDKPaymentSendFailure *err;
5900 } LDKCResult_PaymentIdPaymentSendFailureZPtr;
5903 * A CResult_PaymentIdPaymentSendFailureZ represents the result of a fallible operation,
5904 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
5905 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5907 typedef struct LDKCResult_PaymentIdPaymentSendFailureZ {
5909 * The contents of this CResult_PaymentIdPaymentSendFailureZ, accessible via either
5910 * `err` or `result` depending on the state of `result_ok`.
5912 union LDKCResult_PaymentIdPaymentSendFailureZPtr contents;
5914 * Whether this CResult_PaymentIdPaymentSendFailureZ represents a success state.
5917 } LDKCResult_PaymentIdPaymentSendFailureZ;
5920 * The contents of CResult_NonePaymentSendFailureZ
5922 typedef union LDKCResult_NonePaymentSendFailureZPtr {
5924 * Note that this value is always NULL, as there are no contents in the OK variant
5928 * A pointer to the contents in the error state.
5929 * Reading from this pointer when `result_ok` is set is undefined.
5931 struct LDKPaymentSendFailure *err;
5932 } LDKCResult_NonePaymentSendFailureZPtr;
5935 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
5936 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
5937 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5939 typedef struct LDKCResult_NonePaymentSendFailureZ {
5941 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
5942 * `err` or `result` depending on the state of `result_ok`.
5944 union LDKCResult_NonePaymentSendFailureZPtr contents;
5946 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
5949 } LDKCResult_NonePaymentSendFailureZ;
5952 * A tuple of 2 elements. See the individual fields for the types contained.
5954 typedef struct LDKC2Tuple_PaymentHashPaymentIdZ {
5956 * The element at position 0
5958 struct LDKThirtyTwoBytes a;
5960 * The element at position 1
5962 struct LDKThirtyTwoBytes b;
5963 } LDKC2Tuple_PaymentHashPaymentIdZ;
5966 * The contents of CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ
5968 typedef union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr {
5970 * A pointer to the contents in the success state.
5971 * Reading from this pointer when `result_ok` is not set is undefined.
5973 struct LDKC2Tuple_PaymentHashPaymentIdZ *result;
5975 * A pointer to the contents in the error state.
5976 * Reading from this pointer when `result_ok` is set is undefined.
5978 struct LDKPaymentSendFailure *err;
5979 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr;
5982 * A CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents the result of a fallible operation,
5983 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentIdZ on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
5984 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5986 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ {
5988 * The contents of this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ, accessible via either
5989 * `err` or `result` depending on the state of `result_ok`.
5991 union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr contents;
5993 * Whether this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents a success state.
5996 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ;
5999 * A 4-byte byte array.
6001 typedef struct LDKFourBytes {
6009 * A 16-byte byte array.
6011 typedef struct LDKSixteenBytes {
6019 * A 12-byte byte array.
6021 typedef struct LDKTwelveBytes {
6029 * An address which can be used to connect to a remote peer
6031 typedef enum LDKNetAddress_Tag {
6033 * An IPv4 address/port on which the peer is listening.
6037 * An IPv6 address/port on which the peer is listening.
6041 * An old-style Tor onion address/port on which the peer is listening.
6043 * This field is deprecated and the Tor network generally no longer supports V2 Onion
6044 * addresses. Thus, the details are not parsed here.
6046 LDKNetAddress_OnionV2,
6048 * A new-style Tor onion address/port on which the peer is listening.
6049 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
6050 * wrap as base32 and append \".onion\".
6052 LDKNetAddress_OnionV3,
6054 * Must be last for serialization purposes
6056 LDKNetAddress_Sentinel,
6057 } LDKNetAddress_Tag;
6059 typedef struct LDKNetAddress_LDKIPv4_Body {
6061 * The 4-byte IPv4 address
6063 struct LDKFourBytes addr;
6065 * The port on which the node is listening
6068 } LDKNetAddress_LDKIPv4_Body;
6070 typedef struct LDKNetAddress_LDKIPv6_Body {
6072 * The 16-byte IPv6 address
6074 struct LDKSixteenBytes addr;
6076 * The port on which the node is listening
6079 } LDKNetAddress_LDKIPv6_Body;
6081 typedef struct LDKNetAddress_LDKOnionV3_Body {
6083 * The ed25519 long-term public key of the peer
6085 struct LDKThirtyTwoBytes ed25519_pubkey;
6087 * The checksum of the pubkey and version, as included in the onion address
6091 * The version byte, as defined by the Tor Onion v3 spec.
6095 * The port on which the node is listening
6098 } LDKNetAddress_LDKOnionV3_Body;
6100 typedef struct MUST_USE_STRUCT LDKNetAddress {
6101 LDKNetAddress_Tag tag;
6103 LDKNetAddress_LDKIPv4_Body i_pv4;
6104 LDKNetAddress_LDKIPv6_Body i_pv6;
6106 struct LDKTwelveBytes onion_v2;
6108 LDKNetAddress_LDKOnionV3_Body onion_v3;
6113 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
6114 * This corresponds to std::vector in C++
6116 typedef struct LDKCVec_NetAddressZ {
6118 * The elements in the array.
6119 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6121 struct LDKNetAddress *data;
6123 * The number of elements pointed to by `data`.
6126 } LDKCVec_NetAddressZ;
6129 * A tuple of 2 elements. See the individual fields for the types contained.
6131 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
6133 * The element at position 0
6135 struct LDKThirtyTwoBytes a;
6137 * The element at position 1
6139 struct LDKThirtyTwoBytes b;
6140 } LDKC2Tuple_PaymentHashPaymentSecretZ;
6143 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ
6145 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
6147 * A pointer to the contents in the success state.
6148 * Reading from this pointer when `result_ok` is not set is undefined.
6150 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
6152 * Note that this value is always NULL, as there are no contents in the Err variant
6155 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr;
6158 * A CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents the result of a fallible operation,
6159 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a () on failure.
6160 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6162 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
6164 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ, accessible via either
6165 * `err` or `result` depending on the state of `result_ok`.
6167 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr contents;
6169 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents a success state.
6172 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ;
6175 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ
6177 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr {
6179 * A pointer to the contents in the success state.
6180 * Reading from this pointer when `result_ok` is not set is undefined.
6182 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
6184 * A pointer to the contents in the error state.
6185 * Reading from this pointer when `result_ok` is set is undefined.
6187 struct LDKAPIError *err;
6188 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr;
6191 * A CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents the result of a fallible operation,
6192 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a crate::lightning::util::errors::APIError on failure.
6193 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6195 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
6197 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ, accessible via either
6198 * `err` or `result` depending on the state of `result_ok`.
6200 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr contents;
6202 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents a success state.
6205 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ;
6208 * The contents of CResult_PaymentSecretNoneZ
6210 typedef union LDKCResult_PaymentSecretNoneZPtr {
6212 * A pointer to the contents in the success state.
6213 * Reading from this pointer when `result_ok` is not set is undefined.
6215 struct LDKThirtyTwoBytes *result;
6217 * Note that this value is always NULL, as there are no contents in the Err variant
6220 } LDKCResult_PaymentSecretNoneZPtr;
6223 * A CResult_PaymentSecretNoneZ represents the result of a fallible operation,
6224 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
6225 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6227 typedef struct LDKCResult_PaymentSecretNoneZ {
6229 * The contents of this CResult_PaymentSecretNoneZ, accessible via either
6230 * `err` or `result` depending on the state of `result_ok`.
6232 union LDKCResult_PaymentSecretNoneZPtr contents;
6234 * Whether this CResult_PaymentSecretNoneZ represents a success state.
6237 } LDKCResult_PaymentSecretNoneZ;
6240 * The contents of CResult_PaymentSecretAPIErrorZ
6242 typedef union LDKCResult_PaymentSecretAPIErrorZPtr {
6244 * A pointer to the contents in the success state.
6245 * Reading from this pointer when `result_ok` is not set is undefined.
6247 struct LDKThirtyTwoBytes *result;
6249 * A pointer to the contents in the error state.
6250 * Reading from this pointer when `result_ok` is set is undefined.
6252 struct LDKAPIError *err;
6253 } LDKCResult_PaymentSecretAPIErrorZPtr;
6256 * A CResult_PaymentSecretAPIErrorZ represents the result of a fallible operation,
6257 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
6258 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6260 typedef struct LDKCResult_PaymentSecretAPIErrorZ {
6262 * The contents of this CResult_PaymentSecretAPIErrorZ, accessible via either
6263 * `err` or `result` depending on the state of `result_ok`.
6265 union LDKCResult_PaymentSecretAPIErrorZPtr contents;
6267 * Whether this CResult_PaymentSecretAPIErrorZ represents a success state.
6270 } LDKCResult_PaymentSecretAPIErrorZ;
6273 * The contents of CResult_PaymentPreimageAPIErrorZ
6275 typedef union LDKCResult_PaymentPreimageAPIErrorZPtr {
6277 * A pointer to the contents in the success state.
6278 * Reading from this pointer when `result_ok` is not set is undefined.
6280 struct LDKThirtyTwoBytes *result;
6282 * A pointer to the contents in the error state.
6283 * Reading from this pointer when `result_ok` is set is undefined.
6285 struct LDKAPIError *err;
6286 } LDKCResult_PaymentPreimageAPIErrorZPtr;
6289 * A CResult_PaymentPreimageAPIErrorZ represents the result of a fallible operation,
6290 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
6291 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6293 typedef struct LDKCResult_PaymentPreimageAPIErrorZ {
6295 * The contents of this CResult_PaymentPreimageAPIErrorZ, accessible via either
6296 * `err` or `result` depending on the state of `result_ok`.
6298 union LDKCResult_PaymentPreimageAPIErrorZPtr contents;
6300 * Whether this CResult_PaymentPreimageAPIErrorZ represents a success state.
6303 } LDKCResult_PaymentPreimageAPIErrorZ;
6308 * Information needed for constructing an invoice route hint for this channel.
6310 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
6312 * A pointer to the opaque Rust object.
6313 * Nearly everywhere, inner must be non-null, however in places where
6314 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6316 LDKnativeCounterpartyForwardingInfo *inner;
6318 * Indicates that this is the only struct which contains the same pointer.
6319 * Rust functions which take ownership of an object provided via an argument require
6320 * this to be true and invalidate the object pointed to by inner.
6323 } LDKCounterpartyForwardingInfo;
6326 * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
6328 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
6330 * A pointer to the contents in the success state.
6331 * Reading from this pointer when `result_ok` is not set is undefined.
6333 struct LDKCounterpartyForwardingInfo *result;
6335 * A pointer to the contents in the error state.
6336 * Reading from this pointer when `result_ok` is set is undefined.
6338 struct LDKDecodeError *err;
6339 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
6342 * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
6343 * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6344 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6346 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
6348 * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
6349 * `err` or `result` depending on the state of `result_ok`.
6351 union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
6353 * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
6356 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
6361 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
6362 * to better separate parameters.
6364 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
6366 * A pointer to the opaque Rust object.
6367 * Nearly everywhere, inner must be non-null, however in places where
6368 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6370 LDKnativeChannelCounterparty *inner;
6372 * Indicates that this is the only struct which contains the same pointer.
6373 * Rust functions which take ownership of an object provided via an argument require
6374 * this to be true and invalidate the object pointed to by inner.
6377 } LDKChannelCounterparty;
6380 * The contents of CResult_ChannelCounterpartyDecodeErrorZ
6382 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
6384 * A pointer to the contents in the success state.
6385 * Reading from this pointer when `result_ok` is not set is undefined.
6387 struct LDKChannelCounterparty *result;
6389 * A pointer to the contents in the error state.
6390 * Reading from this pointer when `result_ok` is set is undefined.
6392 struct LDKDecodeError *err;
6393 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
6396 * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
6397 * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
6398 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6400 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
6402 * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
6403 * `err` or `result` depending on the state of `result_ok`.
6405 union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
6407 * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
6410 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
6413 * The contents of CResult_ChannelDetailsDecodeErrorZ
6415 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
6417 * A pointer to the contents in the success state.
6418 * Reading from this pointer when `result_ok` is not set is undefined.
6420 struct LDKChannelDetails *result;
6422 * A pointer to the contents in the error state.
6423 * Reading from this pointer when `result_ok` is set is undefined.
6425 struct LDKDecodeError *err;
6426 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
6429 * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
6430 * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
6431 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6433 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
6435 * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
6436 * `err` or `result` depending on the state of `result_ok`.
6438 union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
6440 * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
6443 } LDKCResult_ChannelDetailsDecodeErrorZ;
6448 * Route hints used in constructing invoices for [phantom node payents].
6450 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
6452 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
6454 * A pointer to the opaque Rust object.
6455 * Nearly everywhere, inner must be non-null, however in places where
6456 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6458 LDKnativePhantomRouteHints *inner;
6460 * Indicates that this is the only struct which contains the same pointer.
6461 * Rust functions which take ownership of an object provided via an argument require
6462 * this to be true and invalidate the object pointed to by inner.
6465 } LDKPhantomRouteHints;
6468 * The contents of CResult_PhantomRouteHintsDecodeErrorZ
6470 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
6472 * A pointer to the contents in the success state.
6473 * Reading from this pointer when `result_ok` is not set is undefined.
6475 struct LDKPhantomRouteHints *result;
6477 * A pointer to the contents in the error state.
6478 * Reading from this pointer when `result_ok` is set is undefined.
6480 struct LDKDecodeError *err;
6481 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
6484 * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
6485 * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
6486 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6488 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
6490 * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
6491 * `err` or `result` depending on the state of `result_ok`.
6493 union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
6495 * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
6498 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
6501 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
6502 * This corresponds to std::vector in C++
6504 typedef struct LDKCVec_ChannelMonitorZ {
6506 * The elements in the array.
6507 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6509 struct LDKChannelMonitor *data;
6511 * The number of elements pointed to by `data`.
6514 } LDKCVec_ChannelMonitorZ;
6519 * An update generated by the underlying Channel itself which contains some new information the
6520 * ChannelMonitor should be made aware of.
6522 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
6524 * A pointer to the opaque Rust object.
6525 * Nearly everywhere, inner must be non-null, however in places where
6526 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6528 LDKnativeChannelMonitorUpdate *inner;
6530 * Indicates that this is the only struct which contains the same pointer.
6531 * Rust functions which take ownership of an object provided via an argument require
6532 * this to be true and invalidate the object pointed to by inner.
6535 } LDKChannelMonitorUpdate;
6538 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
6539 * blocks are connected and disconnected.
6541 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
6542 * responsible for maintaining a set of monitors such that they can be updated accordingly as
6543 * channel state changes and HTLCs are resolved. See method documentation for specific
6546 * Implementations **must** ensure that updates are successfully applied and persisted upon method
6547 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
6548 * without taking any further action such as persisting the current state.
6550 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
6551 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
6552 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
6553 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
6554 * multiple instances.
6556 * [`PermanentFailure`]: ChannelMonitorUpdateErr::PermanentFailure
6558 typedef struct LDKWatch {
6560 * An opaque pointer which is passed to your function implementations as an argument.
6561 * This has no meaning in the LDK, and can be NULL or any other value.
6565 * Watches a channel identified by `funding_txo` using `monitor`.
6567 * Implementations are responsible for watching the chain for the funding transaction along
6568 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
6569 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
6571 * Note: this interface MUST error with `ChannelMonitorUpdateErr::PermanentFailure` if
6572 * the given `funding_txo` has previously been registered via `watch_channel`.
6574 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
6575 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
6576 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
6578 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
6580 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
6582 * Implementations must call [`update_monitor`] with the given update. See
6583 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
6585 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
6587 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
6589 * Returns any monitor events since the last call. Subsequent calls must only return new
6592 * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
6593 * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
6596 * For details on asynchronous [`ChannelMonitor`] updating and returning
6597 * [`MonitorEvent::UpdateCompleted`] here, see [`ChannelMonitorUpdateErr::TemporaryFailure`].
6599 struct LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
6601 * Frees any resources associated with this object given its this_arg pointer.
6602 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6604 void (*free)(void *this_arg);
6608 * An interface to send a transaction to the Bitcoin network.
6610 typedef struct LDKBroadcasterInterface {
6612 * An opaque pointer which is passed to your function implementations as an argument.
6613 * This has no meaning in the LDK, and can be NULL or any other value.
6617 * Sends a transaction out to (hopefully) be mined.
6619 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
6621 * Frees any resources associated with this object given its this_arg pointer.
6622 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6624 void (*free)(void *this_arg);
6625 } LDKBroadcasterInterface;
6628 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
6629 * own the memory pointed to by data.
6631 typedef struct LDKu8slice {
6633 * A pointer to the byte buffer
6635 const uint8_t *data;
6637 * The number of bytes pointed to by `data`.
6643 * A trait to describe an object which can get user secrets and key material.
6645 typedef struct LDKKeysInterface {
6647 * An opaque pointer which is passed to your function implementations as an argument.
6648 * This has no meaning in the LDK, and can be NULL or any other value.
6652 * Get node secret key (aka node_id or network_key) based on the provided [`Recipient`].
6654 * This method must return the same value each time it is called with a given `Recipient`
6657 struct LDKCResult_SecretKeyNoneZ (*get_node_secret)(const void *this_arg, enum LDKRecipient recipient);
6659 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
6661 * This method should return a different value each time it is called, to avoid linking
6662 * on-chain funds across channels as controlled to the same user.
6664 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
6666 * Get a script pubkey which we will send funds to when closing a channel.
6668 * This method should return a different value each time it is called, to avoid linking
6669 * on-chain funds across channels as controlled to the same user.
6671 struct LDKShutdownScript (*get_shutdown_scriptpubkey)(const void *this_arg);
6673 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
6674 * restarted with some stale data!
6676 * This method must return a different value each time it is called.
6678 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
6680 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
6681 * onion packets and for temporary channel IDs. There is no requirement that these be
6682 * persisted anywhere, though they must be unique across restarts.
6684 * This method must return a different value each time it is called.
6686 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
6688 * Reads a `Signer` for this `KeysInterface` from the given input stream.
6689 * This is only called during deserialization of other objects which contain
6690 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
6691 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
6692 * contain no versioning scheme. You may wish to include your own version prefix and ensure
6693 * you've read all of the provided bytes to ensure no corruption occurred.
6695 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
6698 * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
6699 * this trait to parse the invoice and make sure they're signing what they expect, rather than
6700 * blindly signing the hash.
6701 * The hrp is ascii bytes, while the invoice data is base32.
6703 * The secret key used to sign the invoice is dependent on the [`Recipient`].
6705 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_u5Z invoice_data, enum LDKRecipient receipient);
6707 * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
6709 * If the implementor of this trait supports [phantom node payments], then every node that is
6710 * intended to be included in the phantom invoice route hints must return the same value from
6713 * This method must return the same value each time it is called.
6715 * [phantom node payments]: PhantomKeysManager
6717 struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
6719 * Frees any resources associated with this object given its this_arg pointer.
6720 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6722 void (*free)(void *this_arg);
6726 * A trait which should be implemented to provide feerate information on a number of time
6729 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
6730 * called from inside the library in response to chain events, P2P events, or timer events).
6732 typedef struct LDKFeeEstimator {
6734 * An opaque pointer which is passed to your function implementations as an argument.
6735 * This has no meaning in the LDK, and can be NULL or any other value.
6739 * Gets estimated satoshis of fee required per 1000 Weight-Units.
6741 * Must return a value no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later
6742 * round-downs don't put us below 1 satoshi-per-byte).
6744 * This method can be implemented with the following unit conversions:
6745 * * max(satoshis-per-byte * 250, 253)
6746 * * max(satoshis-per-kbyte / 4, 253)
6748 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
6750 * Frees any resources associated with this object given its this_arg pointer.
6751 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6753 void (*free)(void *this_arg);
6759 * A Record, unit of logging output with Metadata to enable filtering
6760 * Module_path, file, line to inform on log's source
6762 typedef struct MUST_USE_STRUCT LDKRecord {
6764 * A pointer to the opaque Rust object.
6765 * Nearly everywhere, inner must be non-null, however in places where
6766 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6768 LDKnativeRecord *inner;
6770 * Indicates that this is the only struct which contains the same pointer.
6771 * Rust functions which take ownership of an object provided via an argument require
6772 * this to be true and invalidate the object pointed to by inner.
6778 * A trait encapsulating the operations required of a logger
6780 typedef struct LDKLogger {
6782 * An opaque pointer which is passed to your function implementations as an argument.
6783 * This has no meaning in the LDK, and can be NULL or any other value.
6789 void (*log)(const void *this_arg, const struct LDKRecord *NONNULL_PTR record);
6791 * Frees any resources associated with this object given its this_arg pointer.
6792 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6794 void (*free)(void *this_arg);
6800 * Manager which keeps track of a number of channels and sends messages to the appropriate
6801 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
6803 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
6804 * to individual Channels.
6806 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
6807 * all peers during write/read (though does not modify this instance, only the instance being
6808 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
6809 * called funding_transaction_generated for outbound channels).
6811 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
6812 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
6813 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
6814 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
6815 * the serialization process). If the deserialized version is out-of-date compared to the
6816 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
6817 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
6819 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
6820 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
6821 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
6822 * block_connected() to step towards your best block) upon deserialization before using the
6825 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
6826 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
6827 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
6828 * offline for a full minute. In order to track this, you must call
6829 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
6831 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
6832 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
6833 * essentially you should default to using a SimpleRefChannelManager, and use a
6834 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
6835 * you're using lightning-net-tokio.
6837 typedef struct MUST_USE_STRUCT LDKChannelManager {
6839 * A pointer to the opaque Rust object.
6840 * Nearly everywhere, inner must be non-null, however in places where
6841 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6843 LDKnativeChannelManager *inner;
6845 * Indicates that this is the only struct which contains the same pointer.
6846 * Rust functions which take ownership of an object provided via an argument require
6847 * this to be true and invalidate the object pointed to by inner.
6850 } LDKChannelManager;
6853 * A tuple of 2 elements. See the individual fields for the types contained.
6855 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
6857 * The element at position 0
6859 struct LDKThirtyTwoBytes a;
6861 * The element at position 1
6863 struct LDKChannelManager b;
6864 } LDKC2Tuple_BlockHashChannelManagerZ;
6867 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
6869 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
6871 * A pointer to the contents in the success state.
6872 * Reading from this pointer when `result_ok` is not set is undefined.
6874 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
6876 * A pointer to the contents in the error state.
6877 * Reading from this pointer when `result_ok` is set is undefined.
6879 struct LDKDecodeError *err;
6880 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
6883 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
6884 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
6885 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6887 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
6889 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
6890 * `err` or `result` depending on the state of `result_ok`.
6892 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
6894 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
6897 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
6902 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
6903 * with our counterparty.
6905 typedef struct MUST_USE_STRUCT LDKChannelConfig {
6907 * A pointer to the opaque Rust object.
6908 * Nearly everywhere, inner must be non-null, however in places where
6909 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6911 LDKnativeChannelConfig *inner;
6913 * Indicates that this is the only struct which contains the same pointer.
6914 * Rust functions which take ownership of an object provided via an argument require
6915 * this to be true and invalidate the object pointed to by inner.
6921 * The contents of CResult_ChannelConfigDecodeErrorZ
6923 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
6925 * A pointer to the contents in the success state.
6926 * Reading from this pointer when `result_ok` is not set is undefined.
6928 struct LDKChannelConfig *result;
6930 * A pointer to the contents in the error state.
6931 * Reading from this pointer when `result_ok` is set is undefined.
6933 struct LDKDecodeError *err;
6934 } LDKCResult_ChannelConfigDecodeErrorZPtr;
6937 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
6938 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
6939 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6941 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
6943 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
6944 * `err` or `result` depending on the state of `result_ok`.
6946 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
6948 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
6951 } LDKCResult_ChannelConfigDecodeErrorZ;
6954 * The contents of CResult_OutPointDecodeErrorZ
6956 typedef union LDKCResult_OutPointDecodeErrorZPtr {
6958 * A pointer to the contents in the success state.
6959 * Reading from this pointer when `result_ok` is not set is undefined.
6961 struct LDKOutPoint *result;
6963 * A pointer to the contents in the error state.
6964 * Reading from this pointer when `result_ok` is set is undefined.
6966 struct LDKDecodeError *err;
6967 } LDKCResult_OutPointDecodeErrorZPtr;
6970 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
6971 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
6972 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6974 typedef struct LDKCResult_OutPointDecodeErrorZ {
6976 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
6977 * `err` or `result` depending on the state of `result_ok`.
6979 union LDKCResult_OutPointDecodeErrorZPtr contents;
6981 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
6984 } LDKCResult_OutPointDecodeErrorZ;
6987 * Defines a type identifier for sending messages over the wire.
6989 * Messages implementing this trait specify a type and must be [`Writeable`].
6991 typedef struct LDKType {
6993 * An opaque pointer which is passed to your function implementations as an argument.
6994 * This has no meaning in the LDK, and can be NULL or any other value.
6998 * Returns the type identifying the message payload.
7000 uint16_t (*type_id)(const void *this_arg);
7002 * Return a human-readable "debug" string describing this object
7004 struct LDKStr (*debug_str)(const void *this_arg);
7006 * Serialize the object into a byte array
7008 struct LDKCVec_u8Z (*write)(const void *this_arg);
7010 * Frees any resources associated with this object given its this_arg pointer.
7011 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7013 void (*free)(void *this_arg);
7017 * An enum which can either contain a crate::lightning::ln::wire::Type or not
7019 typedef enum LDKCOption_TypeZ_Tag {
7021 * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
7023 LDKCOption_TypeZ_Some,
7025 * When we're in this state, this COption_TypeZ contains nothing
7027 LDKCOption_TypeZ_None,
7029 * Must be last for serialization purposes
7031 LDKCOption_TypeZ_Sentinel,
7032 } LDKCOption_TypeZ_Tag;
7034 typedef struct LDKCOption_TypeZ {
7035 LDKCOption_TypeZ_Tag tag;
7038 struct LDKType some;
7044 * The contents of CResult_COption_TypeZDecodeErrorZ
7046 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
7048 * A pointer to the contents in the success state.
7049 * Reading from this pointer when `result_ok` is not set is undefined.
7051 struct LDKCOption_TypeZ *result;
7053 * A pointer to the contents in the error state.
7054 * Reading from this pointer when `result_ok` is set is undefined.
7056 struct LDKDecodeError *err;
7057 } LDKCResult_COption_TypeZDecodeErrorZPtr;
7060 * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
7061 * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
7062 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7064 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
7066 * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
7067 * `err` or `result` depending on the state of `result_ok`.
7069 union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
7071 * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
7074 } LDKCResult_COption_TypeZDecodeErrorZ;
7077 * An error that may occur when making a payment.
7079 typedef enum LDKPaymentError_Tag {
7081 * An error resulting from the provided [`Invoice`] or payment hash.
7083 LDKPaymentError_Invoice,
7085 * An error occurring when finding a route.
7087 LDKPaymentError_Routing,
7089 * An error occurring when sending a payment.
7091 LDKPaymentError_Sending,
7093 * Must be last for serialization purposes
7095 LDKPaymentError_Sentinel,
7096 } LDKPaymentError_Tag;
7098 typedef struct MUST_USE_STRUCT LDKPaymentError {
7099 LDKPaymentError_Tag tag;
7102 struct LDKStr invoice;
7105 struct LDKLightningError routing;
7108 struct LDKPaymentSendFailure sending;
7114 * The contents of CResult_PaymentIdPaymentErrorZ
7116 typedef union LDKCResult_PaymentIdPaymentErrorZPtr {
7118 * A pointer to the contents in the success state.
7119 * Reading from this pointer when `result_ok` is not set is undefined.
7121 struct LDKThirtyTwoBytes *result;
7123 * A pointer to the contents in the error state.
7124 * Reading from this pointer when `result_ok` is set is undefined.
7126 struct LDKPaymentError *err;
7127 } LDKCResult_PaymentIdPaymentErrorZPtr;
7130 * A CResult_PaymentIdPaymentErrorZ represents the result of a fallible operation,
7131 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning_invoice::payment::PaymentError on failure.
7132 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7134 typedef struct LDKCResult_PaymentIdPaymentErrorZ {
7136 * The contents of this CResult_PaymentIdPaymentErrorZ, accessible via either
7137 * `err` or `result` depending on the state of `result_ok`.
7139 union LDKCResult_PaymentIdPaymentErrorZPtr contents;
7141 * Whether this CResult_PaymentIdPaymentErrorZ represents a success state.
7144 } LDKCResult_PaymentIdPaymentErrorZ;
7147 * The contents of CResult_SiPrefixNoneZ
7149 typedef union LDKCResult_SiPrefixNoneZPtr {
7151 * A pointer to the contents in the success state.
7152 * Reading from this pointer when `result_ok` is not set is undefined.
7154 enum LDKSiPrefix *result;
7156 * Note that this value is always NULL, as there are no contents in the Err variant
7159 } LDKCResult_SiPrefixNoneZPtr;
7162 * A CResult_SiPrefixNoneZ represents the result of a fallible operation,
7163 * containing a crate::lightning_invoice::SiPrefix on success and a () on failure.
7164 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7166 typedef struct LDKCResult_SiPrefixNoneZ {
7168 * The contents of this CResult_SiPrefixNoneZ, accessible via either
7169 * `err` or `result` depending on the state of `result_ok`.
7171 union LDKCResult_SiPrefixNoneZPtr contents;
7173 * Whether this CResult_SiPrefixNoneZ represents a success state.
7176 } LDKCResult_SiPrefixNoneZ;
7181 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
7183 * There are three ways to construct an `Invoice`:
7184 * 1. using `InvoiceBuilder`
7185 * 2. using `Invoice::from_signed(SignedRawInvoice)`
7186 * 3. using `str::parse::<Invoice>(&str)`
7188 typedef struct MUST_USE_STRUCT LDKInvoice {
7190 * A pointer to the opaque Rust object.
7191 * Nearly everywhere, inner must be non-null, however in places where
7192 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7194 LDKnativeInvoice *inner;
7196 * Indicates that this is the only struct which contains the same pointer.
7197 * Rust functions which take ownership of an object provided via an argument require
7198 * this to be true and invalidate the object pointed to by inner.
7204 * The contents of CResult_InvoiceNoneZ
7206 typedef union LDKCResult_InvoiceNoneZPtr {
7208 * A pointer to the contents in the success state.
7209 * Reading from this pointer when `result_ok` is not set is undefined.
7211 struct LDKInvoice *result;
7213 * Note that this value is always NULL, as there are no contents in the Err variant
7216 } LDKCResult_InvoiceNoneZPtr;
7219 * A CResult_InvoiceNoneZ represents the result of a fallible operation,
7220 * containing a crate::lightning_invoice::Invoice on success and a () on failure.
7221 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7223 typedef struct LDKCResult_InvoiceNoneZ {
7225 * The contents of this CResult_InvoiceNoneZ, accessible via either
7226 * `err` or `result` depending on the state of `result_ok`.
7228 union LDKCResult_InvoiceNoneZPtr contents;
7230 * Whether this CResult_InvoiceNoneZ represents a success state.
7233 } LDKCResult_InvoiceNoneZ;
7238 * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be
7242 * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`.
7244 typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
7246 * A pointer to the opaque Rust object.
7247 * Nearly everywhere, inner must be non-null, however in places where
7248 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7250 LDKnativeSignedRawInvoice *inner;
7252 * Indicates that this is the only struct which contains the same pointer.
7253 * Rust functions which take ownership of an object provided via an argument require
7254 * this to be true and invalidate the object pointed to by inner.
7257 } LDKSignedRawInvoice;
7260 * The contents of CResult_SignedRawInvoiceNoneZ
7262 typedef union LDKCResult_SignedRawInvoiceNoneZPtr {
7264 * A pointer to the contents in the success state.
7265 * Reading from this pointer when `result_ok` is not set is undefined.
7267 struct LDKSignedRawInvoice *result;
7269 * Note that this value is always NULL, as there are no contents in the Err variant
7272 } LDKCResult_SignedRawInvoiceNoneZPtr;
7275 * A CResult_SignedRawInvoiceNoneZ represents the result of a fallible operation,
7276 * containing a crate::lightning_invoice::SignedRawInvoice on success and a () on failure.
7277 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7279 typedef struct LDKCResult_SignedRawInvoiceNoneZ {
7281 * The contents of this CResult_SignedRawInvoiceNoneZ, accessible via either
7282 * `err` or `result` depending on the state of `result_ok`.
7284 union LDKCResult_SignedRawInvoiceNoneZPtr contents;
7286 * Whether this CResult_SignedRawInvoiceNoneZ represents a success state.
7289 } LDKCResult_SignedRawInvoiceNoneZ;
7294 * Represents an syntactically correct Invoice for a payment on the lightning network,
7295 * but without the signature information.
7296 * De- and encoding should not lead to information loss but may lead to different hashes.
7298 * For methods without docs see the corresponding methods in `Invoice`.
7300 typedef struct MUST_USE_STRUCT LDKRawInvoice {
7302 * A pointer to the opaque Rust object.
7303 * Nearly everywhere, inner must be non-null, however in places where
7304 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7306 LDKnativeRawInvoice *inner;
7308 * Indicates that this is the only struct which contains the same pointer.
7309 * Rust functions which take ownership of an object provided via an argument require
7310 * this to be true and invalidate the object pointed to by inner.
7318 * Recoverable signature
7320 typedef struct MUST_USE_STRUCT LDKInvoiceSignature {
7322 * A pointer to the opaque Rust object.
7323 * Nearly everywhere, inner must be non-null, however in places where
7324 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7326 LDKnativeInvoiceSignature *inner;
7328 * Indicates that this is the only struct which contains the same pointer.
7329 * Rust functions which take ownership of an object provided via an argument require
7330 * this to be true and invalidate the object pointed to by inner.
7333 } LDKInvoiceSignature;
7336 * A tuple of 3 elements. See the individual fields for the types contained.
7338 typedef struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ {
7340 * The element at position 0
7342 struct LDKRawInvoice a;
7344 * The element at position 1
7346 struct LDKThirtyTwoBytes b;
7348 * The element at position 2
7350 struct LDKInvoiceSignature c;
7351 } LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ;
7358 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
7360 * A pointer to the opaque Rust object.
7361 * Nearly everywhere, inner must be non-null, however in places where
7362 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7364 LDKnativePayeePubKey *inner;
7366 * Indicates that this is the only struct which contains the same pointer.
7367 * Rust functions which take ownership of an object provided via an argument require
7368 * this to be true and invalidate the object pointed to by inner.
7374 * The contents of CResult_PayeePubKeyErrorZ
7376 typedef union LDKCResult_PayeePubKeyErrorZPtr {
7378 * A pointer to the contents in the success state.
7379 * Reading from this pointer when `result_ok` is not set is undefined.
7381 struct LDKPayeePubKey *result;
7383 * A pointer to the contents in the error state.
7384 * Reading from this pointer when `result_ok` is set is undefined.
7386 enum LDKSecp256k1Error *err;
7387 } LDKCResult_PayeePubKeyErrorZPtr;
7390 * A CResult_PayeePubKeyErrorZ represents the result of a fallible operation,
7391 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
7392 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7394 typedef struct LDKCResult_PayeePubKeyErrorZ {
7396 * The contents of this CResult_PayeePubKeyErrorZ, accessible via either
7397 * `err` or `result` depending on the state of `result_ok`.
7399 union LDKCResult_PayeePubKeyErrorZPtr contents;
7401 * Whether this CResult_PayeePubKeyErrorZ represents a success state.
7404 } LDKCResult_PayeePubKeyErrorZ;
7409 * Private routing information
7412 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
7415 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
7417 * A pointer to the opaque Rust object.
7418 * Nearly everywhere, inner must be non-null, however in places where
7419 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7421 LDKnativePrivateRoute *inner;
7423 * Indicates that this is the only struct which contains the same pointer.
7424 * Rust functions which take ownership of an object provided via an argument require
7425 * this to be true and invalidate the object pointed to by inner.
7431 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
7432 * This corresponds to std::vector in C++
7434 typedef struct LDKCVec_PrivateRouteZ {
7436 * The elements in the array.
7437 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7439 struct LDKPrivateRoute *data;
7441 * The number of elements pointed to by `data`.
7444 } LDKCVec_PrivateRouteZ;
7449 * A timestamp that refers to a date after 1 January 1970.
7453 * The Unix timestamp representing the stored time has to be positive and no greater than
7454 * [`MAX_TIMESTAMP`].
7456 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
7458 * A pointer to the opaque Rust object.
7459 * Nearly everywhere, inner must be non-null, however in places where
7460 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7462 LDKnativePositiveTimestamp *inner;
7464 * Indicates that this is the only struct which contains the same pointer.
7465 * Rust functions which take ownership of an object provided via an argument require
7466 * this to be true and invalidate the object pointed to by inner.
7469 } LDKPositiveTimestamp;
7472 * The contents of CResult_PositiveTimestampCreationErrorZ
7474 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
7476 * A pointer to the contents in the success state.
7477 * Reading from this pointer when `result_ok` is not set is undefined.
7479 struct LDKPositiveTimestamp *result;
7481 * A pointer to the contents in the error state.
7482 * Reading from this pointer when `result_ok` is set is undefined.
7484 enum LDKCreationError *err;
7485 } LDKCResult_PositiveTimestampCreationErrorZPtr;
7488 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
7489 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
7490 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7492 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
7494 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
7495 * `err` or `result` depending on the state of `result_ok`.
7497 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
7499 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
7502 } LDKCResult_PositiveTimestampCreationErrorZ;
7505 * The contents of CResult_NoneSemanticErrorZ
7507 typedef union LDKCResult_NoneSemanticErrorZPtr {
7509 * Note that this value is always NULL, as there are no contents in the OK variant
7513 * A pointer to the contents in the error state.
7514 * Reading from this pointer when `result_ok` is set is undefined.
7516 enum LDKSemanticError *err;
7517 } LDKCResult_NoneSemanticErrorZPtr;
7520 * A CResult_NoneSemanticErrorZ represents the result of a fallible operation,
7521 * containing a () on success and a crate::lightning_invoice::SemanticError on failure.
7522 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7524 typedef struct LDKCResult_NoneSemanticErrorZ {
7526 * The contents of this CResult_NoneSemanticErrorZ, accessible via either
7527 * `err` or `result` depending on the state of `result_ok`.
7529 union LDKCResult_NoneSemanticErrorZPtr contents;
7531 * Whether this CResult_NoneSemanticErrorZ represents a success state.
7534 } LDKCResult_NoneSemanticErrorZ;
7537 * The contents of CResult_InvoiceSemanticErrorZ
7539 typedef union LDKCResult_InvoiceSemanticErrorZPtr {
7541 * A pointer to the contents in the success state.
7542 * Reading from this pointer when `result_ok` is not set is undefined.
7544 struct LDKInvoice *result;
7546 * A pointer to the contents in the error state.
7547 * Reading from this pointer when `result_ok` is set is undefined.
7549 enum LDKSemanticError *err;
7550 } LDKCResult_InvoiceSemanticErrorZPtr;
7553 * A CResult_InvoiceSemanticErrorZ represents the result of a fallible operation,
7554 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SemanticError on failure.
7555 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7557 typedef struct LDKCResult_InvoiceSemanticErrorZ {
7559 * The contents of this CResult_InvoiceSemanticErrorZ, accessible via either
7560 * `err` or `result` depending on the state of `result_ok`.
7562 union LDKCResult_InvoiceSemanticErrorZPtr contents;
7564 * Whether this CResult_InvoiceSemanticErrorZ represents a success state.
7567 } LDKCResult_InvoiceSemanticErrorZ;
7572 * Description string
7575 * The description can be at most 639 __bytes__ long
7577 typedef struct MUST_USE_STRUCT LDKDescription {
7579 * A pointer to the opaque Rust object.
7580 * Nearly everywhere, inner must be non-null, however in places where
7581 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7583 LDKnativeDescription *inner;
7585 * Indicates that this is the only struct which contains the same pointer.
7586 * Rust functions which take ownership of an object provided via an argument require
7587 * this to be true and invalidate the object pointed to by inner.
7593 * The contents of CResult_DescriptionCreationErrorZ
7595 typedef union LDKCResult_DescriptionCreationErrorZPtr {
7597 * A pointer to the contents in the success state.
7598 * Reading from this pointer when `result_ok` is not set is undefined.
7600 struct LDKDescription *result;
7602 * A pointer to the contents in the error state.
7603 * Reading from this pointer when `result_ok` is set is undefined.
7605 enum LDKCreationError *err;
7606 } LDKCResult_DescriptionCreationErrorZPtr;
7609 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
7610 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
7611 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7613 typedef struct LDKCResult_DescriptionCreationErrorZ {
7615 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
7616 * `err` or `result` depending on the state of `result_ok`.
7618 union LDKCResult_DescriptionCreationErrorZPtr contents;
7620 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
7623 } LDKCResult_DescriptionCreationErrorZ;
7626 * The contents of CResult_PrivateRouteCreationErrorZ
7628 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
7630 * A pointer to the contents in the success state.
7631 * Reading from this pointer when `result_ok` is not set is undefined.
7633 struct LDKPrivateRoute *result;
7635 * A pointer to the contents in the error state.
7636 * Reading from this pointer when `result_ok` is set is undefined.
7638 enum LDKCreationError *err;
7639 } LDKCResult_PrivateRouteCreationErrorZPtr;
7642 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
7643 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
7644 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7646 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
7648 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
7649 * `err` or `result` depending on the state of `result_ok`.
7651 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
7653 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
7656 } LDKCResult_PrivateRouteCreationErrorZ;
7659 * The contents of CResult_StringErrorZ
7661 typedef union LDKCResult_StringErrorZPtr {
7663 * A pointer to the contents in the success state.
7664 * Reading from this pointer when `result_ok` is not set is undefined.
7666 struct LDKStr *result;
7668 * A pointer to the contents in the error state.
7669 * Reading from this pointer when `result_ok` is set is undefined.
7671 enum LDKSecp256k1Error *err;
7672 } LDKCResult_StringErrorZPtr;
7675 * A CResult_StringErrorZ represents the result of a fallible operation,
7676 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
7677 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7679 typedef struct LDKCResult_StringErrorZ {
7681 * The contents of this CResult_StringErrorZ, accessible via either
7682 * `err` or `result` depending on the state of `result_ok`.
7684 union LDKCResult_StringErrorZPtr contents;
7686 * Whether this CResult_StringErrorZ represents a success state.
7689 } LDKCResult_StringErrorZ;
7692 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
7694 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
7696 * A pointer to the contents in the success state.
7697 * Reading from this pointer when `result_ok` is not set is undefined.
7699 struct LDKChannelMonitorUpdate *result;
7701 * A pointer to the contents in the error state.
7702 * Reading from this pointer when `result_ok` is set is undefined.
7704 struct LDKDecodeError *err;
7705 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
7708 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
7709 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
7710 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7712 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
7714 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
7715 * `err` or `result` depending on the state of `result_ok`.
7717 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
7719 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
7722 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
7725 * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
7727 typedef enum LDKCOption_MonitorEventZ_Tag {
7729 * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
7731 LDKCOption_MonitorEventZ_Some,
7733 * When we're in this state, this COption_MonitorEventZ contains nothing
7735 LDKCOption_MonitorEventZ_None,
7737 * Must be last for serialization purposes
7739 LDKCOption_MonitorEventZ_Sentinel,
7740 } LDKCOption_MonitorEventZ_Tag;
7742 typedef struct LDKCOption_MonitorEventZ {
7743 LDKCOption_MonitorEventZ_Tag tag;
7746 struct LDKMonitorEvent some;
7749 } LDKCOption_MonitorEventZ;
7752 * The contents of CResult_COption_MonitorEventZDecodeErrorZ
7754 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
7756 * A pointer to the contents in the success state.
7757 * Reading from this pointer when `result_ok` is not set is undefined.
7759 struct LDKCOption_MonitorEventZ *result;
7761 * A pointer to the contents in the error state.
7762 * Reading from this pointer when `result_ok` is set is undefined.
7764 struct LDKDecodeError *err;
7765 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
7768 * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
7769 * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
7770 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7772 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
7774 * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
7775 * `err` or `result` depending on the state of `result_ok`.
7777 union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
7779 * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
7782 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
7785 * The contents of CResult_HTLCUpdateDecodeErrorZ
7787 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
7789 * A pointer to the contents in the success state.
7790 * Reading from this pointer when `result_ok` is not set is undefined.
7792 struct LDKHTLCUpdate *result;
7794 * A pointer to the contents in the error state.
7795 * Reading from this pointer when `result_ok` is set is undefined.
7797 struct LDKDecodeError *err;
7798 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
7801 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
7802 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
7803 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7805 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
7807 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
7808 * `err` or `result` depending on the state of `result_ok`.
7810 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
7812 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
7815 } LDKCResult_HTLCUpdateDecodeErrorZ;
7818 * A tuple of 2 elements. See the individual fields for the types contained.
7820 typedef struct LDKC2Tuple_OutPointScriptZ {
7822 * The element at position 0
7824 struct LDKOutPoint a;
7826 * The element at position 1
7828 struct LDKCVec_u8Z b;
7829 } LDKC2Tuple_OutPointScriptZ;
7832 * A tuple of 2 elements. See the individual fields for the types contained.
7834 typedef struct LDKC2Tuple_u32ScriptZ {
7836 * The element at position 0
7840 * The element at position 1
7842 struct LDKCVec_u8Z b;
7843 } LDKC2Tuple_u32ScriptZ;
7846 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
7847 * This corresponds to std::vector in C++
7849 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
7851 * The elements in the array.
7852 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7854 struct LDKC2Tuple_u32ScriptZ *data;
7856 * The number of elements pointed to by `data`.
7859 } LDKCVec_C2Tuple_u32ScriptZZ;
7862 * A tuple of 2 elements. See the individual fields for the types contained.
7864 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
7866 * The element at position 0
7868 struct LDKThirtyTwoBytes a;
7870 * The element at position 1
7872 struct LDKCVec_C2Tuple_u32ScriptZZ b;
7873 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
7876 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
7877 * This corresponds to std::vector in C++
7879 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
7881 * The elements in the array.
7882 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7884 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
7886 * The number of elements pointed to by `data`.
7889 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
7892 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
7893 * This corresponds to std::vector in C++
7895 typedef struct LDKCVec_EventZ {
7897 * The elements in the array.
7898 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7900 struct LDKEvent *data;
7902 * The number of elements pointed to by `data`.
7908 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
7909 * This corresponds to std::vector in C++
7911 typedef struct LDKCVec_TransactionZ {
7913 * The elements in the array.
7914 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7916 struct LDKTransaction *data;
7918 * The number of elements pointed to by `data`.
7921 } LDKCVec_TransactionZ;
7924 * A tuple of 2 elements. See the individual fields for the types contained.
7926 typedef struct LDKC2Tuple_u32TxOutZ {
7928 * The element at position 0
7932 * The element at position 1
7935 } LDKC2Tuple_u32TxOutZ;
7938 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
7939 * This corresponds to std::vector in C++
7941 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
7943 * The elements in the array.
7944 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7946 struct LDKC2Tuple_u32TxOutZ *data;
7948 * The number of elements pointed to by `data`.
7951 } LDKCVec_C2Tuple_u32TxOutZZ;
7954 * A tuple of 2 elements. See the individual fields for the types contained.
7956 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
7958 * The element at position 0
7960 struct LDKThirtyTwoBytes a;
7962 * The element at position 1
7964 struct LDKCVec_C2Tuple_u32TxOutZZ b;
7965 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
7968 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
7969 * This corresponds to std::vector in C++
7971 typedef struct LDKCVec_TransactionOutputsZ {
7973 * The elements in the array.
7974 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7976 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
7978 * The number of elements pointed to by `data`.
7981 } LDKCVec_TransactionOutputsZ;
7984 * Details about the balance(s) available for spending once the channel appears on chain.
7986 * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
7989 typedef enum LDKBalance_Tag {
7991 * The channel is not yet closed (or the commitment or closing transaction has not yet
7992 * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
7995 LDKBalance_ClaimableOnChannelClose,
7997 * The channel has been closed, and the given balance is ours but awaiting confirmations until
7998 * we consider it spendable.
8000 LDKBalance_ClaimableAwaitingConfirmations,
8002 * The channel has been closed, and the given balance should be ours but awaiting spending
8003 * transaction confirmation. If the spending transaction does not confirm in time, it is
8004 * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
8006 * Once the spending transaction confirms, before it has reached enough confirmations to be
8007 * considered safe from chain reorganizations, the balance will instead be provided via
8008 * [`Balance::ClaimableAwaitingConfirmations`].
8010 LDKBalance_ContentiousClaimable,
8012 * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
8013 * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
8014 * likely to be claimed by our counterparty before we do.
8016 LDKBalance_MaybeClaimableHTLCAwaitingTimeout,
8018 * Must be last for serialization purposes
8020 LDKBalance_Sentinel,
8023 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
8025 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
8026 * required to do so.
8028 uint64_t claimable_amount_satoshis;
8029 } LDKBalance_LDKClaimableOnChannelClose_Body;
8031 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
8033 * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
8034 * were spent in broadcasting the transaction.
8036 uint64_t claimable_amount_satoshis;
8038 * The height at which an [`Event::SpendableOutputs`] event will be generated for this
8041 uint32_t confirmation_height;
8042 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
8044 typedef struct LDKBalance_LDKContentiousClaimable_Body {
8046 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
8047 * required to do so.
8049 uint64_t claimable_amount_satoshis;
8051 * The height at which the counterparty may be able to claim the balance if we have not
8054 uint32_t timeout_height;
8055 } LDKBalance_LDKContentiousClaimable_Body;
8057 typedef struct LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body {
8059 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
8060 * required to do so.
8062 uint64_t claimable_amount_satoshis;
8064 * The height at which we will be able to claim the balance if our counterparty has not
8067 uint32_t claimable_height;
8068 } LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body;
8070 typedef struct MUST_USE_STRUCT LDKBalance {
8073 LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
8074 LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
8075 LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
8076 LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body maybe_claimable_htlc_awaiting_timeout;
8081 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
8082 * This corresponds to std::vector in C++
8084 typedef struct LDKCVec_BalanceZ {
8086 * The elements in the array.
8087 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8089 struct LDKBalance *data;
8091 * The number of elements pointed to by `data`.
8097 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
8099 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
8101 * A pointer to the contents in the success state.
8102 * Reading from this pointer when `result_ok` is not set is undefined.
8104 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
8106 * A pointer to the contents in the error state.
8107 * Reading from this pointer when `result_ok` is set is undefined.
8109 struct LDKDecodeError *err;
8110 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
8113 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
8114 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
8115 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8117 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
8119 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
8120 * `err` or `result` depending on the state of `result_ok`.
8122 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
8124 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
8127 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
8130 * The contents of CResult_NoneLightningErrorZ
8132 typedef union LDKCResult_NoneLightningErrorZPtr {
8134 * Note that this value is always NULL, as there are no contents in the OK variant
8138 * A pointer to the contents in the error state.
8139 * Reading from this pointer when `result_ok` is set is undefined.
8141 struct LDKLightningError *err;
8142 } LDKCResult_NoneLightningErrorZPtr;
8145 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
8146 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
8147 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8149 typedef struct LDKCResult_NoneLightningErrorZ {
8151 * The contents of this CResult_NoneLightningErrorZ, accessible via either
8152 * `err` or `result` depending on the state of `result_ok`.
8154 union LDKCResult_NoneLightningErrorZPtr contents;
8156 * Whether this CResult_NoneLightningErrorZ represents a success state.
8159 } LDKCResult_NoneLightningErrorZ;
8162 * A tuple of 2 elements. See the individual fields for the types contained.
8164 typedef struct LDKC2Tuple_PublicKeyTypeZ {
8166 * The element at position 0
8168 struct LDKPublicKey a;
8170 * The element at position 1
8173 } LDKC2Tuple_PublicKeyTypeZ;
8176 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
8177 * This corresponds to std::vector in C++
8179 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
8181 * The elements in the array.
8182 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8184 struct LDKC2Tuple_PublicKeyTypeZ *data;
8186 * The number of elements pointed to by `data`.
8189 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
8192 * The contents of CResult_boolLightningErrorZ
8194 typedef union LDKCResult_boolLightningErrorZPtr {
8196 * A pointer to the contents in the success state.
8197 * Reading from this pointer when `result_ok` is not set is undefined.
8201 * A pointer to the contents in the error state.
8202 * Reading from this pointer when `result_ok` is set is undefined.
8204 struct LDKLightningError *err;
8205 } LDKCResult_boolLightningErrorZPtr;
8208 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
8209 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
8210 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8212 typedef struct LDKCResult_boolLightningErrorZ {
8214 * The contents of this CResult_boolLightningErrorZ, accessible via either
8215 * `err` or `result` depending on the state of `result_ok`.
8217 union LDKCResult_boolLightningErrorZPtr contents;
8219 * Whether this CResult_boolLightningErrorZ represents a success state.
8222 } LDKCResult_boolLightningErrorZ;
8225 * A tuple of 3 elements. See the individual fields for the types contained.
8227 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
8229 * The element at position 0
8231 struct LDKChannelAnnouncement a;
8233 * The element at position 1
8235 struct LDKChannelUpdate b;
8237 * The element at position 2
8239 struct LDKChannelUpdate c;
8240 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
8243 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
8244 * This corresponds to std::vector in C++
8246 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
8248 * The elements in the array.
8249 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8251 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
8253 * The number of elements pointed to by `data`.
8256 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
8259 * A dynamically-allocated array of crate::lightning::ln::msgs::NodeAnnouncements of arbitrary size.
8260 * This corresponds to std::vector in C++
8262 typedef struct LDKCVec_NodeAnnouncementZ {
8264 * The elements in the array.
8265 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8267 struct LDKNodeAnnouncement *data;
8269 * The number of elements pointed to by `data`.
8272 } LDKCVec_NodeAnnouncementZ;
8275 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
8276 * This corresponds to std::vector in C++
8278 typedef struct LDKCVec_PublicKeyZ {
8280 * The elements in the array.
8281 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8283 struct LDKPublicKey *data;
8285 * The number of elements pointed to by `data`.
8288 } LDKCVec_PublicKeyZ;
8293 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
8294 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
8297 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
8299 * A pointer to the opaque Rust object.
8300 * Nearly everywhere, inner must be non-null, however in places where
8301 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8303 LDKnativePeerHandleError *inner;
8305 * Indicates that this is the only struct which contains the same pointer.
8306 * Rust functions which take ownership of an object provided via an argument require
8307 * this to be true and invalidate the object pointed to by inner.
8310 } LDKPeerHandleError;
8313 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
8315 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
8317 * A pointer to the contents in the success state.
8318 * Reading from this pointer when `result_ok` is not set is undefined.
8320 struct LDKCVec_u8Z *result;
8322 * A pointer to the contents in the error state.
8323 * Reading from this pointer when `result_ok` is set is undefined.
8325 struct LDKPeerHandleError *err;
8326 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
8329 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
8330 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
8331 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8333 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
8335 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
8336 * `err` or `result` depending on the state of `result_ok`.
8338 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
8340 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
8343 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
8346 * The contents of CResult_NonePeerHandleErrorZ
8348 typedef union LDKCResult_NonePeerHandleErrorZPtr {
8350 * Note that this value is always NULL, as there are no contents in the OK variant
8354 * A pointer to the contents in the error state.
8355 * Reading from this pointer when `result_ok` is set is undefined.
8357 struct LDKPeerHandleError *err;
8358 } LDKCResult_NonePeerHandleErrorZPtr;
8361 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
8362 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
8363 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8365 typedef struct LDKCResult_NonePeerHandleErrorZ {
8367 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
8368 * `err` or `result` depending on the state of `result_ok`.
8370 union LDKCResult_NonePeerHandleErrorZPtr contents;
8372 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
8375 } LDKCResult_NonePeerHandleErrorZ;
8378 * The contents of CResult_boolPeerHandleErrorZ
8380 typedef union LDKCResult_boolPeerHandleErrorZPtr {
8382 * A pointer to the contents in the success state.
8383 * Reading from this pointer when `result_ok` is not set is undefined.
8387 * A pointer to the contents in the error state.
8388 * Reading from this pointer when `result_ok` is set is undefined.
8390 struct LDKPeerHandleError *err;
8391 } LDKCResult_boolPeerHandleErrorZPtr;
8394 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
8395 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
8396 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8398 typedef struct LDKCResult_boolPeerHandleErrorZ {
8400 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
8401 * `err` or `result` depending on the state of `result_ok`.
8403 union LDKCResult_boolPeerHandleErrorZPtr contents;
8405 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
8408 } LDKCResult_boolPeerHandleErrorZ;
8413 * Represents the compressed public key of a node
8415 typedef struct MUST_USE_STRUCT LDKNodeId {
8417 * A pointer to the opaque Rust object.
8418 * Nearly everywhere, inner must be non-null, however in places where
8419 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8421 LDKnativeNodeId *inner;
8423 * Indicates that this is the only struct which contains the same pointer.
8424 * Rust functions which take ownership of an object provided via an argument require
8425 * this to be true and invalidate the object pointed to by inner.
8431 * The contents of CResult_NodeIdDecodeErrorZ
8433 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
8435 * A pointer to the contents in the success state.
8436 * Reading from this pointer when `result_ok` is not set is undefined.
8438 struct LDKNodeId *result;
8440 * A pointer to the contents in the error state.
8441 * Reading from this pointer when `result_ok` is set is undefined.
8443 struct LDKDecodeError *err;
8444 } LDKCResult_NodeIdDecodeErrorZPtr;
8447 * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
8448 * containing a crate::lightning::routing::network_graph::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
8449 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8451 typedef struct LDKCResult_NodeIdDecodeErrorZ {
8453 * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
8454 * `err` or `result` depending on the state of `result_ok`.
8456 union LDKCResult_NodeIdDecodeErrorZPtr contents;
8458 * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
8461 } LDKCResult_NodeIdDecodeErrorZ;
8464 * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
8466 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
8468 * A pointer to the contents in the success state.
8469 * Reading from this pointer when `result_ok` is not set is undefined.
8471 struct LDKCOption_NetworkUpdateZ *result;
8473 * A pointer to the contents in the error state.
8474 * Reading from this pointer when `result_ok` is set is undefined.
8476 struct LDKDecodeError *err;
8477 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
8480 * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
8481 * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
8482 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8484 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
8486 * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
8487 * `err` or `result` depending on the state of `result_ok`.
8489 union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
8491 * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
8494 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
8497 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
8500 typedef struct LDKAccess {
8502 * An opaque pointer which is passed to your function implementations as an argument.
8503 * This has no meaning in the LDK, and can be NULL or any other value.
8507 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
8508 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
8511 * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
8513 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
8515 * Frees any resources associated with this object given its this_arg pointer.
8516 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8518 void (*free)(void *this_arg);
8522 * An enum which can either contain a crate::lightning::chain::Access or not
8524 typedef enum LDKCOption_AccessZ_Tag {
8526 * When we're in this state, this COption_AccessZ contains a crate::lightning::chain::Access
8528 LDKCOption_AccessZ_Some,
8530 * When we're in this state, this COption_AccessZ contains nothing
8532 LDKCOption_AccessZ_None,
8534 * Must be last for serialization purposes
8536 LDKCOption_AccessZ_Sentinel,
8537 } LDKCOption_AccessZ_Tag;
8539 typedef struct LDKCOption_AccessZ {
8540 LDKCOption_AccessZ_Tag tag;
8543 struct LDKAccess some;
8546 } LDKCOption_AccessZ;
8551 * Details about one direction of a channel as received within a [`ChannelUpdate`].
8553 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
8555 * A pointer to the opaque Rust object.
8556 * Nearly everywhere, inner must be non-null, however in places where
8557 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8559 LDKnativeChannelUpdateInfo *inner;
8561 * Indicates that this is the only struct which contains the same pointer.
8562 * Rust functions which take ownership of an object provided via an argument require
8563 * this to be true and invalidate the object pointed to by inner.
8566 } LDKChannelUpdateInfo;
8569 * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
8571 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
8573 * A pointer to the contents in the success state.
8574 * Reading from this pointer when `result_ok` is not set is undefined.
8576 struct LDKChannelUpdateInfo *result;
8578 * A pointer to the contents in the error state.
8579 * Reading from this pointer when `result_ok` is set is undefined.
8581 struct LDKDecodeError *err;
8582 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
8585 * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
8586 * containing a crate::lightning::routing::network_graph::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8587 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8589 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
8591 * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
8592 * `err` or `result` depending on the state of `result_ok`.
8594 union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
8596 * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
8599 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
8604 * Details about a channel (both directions).
8605 * Received within a channel announcement.
8607 typedef struct MUST_USE_STRUCT LDKChannelInfo {
8609 * A pointer to the opaque Rust object.
8610 * Nearly everywhere, inner must be non-null, however in places where
8611 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8613 LDKnativeChannelInfo *inner;
8615 * Indicates that this is the only struct which contains the same pointer.
8616 * Rust functions which take ownership of an object provided via an argument require
8617 * this to be true and invalidate the object pointed to by inner.
8623 * The contents of CResult_ChannelInfoDecodeErrorZ
8625 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
8627 * A pointer to the contents in the success state.
8628 * Reading from this pointer when `result_ok` is not set is undefined.
8630 struct LDKChannelInfo *result;
8632 * A pointer to the contents in the error state.
8633 * Reading from this pointer when `result_ok` is set is undefined.
8635 struct LDKDecodeError *err;
8636 } LDKCResult_ChannelInfoDecodeErrorZPtr;
8639 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
8640 * containing a crate::lightning::routing::network_graph::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8641 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8643 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
8645 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
8646 * `err` or `result` depending on the state of `result_ok`.
8648 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
8650 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
8653 } LDKCResult_ChannelInfoDecodeErrorZ;
8658 * Fees for routing via a given channel or a node
8660 typedef struct MUST_USE_STRUCT LDKRoutingFees {
8662 * A pointer to the opaque Rust object.
8663 * Nearly everywhere, inner must be non-null, however in places where
8664 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8666 LDKnativeRoutingFees *inner;
8668 * Indicates that this is the only struct which contains the same pointer.
8669 * Rust functions which take ownership of an object provided via an argument require
8670 * this to be true and invalidate the object pointed to by inner.
8676 * The contents of CResult_RoutingFeesDecodeErrorZ
8678 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
8680 * A pointer to the contents in the success state.
8681 * Reading from this pointer when `result_ok` is not set is undefined.
8683 struct LDKRoutingFees *result;
8685 * A pointer to the contents in the error state.
8686 * Reading from this pointer when `result_ok` is set is undefined.
8688 struct LDKDecodeError *err;
8689 } LDKCResult_RoutingFeesDecodeErrorZPtr;
8692 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
8693 * containing a crate::lightning::routing::network_graph::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
8694 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8696 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
8698 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
8699 * `err` or `result` depending on the state of `result_ok`.
8701 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
8703 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
8706 } LDKCResult_RoutingFeesDecodeErrorZ;
8711 * Information received in the latest node_announcement from this node.
8713 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
8715 * A pointer to the opaque Rust object.
8716 * Nearly everywhere, inner must be non-null, however in places where
8717 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8719 LDKnativeNodeAnnouncementInfo *inner;
8721 * Indicates that this is the only struct which contains the same pointer.
8722 * Rust functions which take ownership of an object provided via an argument require
8723 * this to be true and invalidate the object pointed to by inner.
8726 } LDKNodeAnnouncementInfo;
8729 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
8731 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
8733 * A pointer to the contents in the success state.
8734 * Reading from this pointer when `result_ok` is not set is undefined.
8736 struct LDKNodeAnnouncementInfo *result;
8738 * A pointer to the contents in the error state.
8739 * Reading from this pointer when `result_ok` is set is undefined.
8741 struct LDKDecodeError *err;
8742 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
8745 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
8746 * containing a crate::lightning::routing::network_graph::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8747 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8749 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
8751 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
8752 * `err` or `result` depending on the state of `result_ok`.
8754 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
8756 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
8759 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
8762 * A dynamically-allocated array of u64s of arbitrary size.
8763 * This corresponds to std::vector in C++
8765 typedef struct LDKCVec_u64Z {
8767 * The elements in the array.
8768 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8772 * The number of elements pointed to by `data`.
8780 * Details about a node in the network, known from the network announcement.
8782 typedef struct MUST_USE_STRUCT LDKNodeInfo {
8784 * A pointer to the opaque Rust object.
8785 * Nearly everywhere, inner must be non-null, however in places where
8786 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8788 LDKnativeNodeInfo *inner;
8790 * Indicates that this is the only struct which contains the same pointer.
8791 * Rust functions which take ownership of an object provided via an argument require
8792 * this to be true and invalidate the object pointed to by inner.
8798 * The contents of CResult_NodeInfoDecodeErrorZ
8800 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
8802 * A pointer to the contents in the success state.
8803 * Reading from this pointer when `result_ok` is not set is undefined.
8805 struct LDKNodeInfo *result;
8807 * A pointer to the contents in the error state.
8808 * Reading from this pointer when `result_ok` is set is undefined.
8810 struct LDKDecodeError *err;
8811 } LDKCResult_NodeInfoDecodeErrorZPtr;
8814 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
8815 * containing a crate::lightning::routing::network_graph::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8816 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8818 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
8820 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
8821 * `err` or `result` depending on the state of `result_ok`.
8823 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
8825 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
8828 } LDKCResult_NodeInfoDecodeErrorZ;
8831 * The contents of CResult_NetworkGraphDecodeErrorZ
8833 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
8835 * A pointer to the contents in the success state.
8836 * Reading from this pointer when `result_ok` is not set is undefined.
8838 struct LDKNetworkGraph *result;
8840 * A pointer to the contents in the error state.
8841 * Reading from this pointer when `result_ok` is set is undefined.
8843 struct LDKDecodeError *err;
8844 } LDKCResult_NetworkGraphDecodeErrorZPtr;
8847 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
8848 * containing a crate::lightning::routing::network_graph::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
8849 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8851 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
8853 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
8854 * `err` or `result` depending on the state of `result_ok`.
8856 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
8858 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
8861 } LDKCResult_NetworkGraphDecodeErrorZ;
8864 * An enum which can either contain a crate::c_types::derived::CVec_NetAddressZ or not
8866 typedef enum LDKCOption_CVec_NetAddressZZ_Tag {
8868 * When we're in this state, this COption_CVec_NetAddressZZ contains a crate::c_types::derived::CVec_NetAddressZ
8870 LDKCOption_CVec_NetAddressZZ_Some,
8872 * When we're in this state, this COption_CVec_NetAddressZZ contains nothing
8874 LDKCOption_CVec_NetAddressZZ_None,
8876 * Must be last for serialization purposes
8878 LDKCOption_CVec_NetAddressZZ_Sentinel,
8879 } LDKCOption_CVec_NetAddressZZ_Tag;
8881 typedef struct LDKCOption_CVec_NetAddressZZ {
8882 LDKCOption_CVec_NetAddressZZ_Tag tag;
8885 struct LDKCVec_NetAddressZ some;
8888 } LDKCOption_CVec_NetAddressZZ;
8891 * The contents of CResult_NetAddressDecodeErrorZ
8893 typedef union LDKCResult_NetAddressDecodeErrorZPtr {
8895 * A pointer to the contents in the success state.
8896 * Reading from this pointer when `result_ok` is not set is undefined.
8898 struct LDKNetAddress *result;
8900 * A pointer to the contents in the error state.
8901 * Reading from this pointer when `result_ok` is set is undefined.
8903 struct LDKDecodeError *err;
8904 } LDKCResult_NetAddressDecodeErrorZPtr;
8907 * A CResult_NetAddressDecodeErrorZ represents the result of a fallible operation,
8908 * containing a crate::lightning::ln::msgs::NetAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
8909 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8911 typedef struct LDKCResult_NetAddressDecodeErrorZ {
8913 * The contents of this CResult_NetAddressDecodeErrorZ, accessible via either
8914 * `err` or `result` depending on the state of `result_ok`.
8916 union LDKCResult_NetAddressDecodeErrorZPtr contents;
8918 * Whether this CResult_NetAddressDecodeErrorZ represents a success state.
8921 } LDKCResult_NetAddressDecodeErrorZ;
8926 * An update_add_htlc message to be sent or received from a peer
8928 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
8930 * A pointer to the opaque Rust object.
8931 * Nearly everywhere, inner must be non-null, however in places where
8932 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8934 LDKnativeUpdateAddHTLC *inner;
8936 * Indicates that this is the only struct which contains the same pointer.
8937 * Rust functions which take ownership of an object provided via an argument require
8938 * this to be true and invalidate the object pointed to by inner.
8944 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
8945 * This corresponds to std::vector in C++
8947 typedef struct LDKCVec_UpdateAddHTLCZ {
8949 * The elements in the array.
8950 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8952 struct LDKUpdateAddHTLC *data;
8954 * The number of elements pointed to by `data`.
8957 } LDKCVec_UpdateAddHTLCZ;
8962 * An update_fulfill_htlc message to be sent or received from a peer
8964 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
8966 * A pointer to the opaque Rust object.
8967 * Nearly everywhere, inner must be non-null, however in places where
8968 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8970 LDKnativeUpdateFulfillHTLC *inner;
8972 * Indicates that this is the only struct which contains the same pointer.
8973 * Rust functions which take ownership of an object provided via an argument require
8974 * this to be true and invalidate the object pointed to by inner.
8977 } LDKUpdateFulfillHTLC;
8980 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
8981 * This corresponds to std::vector in C++
8983 typedef struct LDKCVec_UpdateFulfillHTLCZ {
8985 * The elements in the array.
8986 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8988 struct LDKUpdateFulfillHTLC *data;
8990 * The number of elements pointed to by `data`.
8993 } LDKCVec_UpdateFulfillHTLCZ;
8998 * An update_fail_htlc message to be sent or received from a peer
9000 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
9002 * A pointer to the opaque Rust object.
9003 * Nearly everywhere, inner must be non-null, however in places where
9004 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9006 LDKnativeUpdateFailHTLC *inner;
9008 * Indicates that this is the only struct which contains the same pointer.
9009 * Rust functions which take ownership of an object provided via an argument require
9010 * this to be true and invalidate the object pointed to by inner.
9013 } LDKUpdateFailHTLC;
9016 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
9017 * This corresponds to std::vector in C++
9019 typedef struct LDKCVec_UpdateFailHTLCZ {
9021 * The elements in the array.
9022 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9024 struct LDKUpdateFailHTLC *data;
9026 * The number of elements pointed to by `data`.
9029 } LDKCVec_UpdateFailHTLCZ;
9034 * An update_fail_malformed_htlc message to be sent or received from a peer
9036 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
9038 * A pointer to the opaque Rust object.
9039 * Nearly everywhere, inner must be non-null, however in places where
9040 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9042 LDKnativeUpdateFailMalformedHTLC *inner;
9044 * Indicates that this is the only struct which contains the same pointer.
9045 * Rust functions which take ownership of an object provided via an argument require
9046 * this to be true and invalidate the object pointed to by inner.
9049 } LDKUpdateFailMalformedHTLC;
9052 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
9053 * This corresponds to std::vector in C++
9055 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
9057 * The elements in the array.
9058 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9060 struct LDKUpdateFailMalformedHTLC *data;
9062 * The number of elements pointed to by `data`.
9065 } LDKCVec_UpdateFailMalformedHTLCZ;
9068 * The contents of CResult_AcceptChannelDecodeErrorZ
9070 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
9072 * A pointer to the contents in the success state.
9073 * Reading from this pointer when `result_ok` is not set is undefined.
9075 struct LDKAcceptChannel *result;
9077 * A pointer to the contents in the error state.
9078 * Reading from this pointer when `result_ok` is set is undefined.
9080 struct LDKDecodeError *err;
9081 } LDKCResult_AcceptChannelDecodeErrorZPtr;
9084 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
9085 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
9086 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9088 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
9090 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
9091 * `err` or `result` depending on the state of `result_ok`.
9093 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
9095 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
9098 } LDKCResult_AcceptChannelDecodeErrorZ;
9101 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
9103 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
9105 * A pointer to the contents in the success state.
9106 * Reading from this pointer when `result_ok` is not set is undefined.
9108 struct LDKAnnouncementSignatures *result;
9110 * A pointer to the contents in the error state.
9111 * Reading from this pointer when `result_ok` is set is undefined.
9113 struct LDKDecodeError *err;
9114 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
9117 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
9118 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
9119 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9121 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
9123 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
9124 * `err` or `result` depending on the state of `result_ok`.
9126 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
9128 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
9131 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
9134 * The contents of CResult_ChannelReestablishDecodeErrorZ
9136 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
9138 * A pointer to the contents in the success state.
9139 * Reading from this pointer when `result_ok` is not set is undefined.
9141 struct LDKChannelReestablish *result;
9143 * A pointer to the contents in the error state.
9144 * Reading from this pointer when `result_ok` is set is undefined.
9146 struct LDKDecodeError *err;
9147 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
9150 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
9151 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
9152 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9154 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
9156 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
9157 * `err` or `result` depending on the state of `result_ok`.
9159 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
9161 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
9164 } LDKCResult_ChannelReestablishDecodeErrorZ;
9167 * The contents of CResult_ClosingSignedDecodeErrorZ
9169 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
9171 * A pointer to the contents in the success state.
9172 * Reading from this pointer when `result_ok` is not set is undefined.
9174 struct LDKClosingSigned *result;
9176 * A pointer to the contents in the error state.
9177 * Reading from this pointer when `result_ok` is set is undefined.
9179 struct LDKDecodeError *err;
9180 } LDKCResult_ClosingSignedDecodeErrorZPtr;
9183 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
9184 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
9185 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9187 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
9189 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
9190 * `err` or `result` depending on the state of `result_ok`.
9192 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
9194 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
9197 } LDKCResult_ClosingSignedDecodeErrorZ;
9202 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
9203 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
9206 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
9208 * A pointer to the opaque Rust object.
9209 * Nearly everywhere, inner must be non-null, however in places where
9210 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9212 LDKnativeClosingSignedFeeRange *inner;
9214 * Indicates that this is the only struct which contains the same pointer.
9215 * Rust functions which take ownership of an object provided via an argument require
9216 * this to be true and invalidate the object pointed to by inner.
9219 } LDKClosingSignedFeeRange;
9222 * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
9224 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
9226 * A pointer to the contents in the success state.
9227 * Reading from this pointer when `result_ok` is not set is undefined.
9229 struct LDKClosingSignedFeeRange *result;
9231 * A pointer to the contents in the error state.
9232 * Reading from this pointer when `result_ok` is set is undefined.
9234 struct LDKDecodeError *err;
9235 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
9238 * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
9239 * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
9240 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9242 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
9244 * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
9245 * `err` or `result` depending on the state of `result_ok`.
9247 union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
9249 * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
9252 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
9257 * A commitment_signed message to be sent or received from a peer
9259 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
9261 * A pointer to the opaque Rust object.
9262 * Nearly everywhere, inner must be non-null, however in places where
9263 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9265 LDKnativeCommitmentSigned *inner;
9267 * Indicates that this is the only struct which contains the same pointer.
9268 * Rust functions which take ownership of an object provided via an argument require
9269 * this to be true and invalidate the object pointed to by inner.
9272 } LDKCommitmentSigned;
9275 * The contents of CResult_CommitmentSignedDecodeErrorZ
9277 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
9279 * A pointer to the contents in the success state.
9280 * Reading from this pointer when `result_ok` is not set is undefined.
9282 struct LDKCommitmentSigned *result;
9284 * A pointer to the contents in the error state.
9285 * Reading from this pointer when `result_ok` is set is undefined.
9287 struct LDKDecodeError *err;
9288 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
9291 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
9292 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
9293 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9295 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
9297 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
9298 * `err` or `result` depending on the state of `result_ok`.
9300 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
9302 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
9305 } LDKCResult_CommitmentSignedDecodeErrorZ;
9308 * The contents of CResult_FundingCreatedDecodeErrorZ
9310 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
9312 * A pointer to the contents in the success state.
9313 * Reading from this pointer when `result_ok` is not set is undefined.
9315 struct LDKFundingCreated *result;
9317 * A pointer to the contents in the error state.
9318 * Reading from this pointer when `result_ok` is set is undefined.
9320 struct LDKDecodeError *err;
9321 } LDKCResult_FundingCreatedDecodeErrorZPtr;
9324 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
9325 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
9326 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9328 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
9330 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
9331 * `err` or `result` depending on the state of `result_ok`.
9333 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
9335 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
9338 } LDKCResult_FundingCreatedDecodeErrorZ;
9341 * The contents of CResult_FundingSignedDecodeErrorZ
9343 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
9345 * A pointer to the contents in the success state.
9346 * Reading from this pointer when `result_ok` is not set is undefined.
9348 struct LDKFundingSigned *result;
9350 * A pointer to the contents in the error state.
9351 * Reading from this pointer when `result_ok` is set is undefined.
9353 struct LDKDecodeError *err;
9354 } LDKCResult_FundingSignedDecodeErrorZPtr;
9357 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
9358 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
9359 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9361 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
9363 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
9364 * `err` or `result` depending on the state of `result_ok`.
9366 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
9368 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
9371 } LDKCResult_FundingSignedDecodeErrorZ;
9374 * The contents of CResult_FundingLockedDecodeErrorZ
9376 typedef union LDKCResult_FundingLockedDecodeErrorZPtr {
9378 * A pointer to the contents in the success state.
9379 * Reading from this pointer when `result_ok` is not set is undefined.
9381 struct LDKFundingLocked *result;
9383 * A pointer to the contents in the error state.
9384 * Reading from this pointer when `result_ok` is set is undefined.
9386 struct LDKDecodeError *err;
9387 } LDKCResult_FundingLockedDecodeErrorZPtr;
9390 * A CResult_FundingLockedDecodeErrorZ represents the result of a fallible operation,
9391 * containing a crate::lightning::ln::msgs::FundingLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
9392 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9394 typedef struct LDKCResult_FundingLockedDecodeErrorZ {
9396 * The contents of this CResult_FundingLockedDecodeErrorZ, accessible via either
9397 * `err` or `result` depending on the state of `result_ok`.
9399 union LDKCResult_FundingLockedDecodeErrorZPtr contents;
9401 * Whether this CResult_FundingLockedDecodeErrorZ represents a success state.
9404 } LDKCResult_FundingLockedDecodeErrorZ;
9409 * An init message to be sent or received from a peer
9411 typedef struct MUST_USE_STRUCT LDKInit {
9413 * A pointer to the opaque Rust object.
9414 * Nearly everywhere, inner must be non-null, however in places where
9415 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9417 LDKnativeInit *inner;
9419 * Indicates that this is the only struct which contains the same pointer.
9420 * Rust functions which take ownership of an object provided via an argument require
9421 * this to be true and invalidate the object pointed to by inner.
9427 * The contents of CResult_InitDecodeErrorZ
9429 typedef union LDKCResult_InitDecodeErrorZPtr {
9431 * A pointer to the contents in the success state.
9432 * Reading from this pointer when `result_ok` is not set is undefined.
9434 struct LDKInit *result;
9436 * A pointer to the contents in the error state.
9437 * Reading from this pointer when `result_ok` is set is undefined.
9439 struct LDKDecodeError *err;
9440 } LDKCResult_InitDecodeErrorZPtr;
9443 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
9444 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
9445 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9447 typedef struct LDKCResult_InitDecodeErrorZ {
9449 * The contents of this CResult_InitDecodeErrorZ, accessible via either
9450 * `err` or `result` depending on the state of `result_ok`.
9452 union LDKCResult_InitDecodeErrorZPtr contents;
9454 * Whether this CResult_InitDecodeErrorZ represents a success state.
9457 } LDKCResult_InitDecodeErrorZ;
9460 * The contents of CResult_OpenChannelDecodeErrorZ
9462 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
9464 * A pointer to the contents in the success state.
9465 * Reading from this pointer when `result_ok` is not set is undefined.
9467 struct LDKOpenChannel *result;
9469 * A pointer to the contents in the error state.
9470 * Reading from this pointer when `result_ok` is set is undefined.
9472 struct LDKDecodeError *err;
9473 } LDKCResult_OpenChannelDecodeErrorZPtr;
9476 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
9477 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
9478 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9480 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
9482 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
9483 * `err` or `result` depending on the state of `result_ok`.
9485 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
9487 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
9490 } LDKCResult_OpenChannelDecodeErrorZ;
9493 * The contents of CResult_RevokeAndACKDecodeErrorZ
9495 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
9497 * A pointer to the contents in the success state.
9498 * Reading from this pointer when `result_ok` is not set is undefined.
9500 struct LDKRevokeAndACK *result;
9502 * A pointer to the contents in the error state.
9503 * Reading from this pointer when `result_ok` is set is undefined.
9505 struct LDKDecodeError *err;
9506 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
9509 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
9510 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
9511 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9513 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
9515 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
9516 * `err` or `result` depending on the state of `result_ok`.
9518 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
9520 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
9523 } LDKCResult_RevokeAndACKDecodeErrorZ;
9526 * The contents of CResult_ShutdownDecodeErrorZ
9528 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
9530 * A pointer to the contents in the success state.
9531 * Reading from this pointer when `result_ok` is not set is undefined.
9533 struct LDKShutdown *result;
9535 * A pointer to the contents in the error state.
9536 * Reading from this pointer when `result_ok` is set is undefined.
9538 struct LDKDecodeError *err;
9539 } LDKCResult_ShutdownDecodeErrorZPtr;
9542 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
9543 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
9544 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9546 typedef struct LDKCResult_ShutdownDecodeErrorZ {
9548 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
9549 * `err` or `result` depending on the state of `result_ok`.
9551 union LDKCResult_ShutdownDecodeErrorZPtr contents;
9553 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
9556 } LDKCResult_ShutdownDecodeErrorZ;
9559 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
9561 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
9563 * A pointer to the contents in the success state.
9564 * Reading from this pointer when `result_ok` is not set is undefined.
9566 struct LDKUpdateFailHTLC *result;
9568 * A pointer to the contents in the error state.
9569 * Reading from this pointer when `result_ok` is set is undefined.
9571 struct LDKDecodeError *err;
9572 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
9575 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
9576 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
9577 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9579 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
9581 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
9582 * `err` or `result` depending on the state of `result_ok`.
9584 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
9586 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
9589 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
9592 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
9594 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
9596 * A pointer to the contents in the success state.
9597 * Reading from this pointer when `result_ok` is not set is undefined.
9599 struct LDKUpdateFailMalformedHTLC *result;
9601 * A pointer to the contents in the error state.
9602 * Reading from this pointer when `result_ok` is set is undefined.
9604 struct LDKDecodeError *err;
9605 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
9608 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
9609 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
9610 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9612 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
9614 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
9615 * `err` or `result` depending on the state of `result_ok`.
9617 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
9619 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
9622 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
9627 * An update_fee message to be sent or received from a peer
9629 typedef struct MUST_USE_STRUCT LDKUpdateFee {
9631 * A pointer to the opaque Rust object.
9632 * Nearly everywhere, inner must be non-null, however in places where
9633 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9635 LDKnativeUpdateFee *inner;
9637 * Indicates that this is the only struct which contains the same pointer.
9638 * Rust functions which take ownership of an object provided via an argument require
9639 * this to be true and invalidate the object pointed to by inner.
9645 * The contents of CResult_UpdateFeeDecodeErrorZ
9647 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
9649 * A pointer to the contents in the success state.
9650 * Reading from this pointer when `result_ok` is not set is undefined.
9652 struct LDKUpdateFee *result;
9654 * A pointer to the contents in the error state.
9655 * Reading from this pointer when `result_ok` is set is undefined.
9657 struct LDKDecodeError *err;
9658 } LDKCResult_UpdateFeeDecodeErrorZPtr;
9661 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
9662 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
9663 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9665 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
9667 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
9668 * `err` or `result` depending on the state of `result_ok`.
9670 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
9672 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
9675 } LDKCResult_UpdateFeeDecodeErrorZ;
9678 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
9680 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
9682 * A pointer to the contents in the success state.
9683 * Reading from this pointer when `result_ok` is not set is undefined.
9685 struct LDKUpdateFulfillHTLC *result;
9687 * A pointer to the contents in the error state.
9688 * Reading from this pointer when `result_ok` is set is undefined.
9690 struct LDKDecodeError *err;
9691 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
9694 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
9695 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
9696 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9698 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
9700 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
9701 * `err` or `result` depending on the state of `result_ok`.
9703 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
9705 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
9708 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
9711 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
9713 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
9715 * A pointer to the contents in the success state.
9716 * Reading from this pointer when `result_ok` is not set is undefined.
9718 struct LDKUpdateAddHTLC *result;
9720 * A pointer to the contents in the error state.
9721 * Reading from this pointer when `result_ok` is set is undefined.
9723 struct LDKDecodeError *err;
9724 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
9727 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
9728 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
9729 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9731 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
9733 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
9734 * `err` or `result` depending on the state of `result_ok`.
9736 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
9738 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
9741 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
9746 * A ping message to be sent or received from a peer
9748 typedef struct MUST_USE_STRUCT LDKPing {
9750 * A pointer to the opaque Rust object.
9751 * Nearly everywhere, inner must be non-null, however in places where
9752 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9754 LDKnativePing *inner;
9756 * Indicates that this is the only struct which contains the same pointer.
9757 * Rust functions which take ownership of an object provided via an argument require
9758 * this to be true and invalidate the object pointed to by inner.
9764 * The contents of CResult_PingDecodeErrorZ
9766 typedef union LDKCResult_PingDecodeErrorZPtr {
9768 * A pointer to the contents in the success state.
9769 * Reading from this pointer when `result_ok` is not set is undefined.
9771 struct LDKPing *result;
9773 * A pointer to the contents in the error state.
9774 * Reading from this pointer when `result_ok` is set is undefined.
9776 struct LDKDecodeError *err;
9777 } LDKCResult_PingDecodeErrorZPtr;
9780 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
9781 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
9782 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9784 typedef struct LDKCResult_PingDecodeErrorZ {
9786 * The contents of this CResult_PingDecodeErrorZ, accessible via either
9787 * `err` or `result` depending on the state of `result_ok`.
9789 union LDKCResult_PingDecodeErrorZPtr contents;
9791 * Whether this CResult_PingDecodeErrorZ represents a success state.
9794 } LDKCResult_PingDecodeErrorZ;
9799 * A pong message to be sent or received from a peer
9801 typedef struct MUST_USE_STRUCT LDKPong {
9803 * A pointer to the opaque Rust object.
9804 * Nearly everywhere, inner must be non-null, however in places where
9805 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9807 LDKnativePong *inner;
9809 * Indicates that this is the only struct which contains the same pointer.
9810 * Rust functions which take ownership of an object provided via an argument require
9811 * this to be true and invalidate the object pointed to by inner.
9817 * The contents of CResult_PongDecodeErrorZ
9819 typedef union LDKCResult_PongDecodeErrorZPtr {
9821 * A pointer to the contents in the success state.
9822 * Reading from this pointer when `result_ok` is not set is undefined.
9824 struct LDKPong *result;
9826 * A pointer to the contents in the error state.
9827 * Reading from this pointer when `result_ok` is set is undefined.
9829 struct LDKDecodeError *err;
9830 } LDKCResult_PongDecodeErrorZPtr;
9833 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
9834 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
9835 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9837 typedef struct LDKCResult_PongDecodeErrorZ {
9839 * The contents of this CResult_PongDecodeErrorZ, accessible via either
9840 * `err` or `result` depending on the state of `result_ok`.
9842 union LDKCResult_PongDecodeErrorZPtr contents;
9844 * Whether this CResult_PongDecodeErrorZ represents a success state.
9847 } LDKCResult_PongDecodeErrorZ;
9850 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
9852 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
9854 * A pointer to the contents in the success state.
9855 * Reading from this pointer when `result_ok` is not set is undefined.
9857 struct LDKUnsignedChannelAnnouncement *result;
9859 * A pointer to the contents in the error state.
9860 * Reading from this pointer when `result_ok` is set is undefined.
9862 struct LDKDecodeError *err;
9863 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
9866 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
9867 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
9868 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9870 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
9872 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
9873 * `err` or `result` depending on the state of `result_ok`.
9875 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
9877 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
9880 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
9883 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
9885 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
9887 * A pointer to the contents in the success state.
9888 * Reading from this pointer when `result_ok` is not set is undefined.
9890 struct LDKChannelAnnouncement *result;
9892 * A pointer to the contents in the error state.
9893 * Reading from this pointer when `result_ok` is set is undefined.
9895 struct LDKDecodeError *err;
9896 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
9899 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
9900 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
9901 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9903 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
9905 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
9906 * `err` or `result` depending on the state of `result_ok`.
9908 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
9910 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
9913 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
9918 * The unsigned part of a channel_update
9920 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
9922 * A pointer to the opaque Rust object.
9923 * Nearly everywhere, inner must be non-null, however in places where
9924 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9926 LDKnativeUnsignedChannelUpdate *inner;
9928 * Indicates that this is the only struct which contains the same pointer.
9929 * Rust functions which take ownership of an object provided via an argument require
9930 * this to be true and invalidate the object pointed to by inner.
9933 } LDKUnsignedChannelUpdate;
9936 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
9938 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
9940 * A pointer to the contents in the success state.
9941 * Reading from this pointer when `result_ok` is not set is undefined.
9943 struct LDKUnsignedChannelUpdate *result;
9945 * A pointer to the contents in the error state.
9946 * Reading from this pointer when `result_ok` is set is undefined.
9948 struct LDKDecodeError *err;
9949 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
9952 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
9953 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
9954 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9956 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
9958 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
9959 * `err` or `result` depending on the state of `result_ok`.
9961 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
9963 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
9966 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
9969 * The contents of CResult_ChannelUpdateDecodeErrorZ
9971 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
9973 * A pointer to the contents in the success state.
9974 * Reading from this pointer when `result_ok` is not set is undefined.
9976 struct LDKChannelUpdate *result;
9978 * A pointer to the contents in the error state.
9979 * Reading from this pointer when `result_ok` is set is undefined.
9981 struct LDKDecodeError *err;
9982 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
9985 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
9986 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
9987 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9989 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
9991 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
9992 * `err` or `result` depending on the state of `result_ok`.
9994 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
9996 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
9999 } LDKCResult_ChannelUpdateDecodeErrorZ;
10002 * The contents of CResult_ErrorMessageDecodeErrorZ
10004 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
10006 * A pointer to the contents in the success state.
10007 * Reading from this pointer when `result_ok` is not set is undefined.
10009 struct LDKErrorMessage *result;
10011 * A pointer to the contents in the error state.
10012 * Reading from this pointer when `result_ok` is set is undefined.
10014 struct LDKDecodeError *err;
10015 } LDKCResult_ErrorMessageDecodeErrorZPtr;
10018 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
10019 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
10020 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10022 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
10024 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
10025 * `err` or `result` depending on the state of `result_ok`.
10027 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
10029 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
10032 } LDKCResult_ErrorMessageDecodeErrorZ;
10035 * The contents of CResult_WarningMessageDecodeErrorZ
10037 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
10039 * A pointer to the contents in the success state.
10040 * Reading from this pointer when `result_ok` is not set is undefined.
10042 struct LDKWarningMessage *result;
10044 * A pointer to the contents in the error state.
10045 * Reading from this pointer when `result_ok` is set is undefined.
10047 struct LDKDecodeError *err;
10048 } LDKCResult_WarningMessageDecodeErrorZPtr;
10051 * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
10052 * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
10053 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10055 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
10057 * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
10058 * `err` or `result` depending on the state of `result_ok`.
10060 union LDKCResult_WarningMessageDecodeErrorZPtr contents;
10062 * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
10065 } LDKCResult_WarningMessageDecodeErrorZ;
10070 * The unsigned part of a node_announcement
10072 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
10074 * A pointer to the opaque Rust object.
10075 * Nearly everywhere, inner must be non-null, however in places where
10076 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10078 LDKnativeUnsignedNodeAnnouncement *inner;
10080 * Indicates that this is the only struct which contains the same pointer.
10081 * Rust functions which take ownership of an object provided via an argument require
10082 * this to be true and invalidate the object pointed to by inner.
10085 } LDKUnsignedNodeAnnouncement;
10088 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
10090 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
10092 * A pointer to the contents in the success state.
10093 * Reading from this pointer when `result_ok` is not set is undefined.
10095 struct LDKUnsignedNodeAnnouncement *result;
10097 * A pointer to the contents in the error state.
10098 * Reading from this pointer when `result_ok` is set is undefined.
10100 struct LDKDecodeError *err;
10101 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
10104 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
10105 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10106 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10108 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
10110 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
10111 * `err` or `result` depending on the state of `result_ok`.
10113 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
10115 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
10118 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
10121 * The contents of CResult_NodeAnnouncementDecodeErrorZ
10123 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
10125 * A pointer to the contents in the success state.
10126 * Reading from this pointer when `result_ok` is not set is undefined.
10128 struct LDKNodeAnnouncement *result;
10130 * A pointer to the contents in the error state.
10131 * Reading from this pointer when `result_ok` is set is undefined.
10133 struct LDKDecodeError *err;
10134 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
10137 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
10138 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10139 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10141 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
10143 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
10144 * `err` or `result` depending on the state of `result_ok`.
10146 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
10148 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
10151 } LDKCResult_NodeAnnouncementDecodeErrorZ;
10154 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
10156 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
10158 * A pointer to the contents in the success state.
10159 * Reading from this pointer when `result_ok` is not set is undefined.
10161 struct LDKQueryShortChannelIds *result;
10163 * A pointer to the contents in the error state.
10164 * Reading from this pointer when `result_ok` is set is undefined.
10166 struct LDKDecodeError *err;
10167 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
10170 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
10171 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
10172 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10174 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
10176 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
10177 * `err` or `result` depending on the state of `result_ok`.
10179 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
10181 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
10184 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
10189 * A reply_short_channel_ids_end message is sent as a reply to a
10190 * query_short_channel_ids message. The query recipient makes a best
10191 * effort to respond based on their local network view which may not be
10192 * a perfect view of the network.
10194 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
10196 * A pointer to the opaque Rust object.
10197 * Nearly everywhere, inner must be non-null, however in places where
10198 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10200 LDKnativeReplyShortChannelIdsEnd *inner;
10202 * Indicates that this is the only struct which contains the same pointer.
10203 * Rust functions which take ownership of an object provided via an argument require
10204 * this to be true and invalidate the object pointed to by inner.
10207 } LDKReplyShortChannelIdsEnd;
10210 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
10212 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
10214 * A pointer to the contents in the success state.
10215 * Reading from this pointer when `result_ok` is not set is undefined.
10217 struct LDKReplyShortChannelIdsEnd *result;
10219 * A pointer to the contents in the error state.
10220 * Reading from this pointer when `result_ok` is set is undefined.
10222 struct LDKDecodeError *err;
10223 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
10226 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
10227 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
10228 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10230 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
10232 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
10233 * `err` or `result` depending on the state of `result_ok`.
10235 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
10237 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
10240 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
10243 * The contents of CResult_QueryChannelRangeDecodeErrorZ
10245 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
10247 * A pointer to the contents in the success state.
10248 * Reading from this pointer when `result_ok` is not set is undefined.
10250 struct LDKQueryChannelRange *result;
10252 * A pointer to the contents in the error state.
10253 * Reading from this pointer when `result_ok` is set is undefined.
10255 struct LDKDecodeError *err;
10256 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
10259 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
10260 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
10261 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10263 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
10265 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
10266 * `err` or `result` depending on the state of `result_ok`.
10268 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
10270 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
10273 } LDKCResult_QueryChannelRangeDecodeErrorZ;
10276 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
10278 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
10280 * A pointer to the contents in the success state.
10281 * Reading from this pointer when `result_ok` is not set is undefined.
10283 struct LDKReplyChannelRange *result;
10285 * A pointer to the contents in the error state.
10286 * Reading from this pointer when `result_ok` is set is undefined.
10288 struct LDKDecodeError *err;
10289 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
10292 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
10293 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
10294 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10296 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
10298 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
10299 * `err` or `result` depending on the state of `result_ok`.
10301 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
10303 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
10306 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
10311 * A gossip_timestamp_filter message is used by a node to request
10312 * gossip relay for messages in the requested time range when the
10313 * gossip_queries feature has been negotiated.
10315 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
10317 * A pointer to the opaque Rust object.
10318 * Nearly everywhere, inner must be non-null, however in places where
10319 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10321 LDKnativeGossipTimestampFilter *inner;
10323 * Indicates that this is the only struct which contains the same pointer.
10324 * Rust functions which take ownership of an object provided via an argument require
10325 * this to be true and invalidate the object pointed to by inner.
10328 } LDKGossipTimestampFilter;
10331 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
10333 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
10335 * A pointer to the contents in the success state.
10336 * Reading from this pointer when `result_ok` is not set is undefined.
10338 struct LDKGossipTimestampFilter *result;
10340 * A pointer to the contents in the error state.
10341 * Reading from this pointer when `result_ok` is set is undefined.
10343 struct LDKDecodeError *err;
10344 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
10347 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
10348 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
10349 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10351 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
10353 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
10354 * `err` or `result` depending on the state of `result_ok`.
10356 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
10358 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
10361 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
10364 * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
10365 * This corresponds to std::vector in C++
10367 typedef struct LDKCVec_PhantomRouteHintsZ {
10369 * The elements in the array.
10370 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10372 struct LDKPhantomRouteHints *data;
10374 * The number of elements pointed to by `data`.
10377 } LDKCVec_PhantomRouteHintsZ;
10380 * When signing using a fallible method either an user-supplied `SignError` or a `CreationError`
10383 typedef enum LDKSignOrCreationError_Tag {
10385 * An error occurred during signing
10387 LDKSignOrCreationError_SignError,
10389 * An error occurred while building the transaction
10391 LDKSignOrCreationError_CreationError,
10393 * Must be last for serialization purposes
10395 LDKSignOrCreationError_Sentinel,
10396 } LDKSignOrCreationError_Tag;
10398 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
10399 LDKSignOrCreationError_Tag tag;
10402 enum LDKCreationError creation_error;
10405 } LDKSignOrCreationError;
10408 * The contents of CResult_InvoiceSignOrCreationErrorZ
10410 typedef union LDKCResult_InvoiceSignOrCreationErrorZPtr {
10412 * A pointer to the contents in the success state.
10413 * Reading from this pointer when `result_ok` is not set is undefined.
10415 struct LDKInvoice *result;
10417 * A pointer to the contents in the error state.
10418 * Reading from this pointer when `result_ok` is set is undefined.
10420 struct LDKSignOrCreationError *err;
10421 } LDKCResult_InvoiceSignOrCreationErrorZPtr;
10424 * A CResult_InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
10425 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
10426 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10428 typedef struct LDKCResult_InvoiceSignOrCreationErrorZ {
10430 * The contents of this CResult_InvoiceSignOrCreationErrorZ, accessible via either
10431 * `err` or `result` depending on the state of `result_ok`.
10433 union LDKCResult_InvoiceSignOrCreationErrorZPtr contents;
10435 * Whether this CResult_InvoiceSignOrCreationErrorZ represents a success state.
10438 } LDKCResult_InvoiceSignOrCreationErrorZ;
10443 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
10445 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
10446 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
10447 * the return value of [`Filter::register_output`].
10449 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
10450 * may have been spent there. See [`Filter::register_output`] for details.
10452 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
10453 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
10455 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
10457 * A pointer to the opaque Rust object.
10458 * Nearly everywhere, inner must be non-null, however in places where
10459 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10461 LDKnativeWatchedOutput *inner;
10463 * Indicates that this is the only struct which contains the same pointer.
10464 * Rust functions which take ownership of an object provided via an argument require
10465 * this to be true and invalidate the object pointed to by inner.
10468 } LDKWatchedOutput;
10471 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
10474 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
10475 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
10476 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
10477 * receiving full blocks from a chain source, any further filtering is unnecessary.
10479 * After an output has been registered, subsequent block retrievals from the chain source must not
10480 * exclude any transactions matching the new criteria nor any in-block descendants of such
10483 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
10484 * should not block on I/O. Implementations should instead queue the newly monitored data to be
10485 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
10486 * invocation that has called the `Filter` must return [`TemporaryFailure`].
10488 * [`TemporaryFailure`]: ChannelMonitorUpdateErr::TemporaryFailure
10489 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
10490 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
10492 typedef struct LDKFilter {
10494 * An opaque pointer which is passed to your function implementations as an argument.
10495 * This has no meaning in the LDK, and can be NULL or any other value.
10499 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
10500 * a spending condition.
10502 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
10504 * Registers interest in spends of a transaction output.
10506 * Optionally, when `output.block_hash` is set, should return any transaction spending the
10507 * output that is found in the corresponding block along with its index.
10509 * This return value is useful for Electrum clients in order to supply in-block descendant
10510 * transactions which otherwise were not included. This is not necessary for other clients if
10511 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
10514 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
10516 * Frees any resources associated with this object given its this_arg pointer.
10517 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10519 void (*free)(void *this_arg);
10523 * An enum which can either contain a crate::lightning::chain::Filter or not
10525 typedef enum LDKCOption_FilterZ_Tag {
10527 * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
10529 LDKCOption_FilterZ_Some,
10531 * When we're in this state, this COption_FilterZ contains nothing
10533 LDKCOption_FilterZ_None,
10535 * Must be last for serialization purposes
10537 LDKCOption_FilterZ_Sentinel,
10538 } LDKCOption_FilterZ_Tag;
10540 typedef struct LDKCOption_FilterZ {
10541 LDKCOption_FilterZ_Tag tag;
10544 struct LDKFilter some;
10547 } LDKCOption_FilterZ;
10552 * A read-only reference to a current ChannelMonitor.
10554 * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
10557 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
10559 * A pointer to the opaque Rust object.
10560 * Nearly everywhere, inner must be non-null, however in places where
10561 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10563 LDKnativeLockedChannelMonitor *inner;
10565 * Indicates that this is the only struct which contains the same pointer.
10566 * Rust functions which take ownership of an object provided via an argument require
10567 * this to be true and invalidate the object pointed to by inner.
10570 } LDKLockedChannelMonitor;
10573 * The contents of CResult_LockedChannelMonitorNoneZ
10575 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
10577 * A pointer to the contents in the success state.
10578 * Reading from this pointer when `result_ok` is not set is undefined.
10580 struct LDKLockedChannelMonitor *result;
10582 * Note that this value is always NULL, as there are no contents in the Err variant
10585 } LDKCResult_LockedChannelMonitorNoneZPtr;
10588 * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
10589 * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
10590 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10592 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
10594 * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
10595 * `err` or `result` depending on the state of `result_ok`.
10597 union LDKCResult_LockedChannelMonitorNoneZPtr contents;
10599 * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
10602 } LDKCResult_LockedChannelMonitorNoneZ;
10605 * A dynamically-allocated array of crate::lightning::chain::transaction::OutPoints of arbitrary size.
10606 * This corresponds to std::vector in C++
10608 typedef struct LDKCVec_OutPointZ {
10610 * The elements in the array.
10611 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10613 struct LDKOutPoint *data;
10615 * The number of elements pointed to by `data`.
10618 } LDKCVec_OutPointZ;
10621 * A trait indicating an object may generate message send events
10623 typedef struct LDKMessageSendEventsProvider {
10625 * An opaque pointer which is passed to your function implementations as an argument.
10626 * This has no meaning in the LDK, and can be NULL or any other value.
10630 * Gets the list of pending events which were generated by previous actions, clearing the list
10633 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
10635 * Frees any resources associated with this object given its this_arg pointer.
10636 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10638 void (*free)(void *this_arg);
10639 } LDKMessageSendEventsProvider;
10642 * A trait implemented for objects handling events from [`EventsProvider`].
10644 typedef struct LDKEventHandler {
10646 * An opaque pointer which is passed to your function implementations as an argument.
10647 * This has no meaning in the LDK, and can be NULL or any other value.
10651 * Handles the given [`Event`].
10653 * See [`EventsProvider`] for details that must be considered when implementing this method.
10655 void (*handle_event)(const void *this_arg, const struct LDKEvent *NONNULL_PTR event);
10657 * Frees any resources associated with this object given its this_arg pointer.
10658 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10660 void (*free)(void *this_arg);
10664 * A trait indicating an object may generate events.
10666 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
10670 * See [`process_pending_events`] for requirements around event processing.
10672 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
10673 * event since the last invocation. The handler must either act upon the event immediately
10674 * or preserve it for later handling.
10676 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
10677 * consult the provider's documentation on the implication of processing events and how a handler
10678 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
10679 * [`ChainMonitor::process_pending_events`]).
10681 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
10684 * [`process_pending_events`]: Self::process_pending_events
10685 * [`handle_event`]: EventHandler::handle_event
10686 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
10687 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
10689 typedef struct LDKEventsProvider {
10691 * An opaque pointer which is passed to your function implementations as an argument.
10692 * This has no meaning in the LDK, and can be NULL or any other value.
10696 * Processes any events generated since the last call using the given event handler.
10698 * Subsequent calls must only process new events. However, handlers must be capable of handling
10699 * duplicate events across process restarts. This may occur if the provider was recovered from
10700 * an old state (i.e., it hadn't been successfully persisted after processing pending events).
10702 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
10704 * Frees any resources associated with this object given its this_arg pointer.
10705 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10707 void (*free)(void *this_arg);
10708 } LDKEventsProvider;
10713 * Configuration we set when applicable.
10715 * Default::default() provides sane defaults.
10717 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
10719 * A pointer to the opaque Rust object.
10720 * Nearly everywhere, inner must be non-null, however in places where
10721 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10723 LDKnativeChannelHandshakeConfig *inner;
10725 * Indicates that this is the only struct which contains the same pointer.
10726 * Rust functions which take ownership of an object provided via an argument require
10727 * this to be true and invalidate the object pointed to by inner.
10730 } LDKChannelHandshakeConfig;
10735 * Optional channel limits which are applied during channel creation.
10737 * These limits are only applied to our counterparty's limits, not our own.
10739 * Use 0/<type>::max_value() as appropriate to skip checking.
10741 * Provides sane defaults for most configurations.
10743 * Most additional limits are disabled except those with which specify a default in individual
10744 * field documentation. Note that this may result in barely-usable channels, but since they
10745 * are applied mostly only to incoming channels that's not much of a problem.
10747 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
10749 * A pointer to the opaque Rust object.
10750 * Nearly everywhere, inner must be non-null, however in places where
10751 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10753 LDKnativeChannelHandshakeLimits *inner;
10755 * Indicates that this is the only struct which contains the same pointer.
10756 * Rust functions which take ownership of an object provided via an argument require
10757 * this to be true and invalidate the object pointed to by inner.
10760 } LDKChannelHandshakeLimits;
10765 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
10767 * Default::default() provides sane defaults for most configurations
10768 * (but currently with 0 relay fees!)
10770 typedef struct MUST_USE_STRUCT LDKUserConfig {
10772 * A pointer to the opaque Rust object.
10773 * Nearly everywhere, inner must be non-null, however in places where
10774 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10776 LDKnativeUserConfig *inner;
10778 * Indicates that this is the only struct which contains the same pointer.
10779 * Rust functions which take ownership of an object provided via an argument require
10780 * this to be true and invalidate the object pointed to by inner.
10788 * The best known block as identified by its hash and height.
10790 typedef struct MUST_USE_STRUCT LDKBestBlock {
10792 * A pointer to the opaque Rust object.
10793 * Nearly everywhere, inner must be non-null, however in places where
10794 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10796 LDKnativeBestBlock *inner;
10798 * Indicates that this is the only struct which contains the same pointer.
10799 * Rust functions which take ownership of an object provided via an argument require
10800 * this to be true and invalidate the object pointed to by inner.
10806 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
10809 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
10810 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
10811 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
10814 typedef struct LDKListen {
10816 * An opaque pointer which is passed to your function implementations as an argument.
10817 * This has no meaning in the LDK, and can be NULL or any other value.
10821 * Notifies the listener that a block was added at the given height.
10823 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
10825 * Notifies the listener that a block was removed at the given height.
10827 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
10829 * Frees any resources associated with this object given its this_arg pointer.
10830 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10832 void (*free)(void *this_arg);
10836 * The `Confirm` trait is used to notify when transactions have been confirmed on chain or
10837 * unconfirmed during a chain reorganization.
10839 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
10840 * [`Listen`]. For instance, an Electrum client may implement [`Filter`] by subscribing to activity
10841 * related to registered transactions and outputs. Upon notification, it would pass along the
10842 * matching transactions using this interface.
10846 * The intended use is as follows:
10847 * - Call [`transactions_confirmed`] to process any on-chain activity of interest.
10848 * - Call [`transaction_unconfirmed`] to process any transaction returned by [`get_relevant_txids`]
10849 * that has been reorganized out of the chain.
10850 * - Call [`best_block_updated`] whenever a new chain tip becomes available.
10854 * Clients must call these methods in chain order. Specifically:
10855 * - Transactions confirmed in a block must be given before transactions confirmed in a later
10857 * - Dependent transactions within the same block must be given in topological order, possibly in
10859 * - Unconfirmed transactions must be given after the original confirmations and before any
10862 * See individual method documentation for further details.
10864 * [`transactions_confirmed`]: Self::transactions_confirmed
10865 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
10866 * [`best_block_updated`]: Self::best_block_updated
10867 * [`get_relevant_txids`]: Self::get_relevant_txids
10869 typedef struct LDKConfirm {
10871 * An opaque pointer which is passed to your function implementations as an argument.
10872 * This has no meaning in the LDK, and can be NULL or any other value.
10876 * Processes transactions confirmed in a block with a given header and height.
10878 * Should be called for any transactions registered by [`Filter::register_tx`] or any
10879 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
10880 * appearing in the same block do not need to be included in the same call; instead, multiple
10881 * calls with additional transactions may be made so long as they are made in [chain order].
10883 * May be called before or after [`best_block_updated`] for the corresponding block. However,
10884 * in the event of a chain reorganization, it must not be called with a `header` that is no
10885 * longer in the chain as of the last call to [`best_block_updated`].
10887 * [chain order]: Confirm#Order
10888 * [`best_block_updated`]: Self::best_block_updated
10890 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
10892 * Processes a transaction that is no longer confirmed as result of a chain reorganization.
10894 * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
10895 * reorganized out of the best chain. Once called, the given transaction should not be returned
10896 * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`].
10898 * [`get_relevant_txids`]: Self::get_relevant_txids
10899 * [`transactions_confirmed`]: Self::transactions_confirmed
10901 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
10903 * Processes an update to the best header connected at the given height.
10905 * Should be called when a new header is available but may be skipped for intermediary blocks
10906 * if they become available at the same time.
10908 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
10910 * Returns transactions that should be monitored for reorganization out of the chain.
10912 * Should include any transactions passed to [`transactions_confirmed`] that have insufficient
10913 * confirmations to be safe from a chain reorganization. Should not include any transactions
10914 * passed to [`transaction_unconfirmed`] unless later reconfirmed.
10916 * May be called to determine the subset of transactions that must still be monitored for
10917 * reorganization. Will be idempotent between calls but may change as a result of calls to the
10918 * other interface methods. Thus, this is useful to determine which transactions may need to be
10919 * given to [`transaction_unconfirmed`].
10921 * [`transactions_confirmed`]: Self::transactions_confirmed
10922 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
10924 struct LDKCVec_TxidZ (*get_relevant_txids)(const void *this_arg);
10926 * Frees any resources associated with this object given its this_arg pointer.
10927 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10929 void (*free)(void *this_arg);
10935 * An opaque identifier describing a specific [`Persist`] method call.
10937 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
10939 * A pointer to the opaque Rust object.
10940 * Nearly everywhere, inner must be non-null, however in places where
10941 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10943 LDKnativeMonitorUpdateId *inner;
10945 * Indicates that this is the only struct which contains the same pointer.
10946 * Rust functions which take ownership of an object provided via an argument require
10947 * this to be true and invalidate the object pointed to by inner.
10950 } LDKMonitorUpdateId;
10953 * `Persist` defines behavior for persisting channel monitors: this could mean
10954 * writing once to disk, and/or uploading to one or more backup services.
10956 * Each method can return three possible values:
10957 * * If persistence (including any relevant `fsync()` calls) happens immediately, the
10958 * implementation should return `Ok(())`, indicating normal channel operation should continue.
10959 * * If persistence happens asynchronously, implementations should first ensure the
10960 * [`ChannelMonitor`] or [`ChannelMonitorUpdate`] are written durably to disk, and then return
10961 * `Err(ChannelMonitorUpdateErr::TemporaryFailure)` while the update continues in the
10962 * background. Once the update completes, [`ChainMonitor::channel_monitor_updated`] should be
10963 * called with the corresponding [`MonitorUpdateId`].
10965 * Note that unlike the direct [`chain::Watch`] interface,
10966 * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
10968 * * If persistence fails for some reason, implementations should return
10969 * `Err(ChannelMonitorUpdateErr::PermanentFailure)`, in which case the channel will likely be
10970 * closed without broadcasting the latest state. See
10971 * [`ChannelMonitorUpdateErr::PermanentFailure`] for more details.
10973 typedef struct LDKPersist {
10975 * An opaque pointer which is passed to your function implementations as an argument.
10976 * This has no meaning in the LDK, and can be NULL or any other value.
10980 * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
10981 * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
10983 * The data can be stored any way you want, but the identifier provided by LDK is the
10984 * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
10985 * and the stored channel data). Note that you **must** persist every new monitor to disk.
10987 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
10988 * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
10990 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
10991 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
10993 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
10994 * [`Writeable::write`]: crate::util::ser::Writeable::write
10996 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
10998 * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
11001 * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
11002 * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
11005 * During blockchain synchronization operations, this may be called with no
11006 * [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
11007 * Note that after the full [`ChannelMonitor`] is persisted any previous
11008 * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
11009 * applied to the persisted [`ChannelMonitor`] as they were already applied.
11011 * If an implementer chooses to persist the updates only, they need to make
11012 * sure that all the updates are applied to the `ChannelMonitors` *before*
11013 * the set of channel monitors is given to the `ChannelManager`
11014 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
11015 * applying a monitor update to a monitor. If full `ChannelMonitors` are
11016 * persisted, then there is no need to persist individual updates.
11018 * Note that there could be a performance tradeoff between persisting complete
11019 * channel monitors on every update vs. persisting only updates and applying
11020 * them in batches. The size of each monitor grows `O(number of state updates)`
11021 * whereas updates are small and `O(1)`.
11023 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
11024 * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
11026 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
11027 * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
11028 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
11030 * [`Writeable::write`]: crate::util::ser::Writeable::write
11032 * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
11034 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);
11036 * Frees any resources associated with this object given its this_arg pointer.
11037 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11039 void (*free)(void *this_arg);
11045 * An implementation of [`chain::Watch`] for monitoring channels.
11047 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
11048 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
11049 * or used independently to monitor channels remotely. See the [module-level documentation] for
11052 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11053 * [module-level documentation]: crate::chain::chainmonitor
11055 typedef struct MUST_USE_STRUCT LDKChainMonitor {
11057 * A pointer to the opaque Rust object.
11058 * Nearly everywhere, inner must be non-null, however in places where
11059 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11061 LDKnativeChainMonitor *inner;
11063 * Indicates that this is the only struct which contains the same pointer.
11064 * Rust functions which take ownership of an object provided via an argument require
11065 * this to be true and invalidate the object pointed to by inner.
11073 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
11074 * and derives keys from that.
11076 * Your node_id is seed/0'
11077 * ChannelMonitor closes may use seed/1'
11078 * Cooperative closes may use seed/2'
11079 * The two close keys may be needed to claim on-chain funds!
11081 * This struct cannot be used for nodes that wish to support receiving phantom payments;
11082 * [`PhantomKeysManager`] must be used instead.
11084 * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
11085 * previously issued invoices and attempts to pay previous invoices will fail.
11087 typedef struct MUST_USE_STRUCT LDKKeysManager {
11089 * A pointer to the opaque Rust object.
11090 * Nearly everywhere, inner must be non-null, however in places where
11091 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11093 LDKnativeKeysManager *inner;
11095 * Indicates that this is the only struct which contains the same pointer.
11096 * Rust functions which take ownership of an object provided via an argument require
11097 * this to be true and invalidate the object pointed to by inner.
11105 * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
11108 * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
11109 * paid to one of multiple nodes. This works because we encode the invoice route hints such that
11110 * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
11111 * itself without ever needing to forward to this fake node.
11113 * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
11114 * provide some fault tolerance, because payers will automatically retry paying other provided
11115 * nodes in the case that one node goes down.
11117 * Note that multi-path payments are not supported in phantom invoices for security reasons.
11118 * Switching between this struct and [`KeysManager`] will invalidate any previously issued
11119 * invoices and attempts to pay previous invoices will fail.
11121 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
11123 * A pointer to the opaque Rust object.
11124 * Nearly everywhere, inner must be non-null, however in places where
11125 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11127 LDKnativePhantomKeysManager *inner;
11129 * Indicates that this is the only struct which contains the same pointer.
11130 * Rust functions which take ownership of an object provided via an argument require
11131 * this to be true and invalidate the object pointed to by inner.
11134 } LDKPhantomKeysManager;
11139 * Chain-related parameters used to construct a new `ChannelManager`.
11141 * Typically, the block-specific parameters are derived from the best block hash for the network,
11142 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
11143 * are not needed when deserializing a previously constructed `ChannelManager`.
11145 typedef struct MUST_USE_STRUCT LDKChainParameters {
11147 * A pointer to the opaque Rust object.
11148 * Nearly everywhere, inner must be non-null, however in places where
11149 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11151 LDKnativeChainParameters *inner;
11153 * Indicates that this is the only struct which contains the same pointer.
11154 * Rust functions which take ownership of an object provided via an argument require
11155 * this to be true and invalidate the object pointed to by inner.
11158 } LDKChainParameters;
11161 * A 3-byte byte array.
11163 typedef struct LDKThreeBytes {
11171 * A trait to describe an object which can receive channel messages.
11173 * Messages MAY be called in parallel when they originate from different their_node_ids, however
11174 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
11176 typedef struct LDKChannelMessageHandler {
11178 * An opaque pointer which is passed to your function implementations as an argument.
11179 * This has no meaning in the LDK, and can be NULL or any other value.
11183 * Handle an incoming open_channel message from the given peer.
11185 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
11187 * Handle an incoming accept_channel message from the given peer.
11189 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
11191 * Handle an incoming funding_created message from the given peer.
11193 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
11195 * Handle an incoming funding_signed message from the given peer.
11197 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
11199 * Handle an incoming funding_locked message from the given peer.
11201 void (*handle_funding_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg);
11203 * Handle an incoming shutdown message from the given peer.
11205 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);
11207 * Handle an incoming closing_signed message from the given peer.
11209 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
11211 * Handle an incoming update_add_htlc message from the given peer.
11213 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
11215 * Handle an incoming update_fulfill_htlc message from the given peer.
11217 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
11219 * Handle an incoming update_fail_htlc message from the given peer.
11221 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
11223 * Handle an incoming update_fail_malformed_htlc message from the given peer.
11225 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
11227 * Handle an incoming commitment_signed message from the given peer.
11229 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
11231 * Handle an incoming revoke_and_ack message from the given peer.
11233 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
11235 * Handle an incoming update_fee message from the given peer.
11237 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
11239 * Handle an incoming announcement_signatures message from the given peer.
11241 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
11243 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
11244 * is believed to be possible in the future (eg they're sending us messages we don't
11245 * understand or indicate they require unknown feature bits), no_connection_possible is set
11246 * and any outstanding channels should be failed.
11248 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
11250 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
11252 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
11254 * Handle an incoming channel_reestablish message from the given peer.
11256 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
11258 * Handle an incoming channel update from the given peer.
11260 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
11262 * Handle an incoming error message from the given peer.
11264 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
11266 * Implementation of MessageSendEventsProvider for this object.
11268 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
11270 * Frees any resources associated with this object given its this_arg pointer.
11271 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11273 void (*free)(void *this_arg);
11274 } LDKChannelMessageHandler;
11279 * Arguments for the creation of a ChannelManager that are not deserialized.
11281 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
11283 * 1) Deserialize all stored [`ChannelMonitor`]s.
11284 * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
11285 * `<(BlockHash, ChannelManager)>::read(reader, args)`
11286 * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
11287 * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
11288 * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
11289 * same way you would handle a [`chain::Filter`] call using
11290 * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
11291 * 4) Reconnect blocks on your [`ChannelMonitor`]s.
11292 * 5) Disconnect/connect blocks on the [`ChannelManager`].
11293 * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
11294 * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
11295 * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
11297 * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
11298 * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
11300 * Note that the ordering of #4-7 is not of importance, however all four must occur before you
11301 * call any other methods on the newly-deserialized [`ChannelManager`].
11303 * Note that because some channels may be closed during deserialization, it is critical that you
11304 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
11305 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
11306 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
11307 * not force-close the same channels but consider them live), you may end up revoking a state for
11308 * which you've already broadcasted the transaction.
11310 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
11312 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
11314 * A pointer to the opaque Rust object.
11315 * Nearly everywhere, inner must be non-null, however in places where
11316 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11318 LDKnativeChannelManagerReadArgs *inner;
11320 * Indicates that this is the only struct which contains the same pointer.
11321 * Rust functions which take ownership of an object provided via an argument require
11322 * this to be true and invalidate the object pointed to by inner.
11325 } LDKChannelManagerReadArgs;
11330 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
11331 * This is used to convince the recipient that the channel is at a certain commitment
11332 * number even if they lost that data due to a local failure. Of course, the peer may lie
11333 * and even later commitments may have been revoked.
11335 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
11337 * A pointer to the opaque Rust object.
11338 * Nearly everywhere, inner must be non-null, however in places where
11339 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11341 LDKnativeDataLossProtect *inner;
11343 * Indicates that this is the only struct which contains the same pointer.
11344 * Rust functions which take ownership of an object provided via an argument require
11345 * this to be true and invalidate the object pointed to by inner.
11348 } LDKDataLossProtect;
11351 * A trait to describe an object which can receive routing messages.
11353 * # Implementor DoS Warnings
11355 * For `gossip_queries` messages there are potential DoS vectors when handling
11356 * inbound queries. Implementors using an on-disk network graph should be aware of
11357 * repeated disk I/O for queries accessing different parts of the network graph.
11359 typedef struct LDKRoutingMessageHandler {
11361 * An opaque pointer which is passed to your function implementations as an argument.
11362 * This has no meaning in the LDK, and can be NULL or any other value.
11366 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
11367 * false or returning an Err otherwise.
11369 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
11371 * Handle a channel_announcement message, returning true if it should be forwarded on, false
11372 * or returning an Err otherwise.
11374 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
11376 * Handle an incoming channel_update message, returning true if it should be forwarded on,
11377 * false or returning an Err otherwise.
11379 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
11381 * Gets a subset of the channel announcements and updates required to dump our routing table
11382 * to a remote node, starting at the short_channel_id indicated by starting_point and
11383 * including the batch_amount entries immediately higher in numerical value than starting_point.
11385 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
11387 * Gets a subset of the node announcements required to dump our routing table to a remote node,
11388 * starting at the node *after* the provided publickey and including batch_amount entries
11389 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
11390 * If None is provided for starting_point, we start at the first node.
11392 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
11394 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
11396 * Called when a connection is established with a peer. This can be used to
11397 * perform routing table synchronization using a strategy defined by the
11400 void (*sync_routing_table)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
11402 * Handles the reply of a query we initiated to learn about channels
11403 * for a given range of blocks. We can expect to receive one or more
11404 * replies to a single query.
11406 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
11408 * Handles the reply of a query we initiated asking for routing gossip
11409 * messages for a list of channels. We should receive this message when
11410 * a node has completed its best effort to send us the pertaining routing
11413 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
11415 * Handles when a peer asks us to send a list of short_channel_ids
11416 * for the requested range of blocks.
11418 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
11420 * Handles when a peer asks us to send routing gossip messages for a
11421 * list of short_channel_ids.
11423 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
11425 * Implementation of MessageSendEventsProvider for this object.
11427 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
11429 * Frees any resources associated with this object given its this_arg pointer.
11430 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11432 void (*free)(void *this_arg);
11433 } LDKRoutingMessageHandler;
11436 * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
11439 typedef struct LDKCustomMessageReader {
11441 * An opaque pointer which is passed to your function implementations as an argument.
11442 * This has no meaning in the LDK, and can be NULL or any other value.
11446 * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
11447 * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
11448 * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
11449 * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
11451 struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
11453 * Frees any resources associated with this object given its this_arg pointer.
11454 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11456 void (*free)(void *this_arg);
11457 } LDKCustomMessageReader;
11460 * Handler for BOLT1-compliant messages.
11462 typedef struct LDKCustomMessageHandler {
11464 * An opaque pointer which is passed to your function implementations as an argument.
11465 * This has no meaning in the LDK, and can be NULL or any other value.
11469 * Called with the message type that was received and the buffer to be read.
11470 * Can return a `MessageHandlingError` if the message could not be handled.
11472 struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
11474 * Gets the list of pending messages which were generated by the custom message
11475 * handler, clearing the list in the process. The first tuple element must
11476 * correspond to the intended recipients node ids. If no connection to one of the
11477 * specified node does not exist, the message is simply not sent to it.
11479 struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
11481 * Implementation of CustomMessageReader for this object.
11483 struct LDKCustomMessageReader CustomMessageReader;
11485 * Frees any resources associated with this object given its this_arg pointer.
11486 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11488 void (*free)(void *this_arg);
11489 } LDKCustomMessageHandler;
11494 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
11495 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
11497 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
11499 * A pointer to the opaque Rust object.
11500 * Nearly everywhere, inner must be non-null, however in places where
11501 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11503 LDKnativeIgnoringMessageHandler *inner;
11505 * Indicates that this is the only struct which contains the same pointer.
11506 * Rust functions which take ownership of an object provided via an argument require
11507 * this to be true and invalidate the object pointed to by inner.
11510 } LDKIgnoringMessageHandler;
11515 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
11516 * You can provide one of these as the route_handler in a MessageHandler.
11518 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
11520 * A pointer to the opaque Rust object.
11521 * Nearly everywhere, inner must be non-null, however in places where
11522 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11524 LDKnativeErroringMessageHandler *inner;
11526 * Indicates that this is the only struct which contains the same pointer.
11527 * Rust functions which take ownership of an object provided via an argument require
11528 * this to be true and invalidate the object pointed to by inner.
11531 } LDKErroringMessageHandler;
11536 * Provides references to trait impls which handle different types of messages.
11538 typedef struct MUST_USE_STRUCT LDKMessageHandler {
11540 * A pointer to the opaque Rust object.
11541 * Nearly everywhere, inner must be non-null, however in places where
11542 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11544 LDKnativeMessageHandler *inner;
11546 * Indicates that this is the only struct which contains the same pointer.
11547 * Rust functions which take ownership of an object provided via an argument require
11548 * this to be true and invalidate the object pointed to by inner.
11551 } LDKMessageHandler;
11554 * Provides an object which can be used to send data to and which uniquely identifies a connection
11555 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
11556 * implement Hash to meet the PeerManager API.
11558 * For efficiency, Clone should be relatively cheap for this type.
11560 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
11561 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
11562 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
11563 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
11564 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
11565 * to simply use another value which is guaranteed to be globally unique instead.
11567 typedef struct LDKSocketDescriptor {
11569 * An opaque pointer which is passed to your function implementations as an argument.
11570 * This has no meaning in the LDK, and can be NULL or any other value.
11574 * Attempts to send some data from the given slice to the peer.
11576 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
11577 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
11578 * called and further write attempts may occur until that time.
11580 * If the returned size is smaller than `data.len()`, a
11581 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
11582 * written. Additionally, until a `send_data` event completes fully, no further
11583 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
11584 * prevent denial-of-service issues, you should not read or buffer any data from the socket
11587 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
11588 * (indicating that read events should be paused to prevent DoS in the send buffer),
11589 * `resume_read` may be set indicating that read events on this descriptor should resume. A
11590 * `resume_read` of false carries no meaning, and should not cause any action.
11592 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
11594 * Disconnect the socket pointed to by this SocketDescriptor.
11596 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
11597 * call (doing so is a noop).
11599 void (*disconnect_socket)(void *this_arg);
11601 * Checks if two objects are equal given this object's this_arg pointer and another object.
11603 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
11605 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
11606 * This is used, for example, for inclusion of this object in a hash map.
11608 uint64_t (*hash)(const void *this_arg);
11610 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
11611 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
11612 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
11614 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
11616 * Frees any resources associated with this object given its this_arg pointer.
11617 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11619 void (*free)(void *this_arg);
11620 } LDKSocketDescriptor;
11625 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
11626 * socket events into messages which it passes on to its [`MessageHandler`].
11628 * Locks are taken internally, so you must never assume that reentrancy from a
11629 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
11631 * Calls to [`read_event`] will decode relevant messages and pass them to the
11632 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
11633 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
11634 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
11635 * calls only after previous ones have returned.
11637 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
11638 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
11639 * essentially you should default to using a SimpleRefPeerManager, and use a
11640 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
11641 * you're using lightning-net-tokio.
11643 * [`read_event`]: PeerManager::read_event
11645 typedef struct MUST_USE_STRUCT LDKPeerManager {
11647 * A pointer to the opaque Rust object.
11648 * Nearly everywhere, inner must be non-null, however in places where
11649 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11651 LDKnativePeerManager *inner;
11653 * Indicates that this is the only struct which contains the same pointer.
11654 * Rust functions which take ownership of an object provided via an argument require
11655 * this to be true and invalidate the object pointed to by inner.
11663 * Static channel fields used to build transactions given per-commitment fields, organized by
11664 * broadcaster/countersignatory.
11666 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
11667 * as_holder_broadcastable and as_counterparty_broadcastable functions.
11669 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
11671 * A pointer to the opaque Rust object.
11672 * Nearly everywhere, inner must be non-null, however in places where
11673 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11675 LDKnativeDirectedChannelTransactionParameters *inner;
11677 * Indicates that this is the only struct which contains the same pointer.
11678 * Rust functions which take ownership of an object provided via an argument require
11679 * this to be true and invalidate the object pointed to by inner.
11682 } LDKDirectedChannelTransactionParameters;
11687 * A read-only view of [`NetworkGraph`].
11689 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
11691 * A pointer to the opaque Rust object.
11692 * Nearly everywhere, inner must be non-null, however in places where
11693 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11695 LDKnativeReadOnlyNetworkGraph *inner;
11697 * Indicates that this is the only struct which contains the same pointer.
11698 * Rust functions which take ownership of an object provided via an argument require
11699 * this to be true and invalidate the object pointed to by inner.
11702 } LDKReadOnlyNetworkGraph;
11707 * Receives and validates network updates from peers,
11708 * stores authentic and relevant data as a network graph.
11709 * This network graph is then used for routing payments.
11710 * Provides interface to help with initial routing sync by
11711 * serving historical announcements.
11713 * Serves as an [`EventHandler`] for applying updates from [`Event::PaymentPathFailed`] to the
11714 * [`NetworkGraph`].
11716 typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
11718 * A pointer to the opaque Rust object.
11719 * Nearly everywhere, inner must be non-null, however in places where
11720 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11722 LDKnativeNetGraphMsgHandler *inner;
11724 * Indicates that this is the only struct which contains the same pointer.
11725 * Rust functions which take ownership of an object provided via an argument require
11726 * this to be true and invalidate the object pointed to by inner.
11729 } LDKNetGraphMsgHandler;
11734 * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
11735 * source node to a target node.
11737 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
11739 * A pointer to the opaque Rust object.
11740 * Nearly everywhere, inner must be non-null, however in places where
11741 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11743 LDKnativeDirectedChannelInfo *inner;
11745 * Indicates that this is the only struct which contains the same pointer.
11746 * Rust functions which take ownership of an object provided via an argument require
11747 * this to be true and invalidate the object pointed to by inner.
11750 } LDKDirectedChannelInfo;
11753 * The effective capacity of a channel for routing purposes.
11755 * While this may be smaller than the actual channel capacity, amounts greater than
11756 * [`Self::as_msat`] should not be routed through the channel.
11758 typedef enum LDKEffectiveCapacity_Tag {
11760 * The available liquidity in the channel known from being a channel counterparty, and thus a
11763 LDKEffectiveCapacity_ExactLiquidity,
11765 * The maximum HTLC amount in one direction as advertised on the gossip network.
11767 LDKEffectiveCapacity_MaximumHTLC,
11769 * The total capacity of the channel as determined by the funding transaction.
11771 LDKEffectiveCapacity_Total,
11773 * A capacity sufficient to route any payment, typically used for private channels provided by
11776 LDKEffectiveCapacity_Infinite,
11778 * A capacity that is unknown possibly because either the chain state is unavailable to know
11779 * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
11781 LDKEffectiveCapacity_Unknown,
11783 * Must be last for serialization purposes
11785 LDKEffectiveCapacity_Sentinel,
11786 } LDKEffectiveCapacity_Tag;
11788 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
11790 * Either the inbound or outbound liquidity depending on the direction, denominated in
11793 uint64_t liquidity_msat;
11794 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
11796 typedef struct LDKEffectiveCapacity_LDKMaximumHTLC_Body {
11798 * The maximum HTLC amount denominated in millisatoshi.
11800 uint64_t amount_msat;
11801 } LDKEffectiveCapacity_LDKMaximumHTLC_Body;
11803 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
11805 * The funding amount denominated in millisatoshi.
11807 uint64_t capacity_msat;
11808 } LDKEffectiveCapacity_LDKTotal_Body;
11810 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
11811 LDKEffectiveCapacity_Tag tag;
11813 LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
11814 LDKEffectiveCapacity_LDKMaximumHTLC_Body maximum_htlc;
11815 LDKEffectiveCapacity_LDKTotal_Body total;
11817 } LDKEffectiveCapacity;
11820 * An interface used to score payment channels for path finding.
11822 *\tScoring is in terms of fees willing to be paid in order to avoid routing through a channel.
11824 typedef struct LDKScore {
11826 * An opaque pointer which is passed to your function implementations as an argument.
11827 * This has no meaning in the LDK, and can be NULL or any other value.
11831 * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
11832 * given channel in the direction from `source` to `target`.
11834 * The channel's capacity (less any other MPP parts that are also being considered for use in
11835 * the same payment) is given by `capacity_msat`. It may be determined from various sources
11836 * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
11837 * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
11838 * Thus, implementations should be overflow-safe.
11840 uint64_t (*channel_penalty_msat)(const void *this_arg, uint64_t short_channel_id, uint64_t send_amt_msat, uint64_t capacity_msat, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target);
11842 * Handles updating channel penalties after failing to route through a channel.
11844 void (*payment_path_failed)(void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
11846 * Handles updating channel penalties after successfully routing along a path.
11848 void (*payment_path_successful)(void *this_arg, struct LDKCVec_RouteHopZ path);
11850 * Serialize the object into a byte array
11852 struct LDKCVec_u8Z (*write)(const void *this_arg);
11854 * Frees any resources associated with this object given its this_arg pointer.
11855 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11857 void (*free)(void *this_arg);
11861 * A scorer that is accessed under a lock.
11863 * Needed so that calls to [`Score::channel_penalty_msat`] in [`find_route`] can be made while
11864 * having shared ownership of a scorer but without requiring internal locking in [`Score`]
11865 * implementations. Internal locking would be detrimental to route finding performance and could
11866 * result in [`Score::channel_penalty_msat`] returning a different value for the same channel.
11868 * [`find_route`]: crate::routing::router::find_route
11870 typedef struct LDKLockableScore {
11872 * An opaque pointer which is passed to your function implementations as an argument.
11873 * This has no meaning in the LDK, and can be NULL or any other value.
11877 * Returns the locked scorer.
11879 struct LDKScore (*lock)(const void *this_arg);
11881 * Frees any resources associated with this object given its this_arg pointer.
11882 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11884 void (*free)(void *this_arg);
11885 } LDKLockableScore;
11890 * A concrete implementation of [`LockableScore`] which supports multi-threading.
11892 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
11894 * A pointer to the opaque Rust object.
11895 * Nearly everywhere, inner must be non-null, however in places where
11896 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11898 LDKnativeMultiThreadedLockableScore *inner;
11900 * Indicates that this is the only struct which contains the same pointer.
11901 * Rust functions which take ownership of an object provided via an argument require
11902 * this to be true and invalidate the object pointed to by inner.
11905 } LDKMultiThreadedLockableScore;
11910 * FilesystemPersister persists channel data on disk, where each channel's
11911 * data is stored in a file named after its funding outpoint.
11913 * Warning: this module does the best it can with calls to persist data, but it
11914 * can only guarantee that the data is passed to the drive. It is up to the
11915 * drive manufacturers to do the actual persistence properly, which they often
11916 * don't (especially on consumer-grade hardware). Therefore, it is up to the
11917 * user to validate their entire storage stack, to ensure the writes are
11919 * Corollary: especially when dealing with larger amounts of money, it is best
11920 * practice to have multiple channel data backups and not rely only on one
11921 * FilesystemPersister.
11923 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
11925 * A pointer to the opaque Rust object.
11926 * Nearly everywhere, inner must be non-null, however in places where
11927 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11929 LDKnativeFilesystemPersister *inner;
11931 * Indicates that this is the only struct which contains the same pointer.
11932 * Rust functions which take ownership of an object provided via an argument require
11933 * this to be true and invalidate the object pointed to by inner.
11936 } LDKFilesystemPersister;
11941 * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
11942 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
11943 * responsibilities are:
11944 * * Processing [`Event`]s with a user-provided [`EventHandler`].
11945 * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
11946 * writing it to disk/backups by invoking the callback given to it at startup.
11947 * [`ChannelManager`] persistence should be done in the background.
11948 * * Calling [`ChannelManager::timer_tick_occurred`] and [`PeerManager::timer_tick_occurred`]
11949 * at the appropriate intervals.
11950 * * Calling [`NetworkGraph::remove_stale_channels`] (if a [`NetGraphMsgHandler`] is provided to
11951 * [`BackgroundProcessor::start`]).
11953 * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
11954 * upon as doing so may result in high latency.
11958 * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
11959 * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
11960 * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
11961 * unilateral chain closure fees are at risk.
11963 * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
11964 * [`Event`]: lightning::util::events::Event
11965 *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
11967 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
11969 * A pointer to the opaque Rust object.
11970 * Nearly everywhere, inner must be non-null, however in places where
11971 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11973 LDKnativeBackgroundProcessor *inner;
11975 * Indicates that this is the only struct which contains the same pointer.
11976 * Rust functions which take ownership of an object provided via an argument require
11977 * this to be true and invalidate the object pointed to by inner.
11980 } LDKBackgroundProcessor;
11983 * Trait which handles persisting a [`ChannelManager`] to disk.
11985 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
11987 typedef struct LDKChannelManagerPersister {
11989 * An opaque pointer which is passed to your function implementations as an argument.
11990 * This has no meaning in the LDK, and can be NULL or any other value.
11994 * Persist the given [`ChannelManager`] to disk, returning an error if persistence failed
11995 * (which will cause the [`BackgroundProcessor`] which called this method to exit.
11997 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
11999 struct LDKCResult_NoneErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
12001 * Frees any resources associated with this object given its this_arg pointer.
12002 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12004 void (*free)(void *this_arg);
12005 } LDKChannelManagerPersister;
12010 * Data of the `RawInvoice` that is encoded in the data part
12012 typedef struct MUST_USE_STRUCT LDKRawDataPart {
12014 * A pointer to the opaque Rust object.
12015 * Nearly everywhere, inner must be non-null, however in places where
12016 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12018 LDKnativeRawDataPart *inner;
12020 * Indicates that this is the only struct which contains the same pointer.
12021 * Rust functions which take ownership of an object provided via an argument require
12022 * this to be true and invalidate the object pointed to by inner.
12032 typedef struct MUST_USE_STRUCT LDKSha256 {
12034 * A pointer to the opaque Rust object.
12035 * Nearly everywhere, inner must be non-null, however in places where
12036 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12038 LDKnativeSha256 *inner;
12040 * Indicates that this is the only struct which contains the same pointer.
12041 * Rust functions which take ownership of an object provided via an argument require
12042 * this to be true and invalidate the object pointed to by inner.
12050 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
12053 typedef struct MUST_USE_STRUCT LDKExpiryTime {
12055 * A pointer to the opaque Rust object.
12056 * Nearly everywhere, inner must be non-null, however in places where
12057 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12059 LDKnativeExpiryTime *inner;
12061 * Indicates that this is the only struct which contains the same pointer.
12062 * Rust functions which take ownership of an object provided via an argument require
12063 * this to be true and invalidate the object pointed to by inner.
12071 * `min_final_cltv_expiry` to use for the last HTLC in the route
12073 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiry {
12075 * A pointer to the opaque Rust object.
12076 * Nearly everywhere, inner must be non-null, however in places where
12077 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12079 LDKnativeMinFinalCltvExpiry *inner;
12081 * Indicates that this is the only struct which contains the same pointer.
12082 * Rust functions which take ownership of an object provided via an argument require
12083 * this to be true and invalidate the object pointed to by inner.
12086 } LDKMinFinalCltvExpiry;
12089 * A 20-byte byte array.
12091 typedef struct LDKTwentyBytes {
12099 * Fallback address in case no LN payment is possible
12101 typedef enum LDKFallback_Tag {
12102 LDKFallback_SegWitProgram,
12103 LDKFallback_PubKeyHash,
12104 LDKFallback_ScriptHash,
12106 * Must be last for serialization purposes
12108 LDKFallback_Sentinel,
12111 typedef struct LDKFallback_LDKSegWitProgram_Body {
12112 struct LDKu5 version;
12113 struct LDKCVec_u8Z program;
12114 } LDKFallback_LDKSegWitProgram_Body;
12116 typedef struct MUST_USE_STRUCT LDKFallback {
12117 LDKFallback_Tag tag;
12119 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
12121 struct LDKTwentyBytes pub_key_hash;
12124 struct LDKTwentyBytes script_hash;
12130 * A trait defining behavior of an [`Invoice`] payer.
12132 typedef struct LDKPayer {
12134 * An opaque pointer which is passed to your function implementations as an argument.
12135 * This has no meaning in the LDK, and can be NULL or any other value.
12139 * Returns the payer's node id.
12141 struct LDKPublicKey (*node_id)(const void *this_arg);
12143 * Returns the payer's channels.
12145 struct LDKCVec_ChannelDetailsZ (*first_hops)(const void *this_arg);
12147 * Sends a payment over the Lightning Network using the given [`Route`].
12149 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
12151 struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
12153 * Sends a spontaneous payment over the Lightning Network using the given [`Route`].
12155 struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_spontaneous_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage);
12157 * Retries a failed payment path for the [`PaymentId`] using the given [`Route`].
12159 struct LDKCResult_NonePaymentSendFailureZ (*retry_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id);
12161 * Signals that no further retries for the given payment will occur.
12163 void (*abandon_payment)(const void *this_arg, struct LDKThirtyTwoBytes payment_id);
12165 * Frees any resources associated with this object given its this_arg pointer.
12166 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12168 void (*free)(void *this_arg);
12172 * A trait defining behavior for routing an [`Invoice`] payment.
12174 typedef struct LDKRouter {
12176 * An opaque pointer which is passed to your function implementations as an argument.
12177 * This has no meaning in the LDK, and can be NULL or any other value.
12181 * Finds a [`Route`] between `payer` and `payee` for a payment with the given values.
12183 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
12185 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, const struct LDKScore *NONNULL_PTR scorer);
12187 * Frees any resources associated with this object given its this_arg pointer.
12188 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12190 void (*free)(void *this_arg);
12196 * A utility for paying [`Invoice`]s and sending spontaneous payments.
12198 * See [module-level documentation] for details.
12200 * [module-level documentation]: crate::payment
12202 typedef struct MUST_USE_STRUCT LDKInvoicePayer {
12204 * A pointer to the opaque Rust object.
12205 * Nearly everywhere, inner must be non-null, however in places where
12206 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12208 LDKnativeInvoicePayer *inner;
12210 * Indicates that this is the only struct which contains the same pointer.
12211 * Rust functions which take ownership of an object provided via an argument require
12212 * this to be true and invalidate the object pointed to by inner.
12220 * Number of attempts to retry payment path failures for an [`Invoice`].
12222 * Note that this is the number of *path* failures, not full payment retries. For multi-path
12223 * payments, if this is less than the total number of paths, we will never even retry all of the
12226 typedef struct MUST_USE_STRUCT LDKRetryAttempts {
12228 * A pointer to the opaque Rust object.
12229 * Nearly everywhere, inner must be non-null, however in places where
12230 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12232 LDKnativeRetryAttempts *inner;
12234 * Indicates that this is the only struct which contains the same pointer.
12235 * Rust functions which take ownership of an object provided via an argument require
12236 * this to be true and invalidate the object pointed to by inner.
12239 } LDKRetryAttempts;
12244 * A [`Router`] implemented using [`find_route`].
12246 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
12248 * A pointer to the opaque Rust object.
12249 * Nearly everywhere, inner must be non-null, however in places where
12250 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12252 LDKnativeDefaultRouter *inner;
12254 * Indicates that this is the only struct which contains the same pointer.
12255 * Rust functions which take ownership of an object provided via an argument require
12256 * this to be true and invalidate the object pointed to by inner.
12259 } LDKDefaultRouter;
12261 extern const uintptr_t MAX_BUF_SIZE;
12263 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
12265 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
12267 extern const uint32_t ANTI_REORG_DELAY;
12269 extern const uint16_t BREAKDOWN_TIMEOUT;
12271 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
12273 extern const uint32_t MIN_FINAL_CLTV_EXPIRY;
12275 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
12277 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
12279 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
12281 extern const uint64_t MAX_TIMESTAMP;
12283 extern const uint64_t DEFAULT_EXPIRY_TIME;
12285 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY;
12287 extern const uint8_t TAG_PAYMENT_HASH;
12289 extern const uint8_t TAG_DESCRIPTION;
12291 extern const uint8_t TAG_PAYEE_PUB_KEY;
12293 extern const uint8_t TAG_DESCRIPTION_HASH;
12295 extern const uint8_t TAG_EXPIRY_TIME;
12297 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY;
12299 extern const uint8_t TAG_FALLBACK;
12301 extern const uint8_t TAG_PRIVATE_ROUTE;
12303 extern const uint8_t TAG_PAYMENT_SECRET;
12305 extern const uint8_t TAG_FEATURES;
12307 struct LDKStr _ldk_get_compiled_version(void);
12309 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
12312 * Frees the data buffer, if data_is_owned is set and datalen > 0.
12314 void Transaction_free(struct LDKTransaction _res);
12317 * Convenience function for constructing a new TxOut
12319 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
12322 * Frees the data pointed to by script_pubkey.
12324 void TxOut_free(struct LDKTxOut _res);
12327 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
12329 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
12332 * Frees the data buffer, if chars_is_owned is set and len > 0.
12334 void Str_free(struct LDKStr _res);
12336 #if defined(LDK_DEBUG_BUILD)
12338 * This function exists for memory safety testing purposes. It should never be used in production
12341 const void *__unmangle_inner_ptr(const void *ptr);
12345 * Creates a new CResult_NoneNoneZ in the success state.
12347 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
12350 * Creates a new CResult_NoneNoneZ in the error state.
12352 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
12355 * Checks if the given object is currently in the success state
12357 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
12360 * Frees any resources used by the CResult_NoneNoneZ.
12362 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
12365 * Creates a new CResult_NoneNoneZ which has the same data as `orig`
12366 * but with all dynamically-allocated buffers duplicated in new buffers.
12368 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
12371 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
12373 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
12376 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
12378 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
12381 * Checks if the given object is currently in the success state
12383 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
12386 * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
12388 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
12391 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
12392 * but with all dynamically-allocated buffers duplicated in new buffers.
12394 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
12397 * Creates a new CResult_SecretKeyErrorZ in the success state.
12399 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
12402 * Creates a new CResult_SecretKeyErrorZ in the error state.
12404 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
12407 * Checks if the given object is currently in the success state
12409 bool CResult_SecretKeyErrorZ_is_ok(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR o);
12412 * Frees any resources used by the CResult_SecretKeyErrorZ.
12414 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
12417 * Creates a new CResult_SecretKeyErrorZ which has the same data as `orig`
12418 * but with all dynamically-allocated buffers duplicated in new buffers.
12420 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_clone(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR orig);
12423 * Creates a new CResult_PublicKeyErrorZ in the success state.
12425 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
12428 * Creates a new CResult_PublicKeyErrorZ in the error state.
12430 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
12433 * Checks if the given object is currently in the success state
12435 bool CResult_PublicKeyErrorZ_is_ok(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR o);
12438 * Frees any resources used by the CResult_PublicKeyErrorZ.
12440 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
12443 * Creates a new CResult_PublicKeyErrorZ which has the same data as `orig`
12444 * but with all dynamically-allocated buffers duplicated in new buffers.
12446 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig);
12449 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
12451 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
12454 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
12456 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
12459 * Checks if the given object is currently in the success state
12461 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
12464 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
12466 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
12469 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
12470 * but with all dynamically-allocated buffers duplicated in new buffers.
12472 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
12475 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
12477 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
12480 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
12482 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
12485 * Checks if the given object is currently in the success state
12487 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
12490 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
12492 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
12495 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
12496 * but with all dynamically-allocated buffers duplicated in new buffers.
12498 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
12501 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
12503 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
12506 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
12508 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
12511 * Checks if the given object is currently in the success state
12513 bool CResult_TxCreationKeysErrorZ_is_ok(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR o);
12516 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
12518 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
12521 * Creates a new CResult_TxCreationKeysErrorZ which has the same data as `orig`
12522 * but with all dynamically-allocated buffers duplicated in new buffers.
12524 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_clone(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR orig);
12527 * Constructs a new COption_u32Z containing a u32
12529 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
12532 * Constructs a new COption_u32Z containing nothing
12534 struct LDKCOption_u32Z COption_u32Z_none(void);
12537 * Frees any resources associated with the u32, if we are in the Some state
12539 void COption_u32Z_free(struct LDKCOption_u32Z _res);
12542 * Creates a new COption_u32Z which has the same data as `orig`
12543 * but with all dynamically-allocated buffers duplicated in new buffers.
12545 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
12548 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
12550 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
12553 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
12555 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
12558 * Checks if the given object is currently in the success state
12560 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
12563 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
12565 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
12568 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
12569 * but with all dynamically-allocated buffers duplicated in new buffers.
12571 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
12574 * Constructs a new COption_NoneZ containing a
12576 enum LDKCOption_NoneZ COption_NoneZ_some(void);
12579 * Constructs a new COption_NoneZ containing nothing
12581 enum LDKCOption_NoneZ COption_NoneZ_none(void);
12584 * Frees any resources associated with the , if we are in the Some state
12586 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
12589 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
12591 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
12594 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
12596 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
12599 * Checks if the given object is currently in the success state
12601 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
12604 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
12606 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
12609 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
12610 * but with all dynamically-allocated buffers duplicated in new buffers.
12612 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
12615 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
12617 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
12620 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
12622 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
12625 * Checks if the given object is currently in the success state
12627 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
12630 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
12632 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
12635 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
12636 * but with all dynamically-allocated buffers duplicated in new buffers.
12638 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
12641 * Frees the buffer pointed to by `data` if `datalen` is non-0.
12643 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
12646 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
12648 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
12651 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
12653 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
12656 * Checks if the given object is currently in the success state
12658 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
12661 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
12663 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
12666 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
12667 * but with all dynamically-allocated buffers duplicated in new buffers.
12669 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
12672 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
12674 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
12677 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
12679 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
12682 * Checks if the given object is currently in the success state
12684 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
12687 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
12689 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
12692 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
12693 * but with all dynamically-allocated buffers duplicated in new buffers.
12695 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
12698 * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
12700 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
12703 * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
12705 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
12708 * Checks if the given object is currently in the success state
12710 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
12713 * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
12715 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
12718 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
12720 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
12723 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
12725 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
12728 * Checks if the given object is currently in the success state
12730 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
12733 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
12735 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
12738 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
12739 * but with all dynamically-allocated buffers duplicated in new buffers.
12741 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
12744 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
12746 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
12749 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
12751 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
12754 * Checks if the given object is currently in the success state
12756 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
12759 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
12761 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
12764 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
12766 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
12769 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
12771 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
12774 * Checks if the given object is currently in the success state
12776 bool CResult_CVec_SignatureZNoneZ_is_ok(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR o);
12779 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
12781 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
12784 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
12785 * but with all dynamically-allocated buffers duplicated in new buffers.
12787 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
12790 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
12792 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
12795 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
12797 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
12800 * Checks if the given object is currently in the success state
12802 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
12805 * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
12807 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
12810 * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
12811 * but with all dynamically-allocated buffers duplicated in new buffers.
12813 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
12816 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
12818 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
12821 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
12823 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
12826 * Checks if the given object is currently in the success state
12828 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
12831 * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
12833 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
12836 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
12837 * but with all dynamically-allocated buffers duplicated in new buffers.
12839 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
12842 * Creates a new CResult_NoneErrorZ in the success state.
12844 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
12847 * Creates a new CResult_NoneErrorZ in the error state.
12849 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
12852 * Checks if the given object is currently in the success state
12854 bool CResult_NoneErrorZ_is_ok(const struct LDKCResult_NoneErrorZ *NONNULL_PTR o);
12857 * Frees any resources used by the CResult_NoneErrorZ.
12859 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
12862 * Creates a new CResult_NoneErrorZ which has the same data as `orig`
12863 * but with all dynamically-allocated buffers duplicated in new buffers.
12865 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig);
12868 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
12870 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
12873 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
12875 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
12878 * Checks if the given object is currently in the success state
12880 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
12883 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
12885 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
12888 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
12889 * but with all dynamically-allocated buffers duplicated in new buffers.
12891 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
12894 * Frees the buffer pointed to by `data` if `datalen` is non-0.
12896 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
12899 * Frees the buffer pointed to by `data` if `datalen` is non-0.
12901 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
12904 * Creates a new CResult_RouteDecodeErrorZ in the success state.
12906 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
12909 * Creates a new CResult_RouteDecodeErrorZ in the error state.
12911 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
12914 * Checks if the given object is currently in the success state
12916 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
12919 * Frees any resources used by the CResult_RouteDecodeErrorZ.
12921 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
12924 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
12925 * but with all dynamically-allocated buffers duplicated in new buffers.
12927 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
12930 * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
12932 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
12935 * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
12937 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
12940 * Checks if the given object is currently in the success state
12942 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
12945 * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
12947 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
12950 * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
12951 * but with all dynamically-allocated buffers duplicated in new buffers.
12953 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
12956 * Frees the buffer pointed to by `data` if `datalen` is non-0.
12958 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
12961 * Constructs a new COption_u64Z containing a u64
12963 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
12966 * Constructs a new COption_u64Z containing nothing
12968 struct LDKCOption_u64Z COption_u64Z_none(void);
12971 * Frees any resources associated with the u64, if we are in the Some state
12973 void COption_u64Z_free(struct LDKCOption_u64Z _res);
12976 * Creates a new COption_u64Z which has the same data as `orig`
12977 * but with all dynamically-allocated buffers duplicated in new buffers.
12979 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
12982 * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
12984 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
12987 * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
12989 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
12992 * Checks if the given object is currently in the success state
12994 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
12997 * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
12999 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
13002 * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
13003 * but with all dynamically-allocated buffers duplicated in new buffers.
13005 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
13008 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13010 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
13013 * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
13015 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
13018 * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
13020 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
13023 * Checks if the given object is currently in the success state
13025 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
13028 * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
13030 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
13033 * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
13034 * but with all dynamically-allocated buffers duplicated in new buffers.
13036 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
13039 * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
13041 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
13044 * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
13046 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
13049 * Checks if the given object is currently in the success state
13051 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
13054 * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
13056 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
13059 * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
13060 * but with all dynamically-allocated buffers duplicated in new buffers.
13062 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
13065 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13067 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
13070 * Creates a new CResult_RouteLightningErrorZ in the success state.
13072 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
13075 * Creates a new CResult_RouteLightningErrorZ in the error state.
13077 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
13080 * Checks if the given object is currently in the success state
13082 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
13085 * Frees any resources used by the CResult_RouteLightningErrorZ.
13087 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
13090 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
13091 * but with all dynamically-allocated buffers duplicated in new buffers.
13093 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
13096 * Creates a new CResult_TxOutAccessErrorZ in the success state.
13098 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
13101 * Creates a new CResult_TxOutAccessErrorZ in the error state.
13103 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
13106 * Checks if the given object is currently in the success state
13108 bool CResult_TxOutAccessErrorZ_is_ok(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR o);
13111 * Frees any resources used by the CResult_TxOutAccessErrorZ.
13113 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
13116 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
13117 * but with all dynamically-allocated buffers duplicated in new buffers.
13119 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
13122 * Creates a new tuple which has the same data as `orig`
13123 * but with all dynamically-allocated buffers duplicated in new buffers.
13125 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
13128 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
13130 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
13133 * Frees any resources used by the C2Tuple_usizeTransactionZ.
13135 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
13138 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13140 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
13143 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13145 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
13148 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
13150 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
13153 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
13155 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
13158 * Checks if the given object is currently in the success state
13160 bool CResult_NoneChannelMonitorUpdateErrZ_is_ok(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR o);
13163 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
13165 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
13168 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
13169 * but with all dynamically-allocated buffers duplicated in new buffers.
13171 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
13174 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13176 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
13179 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ
13181 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
13184 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing
13186 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
13189 * Frees any resources associated with the crate::c_types::derived::C2Tuple_usizeTransactionZ, if we are in the Some state
13191 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
13194 * Creates a new COption_C2Tuple_usizeTransactionZZ which has the same data as `orig`
13195 * but with all dynamically-allocated buffers duplicated in new buffers.
13197 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_clone(const struct LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR orig);
13200 * Constructs a new COption_ClosureReasonZ containing a crate::lightning::util::events::ClosureReason
13202 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
13205 * Constructs a new COption_ClosureReasonZ containing nothing
13207 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
13210 * Frees any resources associated with the crate::lightning::util::events::ClosureReason, if we are in the Some state
13212 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
13215 * Creates a new COption_ClosureReasonZ which has the same data as `orig`
13216 * but with all dynamically-allocated buffers duplicated in new buffers.
13218 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
13221 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
13223 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
13226 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
13228 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
13231 * Checks if the given object is currently in the success state
13233 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
13236 * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
13238 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
13241 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
13242 * but with all dynamically-allocated buffers duplicated in new buffers.
13244 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
13247 * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::network_graph::NetworkUpdate
13249 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
13252 * Constructs a new COption_NetworkUpdateZ containing nothing
13254 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
13257 * Frees any resources associated with the crate::lightning::routing::network_graph::NetworkUpdate, if we are in the Some state
13259 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
13262 * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
13263 * but with all dynamically-allocated buffers duplicated in new buffers.
13265 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
13268 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13270 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
13273 * Constructs a new COption_EventZ containing a crate::lightning::util::events::Event
13275 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
13278 * Constructs a new COption_EventZ containing nothing
13280 struct LDKCOption_EventZ COption_EventZ_none(void);
13283 * Frees any resources associated with the crate::lightning::util::events::Event, if we are in the Some state
13285 void COption_EventZ_free(struct LDKCOption_EventZ _res);
13288 * Creates a new COption_EventZ which has the same data as `orig`
13289 * but with all dynamically-allocated buffers duplicated in new buffers.
13291 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
13294 * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
13296 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
13299 * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
13301 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
13304 * Checks if the given object is currently in the success state
13306 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
13309 * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
13311 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
13314 * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
13315 * but with all dynamically-allocated buffers duplicated in new buffers.
13317 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
13320 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13322 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
13325 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
13327 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
13330 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
13332 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
13335 * Checks if the given object is currently in the success state
13337 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
13340 * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
13342 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
13345 * Creates a new CResult_ScoringParametersDecodeErrorZ in the success state.
13347 struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_ok(struct LDKScoringParameters o);
13350 * Creates a new CResult_ScoringParametersDecodeErrorZ in the error state.
13352 struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_err(struct LDKDecodeError e);
13355 * Checks if the given object is currently in the success state
13357 bool CResult_ScoringParametersDecodeErrorZ_is_ok(const struct LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR o);
13360 * Frees any resources used by the CResult_ScoringParametersDecodeErrorZ.
13362 void CResult_ScoringParametersDecodeErrorZ_free(struct LDKCResult_ScoringParametersDecodeErrorZ _res);
13365 * Creates a new CResult_ScorerDecodeErrorZ in the success state.
13367 struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_ok(struct LDKScorer o);
13370 * Creates a new CResult_ScorerDecodeErrorZ in the error state.
13372 struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_err(struct LDKDecodeError e);
13375 * Checks if the given object is currently in the success state
13377 bool CResult_ScorerDecodeErrorZ_is_ok(const struct LDKCResult_ScorerDecodeErrorZ *NONNULL_PTR o);
13380 * Frees any resources used by the CResult_ScorerDecodeErrorZ.
13382 void CResult_ScorerDecodeErrorZ_free(struct LDKCResult_ScorerDecodeErrorZ _res);
13385 * Creates a new CResult_ProbabilisticScoringParametersDecodeErrorZ in the success state.
13387 struct LDKCResult_ProbabilisticScoringParametersDecodeErrorZ CResult_ProbabilisticScoringParametersDecodeErrorZ_ok(struct LDKProbabilisticScoringParameters o);
13390 * Creates a new CResult_ProbabilisticScoringParametersDecodeErrorZ in the error state.
13392 struct LDKCResult_ProbabilisticScoringParametersDecodeErrorZ CResult_ProbabilisticScoringParametersDecodeErrorZ_err(struct LDKDecodeError e);
13395 * Checks if the given object is currently in the success state
13397 bool CResult_ProbabilisticScoringParametersDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScoringParametersDecodeErrorZ *NONNULL_PTR o);
13400 * Frees any resources used by the CResult_ProbabilisticScoringParametersDecodeErrorZ.
13402 void CResult_ProbabilisticScoringParametersDecodeErrorZ_free(struct LDKCResult_ProbabilisticScoringParametersDecodeErrorZ _res);
13405 * Creates a new CResult_ProbabilisticScoringParametersDecodeErrorZ which has the same data as `orig`
13406 * but with all dynamically-allocated buffers duplicated in new buffers.
13408 struct LDKCResult_ProbabilisticScoringParametersDecodeErrorZ CResult_ProbabilisticScoringParametersDecodeErrorZ_clone(const struct LDKCResult_ProbabilisticScoringParametersDecodeErrorZ *NONNULL_PTR orig);
13411 * Creates a new tuple which has the same data as `orig`
13412 * but with all dynamically-allocated buffers duplicated in new buffers.
13414 struct LDKC2Tuple_ProbabilisticScoringParametersNetworkGraphZ C2Tuple_ProbabilisticScoringParametersNetworkGraphZ_clone(const struct LDKC2Tuple_ProbabilisticScoringParametersNetworkGraphZ *NONNULL_PTR orig);
13417 * Creates a new C2Tuple_ProbabilisticScoringParametersNetworkGraphZ from the contained elements.
13419 struct LDKC2Tuple_ProbabilisticScoringParametersNetworkGraphZ C2Tuple_ProbabilisticScoringParametersNetworkGraphZ_new(struct LDKProbabilisticScoringParameters a, const struct LDKNetworkGraph *NONNULL_PTR b);
13422 * Frees any resources used by the C2Tuple_ProbabilisticScoringParametersNetworkGraphZ.
13424 void C2Tuple_ProbabilisticScoringParametersNetworkGraphZ_free(struct LDKC2Tuple_ProbabilisticScoringParametersNetworkGraphZ _res);
13427 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
13429 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
13432 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
13434 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
13437 * Checks if the given object is currently in the success state
13439 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
13442 * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
13444 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
13447 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
13449 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
13452 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
13454 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
13457 * Checks if the given object is currently in the success state
13459 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
13462 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
13464 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
13467 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
13469 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
13472 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
13474 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
13477 * Checks if the given object is currently in the success state
13479 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
13482 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
13484 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
13487 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
13489 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
13492 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
13494 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
13497 * Checks if the given object is currently in the success state
13499 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
13502 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
13504 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
13507 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
13509 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
13512 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
13514 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
13517 * Checks if the given object is currently in the success state
13519 bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
13522 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
13524 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
13527 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
13529 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
13532 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
13534 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
13537 * Checks if the given object is currently in the success state
13539 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
13542 * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
13544 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
13547 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
13549 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
13552 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
13554 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
13557 * Checks if the given object is currently in the success state
13559 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
13562 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
13564 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
13567 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
13568 * but with all dynamically-allocated buffers duplicated in new buffers.
13570 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
13573 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
13575 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
13578 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
13580 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
13583 * Checks if the given object is currently in the success state
13585 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
13588 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
13590 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
13593 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
13594 * but with all dynamically-allocated buffers duplicated in new buffers.
13596 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
13599 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
13601 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
13604 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
13606 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
13609 * Checks if the given object is currently in the success state
13611 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
13614 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
13616 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
13619 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
13620 * but with all dynamically-allocated buffers duplicated in new buffers.
13622 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
13625 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13627 void CVec_PaymentPreimageZ_free(struct LDKCVec_PaymentPreimageZ _res);
13630 * Creates a new tuple which has the same data as `orig`
13631 * but with all dynamically-allocated buffers duplicated in new buffers.
13633 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
13636 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
13638 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
13641 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
13643 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
13646 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
13648 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
13651 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
13653 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
13656 * Checks if the given object is currently in the success state
13658 bool CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR o);
13661 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
13663 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
13666 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
13667 * but with all dynamically-allocated buffers duplicated in new buffers.
13669 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
13672 * Creates a new CResult_SignatureNoneZ in the success state.
13674 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
13677 * Creates a new CResult_SignatureNoneZ in the error state.
13679 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
13682 * Checks if the given object is currently in the success state
13684 bool CResult_SignatureNoneZ_is_ok(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR o);
13687 * Frees any resources used by the CResult_SignatureNoneZ.
13689 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
13692 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
13693 * but with all dynamically-allocated buffers duplicated in new buffers.
13695 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
13698 * Creates a new tuple which has the same data as `orig`
13699 * but with all dynamically-allocated buffers duplicated in new buffers.
13701 struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_clone(const struct LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR orig);
13704 * Creates a new C2Tuple_SignatureSignatureZ from the contained elements.
13706 struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_new(struct LDKSignature a, struct LDKSignature b);
13709 * Frees any resources used by the C2Tuple_SignatureSignatureZ.
13711 void C2Tuple_SignatureSignatureZ_free(struct LDKC2Tuple_SignatureSignatureZ _res);
13714 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the success state.
13716 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_ok(struct LDKC2Tuple_SignatureSignatureZ o);
13719 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the error state.
13721 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_err(void);
13724 * Checks if the given object is currently in the success state
13726 bool CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR o);
13729 * Frees any resources used by the CResult_C2Tuple_SignatureSignatureZNoneZ.
13731 void CResult_C2Tuple_SignatureSignatureZNoneZ_free(struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res);
13734 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ which has the same data as `orig`
13735 * but with all dynamically-allocated buffers duplicated in new buffers.
13737 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR orig);
13740 * Creates a new CResult_SecretKeyNoneZ in the success state.
13742 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_ok(struct LDKSecretKey o);
13745 * Creates a new CResult_SecretKeyNoneZ in the error state.
13747 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_err(void);
13750 * Checks if the given object is currently in the success state
13752 bool CResult_SecretKeyNoneZ_is_ok(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR o);
13755 * Frees any resources used by the CResult_SecretKeyNoneZ.
13757 void CResult_SecretKeyNoneZ_free(struct LDKCResult_SecretKeyNoneZ _res);
13760 * Creates a new CResult_SecretKeyNoneZ which has the same data as `orig`
13761 * but with all dynamically-allocated buffers duplicated in new buffers.
13763 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_clone(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR orig);
13766 * Creates a new CResult_SignDecodeErrorZ in the success state.
13768 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
13771 * Creates a new CResult_SignDecodeErrorZ in the error state.
13773 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
13776 * Checks if the given object is currently in the success state
13778 bool CResult_SignDecodeErrorZ_is_ok(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR o);
13781 * Frees any resources used by the CResult_SignDecodeErrorZ.
13783 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
13786 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
13787 * but with all dynamically-allocated buffers duplicated in new buffers.
13789 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
13792 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13794 void CVec_u5Z_free(struct LDKCVec_u5Z _res);
13797 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
13799 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
13802 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
13804 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
13807 * Checks if the given object is currently in the success state
13809 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
13812 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
13814 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
13817 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
13818 * but with all dynamically-allocated buffers duplicated in new buffers.
13820 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
13823 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13825 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
13828 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13830 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
13833 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
13835 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
13838 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
13840 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
13843 * Checks if the given object is currently in the success state
13845 bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o);
13848 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
13850 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
13853 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
13854 * but with all dynamically-allocated buffers duplicated in new buffers.
13856 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
13859 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
13861 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
13864 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
13866 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
13869 * Checks if the given object is currently in the success state
13871 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
13874 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
13876 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
13879 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
13880 * but with all dynamically-allocated buffers duplicated in new buffers.
13882 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
13885 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13887 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
13890 * Creates a new CResult_TransactionNoneZ in the success state.
13892 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
13895 * Creates a new CResult_TransactionNoneZ in the error state.
13897 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
13900 * Checks if the given object is currently in the success state
13902 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
13905 * Frees any resources used by the CResult_TransactionNoneZ.
13907 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
13910 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
13911 * but with all dynamically-allocated buffers duplicated in new buffers.
13913 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
13916 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
13918 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
13921 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
13923 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
13926 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13928 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
13931 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
13933 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
13936 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
13938 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
13941 * Checks if the given object is currently in the success state
13943 bool CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR o);
13946 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
13948 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
13951 * Constructs a new COption_u16Z containing a u16
13953 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
13956 * Constructs a new COption_u16Z containing nothing
13958 struct LDKCOption_u16Z COption_u16Z_none(void);
13961 * Frees any resources associated with the u16, if we are in the Some state
13963 void COption_u16Z_free(struct LDKCOption_u16Z _res);
13966 * Creates a new COption_u16Z which has the same data as `orig`
13967 * but with all dynamically-allocated buffers duplicated in new buffers.
13969 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
13972 * Creates a new CResult_NoneAPIErrorZ in the success state.
13974 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
13977 * Creates a new CResult_NoneAPIErrorZ in the error state.
13979 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
13982 * Checks if the given object is currently in the success state
13984 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
13987 * Frees any resources used by the CResult_NoneAPIErrorZ.
13989 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
13992 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
13993 * but with all dynamically-allocated buffers duplicated in new buffers.
13995 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
13998 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14000 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
14003 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14005 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
14008 * Creates a new CResult__u832APIErrorZ in the success state.
14010 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_ok(struct LDKThirtyTwoBytes o);
14013 * Creates a new CResult__u832APIErrorZ in the error state.
14015 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_err(struct LDKAPIError e);
14018 * Checks if the given object is currently in the success state
14020 bool CResult__u832APIErrorZ_is_ok(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR o);
14023 * Frees any resources used by the CResult__u832APIErrorZ.
14025 void CResult__u832APIErrorZ_free(struct LDKCResult__u832APIErrorZ _res);
14028 * Creates a new CResult__u832APIErrorZ which has the same data as `orig`
14029 * but with all dynamically-allocated buffers duplicated in new buffers.
14031 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig);
14034 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the success state.
14036 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
14039 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the error state.
14041 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
14044 * Checks if the given object is currently in the success state
14046 bool CResult_PaymentIdPaymentSendFailureZ_is_ok(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR o);
14049 * Frees any resources used by the CResult_PaymentIdPaymentSendFailureZ.
14051 void CResult_PaymentIdPaymentSendFailureZ_free(struct LDKCResult_PaymentIdPaymentSendFailureZ _res);
14054 * Creates a new CResult_PaymentIdPaymentSendFailureZ which has the same data as `orig`
14055 * but with all dynamically-allocated buffers duplicated in new buffers.
14057 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_clone(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR orig);
14060 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
14062 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
14065 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
14067 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
14070 * Checks if the given object is currently in the success state
14072 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
14075 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
14077 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
14080 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
14081 * but with all dynamically-allocated buffers duplicated in new buffers.
14083 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
14086 * Creates a new tuple which has the same data as `orig`
14087 * but with all dynamically-allocated buffers duplicated in new buffers.
14089 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig);
14092 * Creates a new C2Tuple_PaymentHashPaymentIdZ from the contained elements.
14094 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
14097 * Frees any resources used by the C2Tuple_PaymentHashPaymentIdZ.
14099 void C2Tuple_PaymentHashPaymentIdZ_free(struct LDKC2Tuple_PaymentHashPaymentIdZ _res);
14102 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the success state.
14104 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(struct LDKC2Tuple_PaymentHashPaymentIdZ o);
14107 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the error state.
14109 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
14112 * Checks if the given object is currently in the success state
14114 bool CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR o);
14117 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.
14119 void CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res);
14122 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ which has the same data as `orig`
14123 * but with all dynamically-allocated buffers duplicated in new buffers.
14125 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR orig);
14128 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14130 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
14133 * Creates a new tuple which has the same data as `orig`
14134 * but with all dynamically-allocated buffers duplicated in new buffers.
14136 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig);
14139 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
14141 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
14144 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
14146 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
14149 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the success state.
14151 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
14154 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the error state.
14156 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(void);
14159 * Checks if the given object is currently in the success state
14161 bool CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR o);
14164 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ.
14166 void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res);
14169 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ which has the same data as `orig`
14170 * but with all dynamically-allocated buffers duplicated in new buffers.
14172 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR orig);
14175 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the success state.
14177 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
14180 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the error state.
14182 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(struct LDKAPIError e);
14185 * Checks if the given object is currently in the success state
14187 bool CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR o);
14190 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.
14192 void CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res);
14195 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ which has the same data as `orig`
14196 * but with all dynamically-allocated buffers duplicated in new buffers.
14198 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR orig);
14201 * Creates a new CResult_PaymentSecretNoneZ in the success state.
14203 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
14206 * Creates a new CResult_PaymentSecretNoneZ in the error state.
14208 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_err(void);
14211 * Checks if the given object is currently in the success state
14213 bool CResult_PaymentSecretNoneZ_is_ok(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR o);
14216 * Frees any resources used by the CResult_PaymentSecretNoneZ.
14218 void CResult_PaymentSecretNoneZ_free(struct LDKCResult_PaymentSecretNoneZ _res);
14221 * Creates a new CResult_PaymentSecretNoneZ which has the same data as `orig`
14222 * but with all dynamically-allocated buffers duplicated in new buffers.
14224 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_clone(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR orig);
14227 * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
14229 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
14232 * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
14234 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
14237 * Checks if the given object is currently in the success state
14239 bool CResult_PaymentSecretAPIErrorZ_is_ok(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR o);
14242 * Frees any resources used by the CResult_PaymentSecretAPIErrorZ.
14244 void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res);
14247 * Creates a new CResult_PaymentSecretAPIErrorZ which has the same data as `orig`
14248 * but with all dynamically-allocated buffers duplicated in new buffers.
14250 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig);
14253 * Creates a new CResult_PaymentPreimageAPIErrorZ in the success state.
14255 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
14258 * Creates a new CResult_PaymentPreimageAPIErrorZ in the error state.
14260 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_err(struct LDKAPIError e);
14263 * Checks if the given object is currently in the success state
14265 bool CResult_PaymentPreimageAPIErrorZ_is_ok(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR o);
14268 * Frees any resources used by the CResult_PaymentPreimageAPIErrorZ.
14270 void CResult_PaymentPreimageAPIErrorZ_free(struct LDKCResult_PaymentPreimageAPIErrorZ _res);
14273 * Creates a new CResult_PaymentPreimageAPIErrorZ which has the same data as `orig`
14274 * but with all dynamically-allocated buffers duplicated in new buffers.
14276 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_clone(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR orig);
14279 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
14281 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
14284 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
14286 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
14289 * Checks if the given object is currently in the success state
14291 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
14294 * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
14296 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
14299 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
14300 * but with all dynamically-allocated buffers duplicated in new buffers.
14302 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
14305 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
14307 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
14310 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
14312 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
14315 * Checks if the given object is currently in the success state
14317 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
14320 * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
14322 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
14325 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
14326 * but with all dynamically-allocated buffers duplicated in new buffers.
14328 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
14331 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
14333 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
14336 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
14338 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
14341 * Checks if the given object is currently in the success state
14343 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
14346 * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
14348 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
14351 * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
14352 * but with all dynamically-allocated buffers duplicated in new buffers.
14354 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
14357 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
14359 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
14362 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
14364 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
14367 * Checks if the given object is currently in the success state
14369 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
14372 * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
14374 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
14377 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14379 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
14382 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
14384 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
14387 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
14389 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
14392 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
14394 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
14397 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
14399 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
14402 * Checks if the given object is currently in the success state
14404 bool CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR o);
14407 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
14409 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
14412 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
14414 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
14417 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
14419 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
14422 * Checks if the given object is currently in the success state
14424 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
14427 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
14429 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
14432 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
14433 * but with all dynamically-allocated buffers duplicated in new buffers.
14435 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
14438 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
14440 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
14443 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
14445 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
14448 * Checks if the given object is currently in the success state
14450 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
14453 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
14455 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
14458 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
14459 * but with all dynamically-allocated buffers duplicated in new buffers.
14461 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
14464 * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
14466 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
14469 * Constructs a new COption_TypeZ containing nothing
14471 struct LDKCOption_TypeZ COption_TypeZ_none(void);
14474 * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
14476 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
14479 * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
14481 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
14484 * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
14486 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
14489 * Checks if the given object is currently in the success state
14491 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
14494 * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
14496 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
14499 * Creates a new CResult_PaymentIdPaymentErrorZ in the success state.
14501 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o);
14504 * Creates a new CResult_PaymentIdPaymentErrorZ in the error state.
14506 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e);
14509 * Checks if the given object is currently in the success state
14511 bool CResult_PaymentIdPaymentErrorZ_is_ok(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR o);
14514 * Frees any resources used by the CResult_PaymentIdPaymentErrorZ.
14516 void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res);
14519 * Creates a new CResult_PaymentIdPaymentErrorZ which has the same data as `orig`
14520 * but with all dynamically-allocated buffers duplicated in new buffers.
14522 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig);
14525 * Creates a new CResult_SiPrefixNoneZ in the success state.
14527 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_ok(enum LDKSiPrefix o);
14530 * Creates a new CResult_SiPrefixNoneZ in the error state.
14532 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_err(void);
14535 * Checks if the given object is currently in the success state
14537 bool CResult_SiPrefixNoneZ_is_ok(const struct LDKCResult_SiPrefixNoneZ *NONNULL_PTR o);
14540 * Frees any resources used by the CResult_SiPrefixNoneZ.
14542 void CResult_SiPrefixNoneZ_free(struct LDKCResult_SiPrefixNoneZ _res);
14545 * Creates a new CResult_SiPrefixNoneZ which has the same data as `orig`
14546 * but with all dynamically-allocated buffers duplicated in new buffers.
14548 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_clone(const struct LDKCResult_SiPrefixNoneZ *NONNULL_PTR orig);
14551 * Creates a new CResult_InvoiceNoneZ in the success state.
14553 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_ok(struct LDKInvoice o);
14556 * Creates a new CResult_InvoiceNoneZ in the error state.
14558 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_err(void);
14561 * Checks if the given object is currently in the success state
14563 bool CResult_InvoiceNoneZ_is_ok(const struct LDKCResult_InvoiceNoneZ *NONNULL_PTR o);
14566 * Frees any resources used by the CResult_InvoiceNoneZ.
14568 void CResult_InvoiceNoneZ_free(struct LDKCResult_InvoiceNoneZ _res);
14571 * Creates a new CResult_InvoiceNoneZ which has the same data as `orig`
14572 * but with all dynamically-allocated buffers duplicated in new buffers.
14574 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_clone(const struct LDKCResult_InvoiceNoneZ *NONNULL_PTR orig);
14577 * Creates a new CResult_SignedRawInvoiceNoneZ in the success state.
14579 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_ok(struct LDKSignedRawInvoice o);
14582 * Creates a new CResult_SignedRawInvoiceNoneZ in the error state.
14584 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_err(void);
14587 * Checks if the given object is currently in the success state
14589 bool CResult_SignedRawInvoiceNoneZ_is_ok(const struct LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR o);
14592 * Frees any resources used by the CResult_SignedRawInvoiceNoneZ.
14594 void CResult_SignedRawInvoiceNoneZ_free(struct LDKCResult_SignedRawInvoiceNoneZ _res);
14597 * Creates a new CResult_SignedRawInvoiceNoneZ which has the same data as `orig`
14598 * but with all dynamically-allocated buffers duplicated in new buffers.
14600 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_clone(const struct LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR orig);
14603 * Creates a new tuple which has the same data as `orig`
14604 * but with all dynamically-allocated buffers duplicated in new buffers.
14606 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig);
14609 * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements.
14611 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c);
14614 * Frees any resources used by the C3Tuple_RawInvoice_u832InvoiceSignatureZ.
14616 void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res);
14619 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
14621 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
14624 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
14626 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
14629 * Checks if the given object is currently in the success state
14631 bool CResult_PayeePubKeyErrorZ_is_ok(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR o);
14634 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
14636 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
14639 * Creates a new CResult_PayeePubKeyErrorZ which has the same data as `orig`
14640 * but with all dynamically-allocated buffers duplicated in new buffers.
14642 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig);
14645 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14647 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
14650 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
14652 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
14655 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
14657 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
14660 * Checks if the given object is currently in the success state
14662 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
14665 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
14667 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
14670 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
14671 * but with all dynamically-allocated buffers duplicated in new buffers.
14673 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
14676 * Creates a new CResult_NoneSemanticErrorZ in the success state.
14678 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void);
14681 * Creates a new CResult_NoneSemanticErrorZ in the error state.
14683 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e);
14686 * Checks if the given object is currently in the success state
14688 bool CResult_NoneSemanticErrorZ_is_ok(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR o);
14691 * Frees any resources used by the CResult_NoneSemanticErrorZ.
14693 void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res);
14696 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
14697 * but with all dynamically-allocated buffers duplicated in new buffers.
14699 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig);
14702 * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
14704 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o);
14707 * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
14709 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e);
14712 * Checks if the given object is currently in the success state
14714 bool CResult_InvoiceSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR o);
14717 * Frees any resources used by the CResult_InvoiceSemanticErrorZ.
14719 void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res);
14722 * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig`
14723 * but with all dynamically-allocated buffers duplicated in new buffers.
14725 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig);
14728 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
14730 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
14733 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
14735 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
14738 * Checks if the given object is currently in the success state
14740 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
14743 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
14745 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
14748 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
14749 * but with all dynamically-allocated buffers duplicated in new buffers.
14751 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
14754 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
14756 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
14759 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
14761 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
14764 * Checks if the given object is currently in the success state
14766 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
14769 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
14771 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
14774 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
14775 * but with all dynamically-allocated buffers duplicated in new buffers.
14777 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
14780 * Creates a new CResult_StringErrorZ in the success state.
14782 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o);
14785 * Creates a new CResult_StringErrorZ in the error state.
14787 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
14790 * Checks if the given object is currently in the success state
14792 bool CResult_StringErrorZ_is_ok(const struct LDKCResult_StringErrorZ *NONNULL_PTR o);
14795 * Frees any resources used by the CResult_StringErrorZ.
14797 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
14800 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
14802 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
14805 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
14807 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
14810 * Checks if the given object is currently in the success state
14812 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
14815 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
14817 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
14820 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
14821 * but with all dynamically-allocated buffers duplicated in new buffers.
14823 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
14826 * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
14828 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
14831 * Constructs a new COption_MonitorEventZ containing nothing
14833 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
14836 * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
14838 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
14841 * Creates a new COption_MonitorEventZ which has the same data as `orig`
14842 * but with all dynamically-allocated buffers duplicated in new buffers.
14844 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
14847 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
14849 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
14852 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
14854 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
14857 * Checks if the given object is currently in the success state
14859 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
14862 * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
14864 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
14867 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
14868 * but with all dynamically-allocated buffers duplicated in new buffers.
14870 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
14873 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
14875 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
14878 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
14880 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
14883 * Checks if the given object is currently in the success state
14885 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
14888 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
14890 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
14893 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
14894 * but with all dynamically-allocated buffers duplicated in new buffers.
14896 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
14899 * Creates a new tuple which has the same data as `orig`
14900 * but with all dynamically-allocated buffers duplicated in new buffers.
14902 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
14905 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
14907 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
14910 * Frees any resources used by the C2Tuple_OutPointScriptZ.
14912 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
14915 * Creates a new tuple which has the same data as `orig`
14916 * but with all dynamically-allocated buffers duplicated in new buffers.
14918 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
14921 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
14923 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
14926 * Frees any resources used by the C2Tuple_u32ScriptZ.
14928 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
14931 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14933 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
14936 * Creates a new tuple which has the same data as `orig`
14937 * but with all dynamically-allocated buffers duplicated in new buffers.
14939 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR orig);
14942 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
14944 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
14947 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
14949 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
14952 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14954 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
14957 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14959 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
14962 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14964 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
14967 * Creates a new tuple which has the same data as `orig`
14968 * but with all dynamically-allocated buffers duplicated in new buffers.
14970 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
14973 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
14975 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
14978 * Frees any resources used by the C2Tuple_u32TxOutZ.
14980 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
14983 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14985 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
14988 * Creates a new tuple which has the same data as `orig`
14989 * but with all dynamically-allocated buffers duplicated in new buffers.
14991 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
14994 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
14996 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
14999 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
15001 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
15004 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15006 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
15009 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15011 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
15014 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
15016 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
15019 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
15021 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
15024 * Checks if the given object is currently in the success state
15026 bool CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
15029 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
15031 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
15034 * Creates a new CResult_NoneLightningErrorZ in the success state.
15036 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
15039 * Creates a new CResult_NoneLightningErrorZ in the error state.
15041 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
15044 * Checks if the given object is currently in the success state
15046 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
15049 * Frees any resources used by the CResult_NoneLightningErrorZ.
15051 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
15054 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
15055 * but with all dynamically-allocated buffers duplicated in new buffers.
15057 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
15060 * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
15062 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
15065 * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
15067 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
15070 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15072 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
15075 * Creates a new CResult_boolLightningErrorZ in the success state.
15077 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
15080 * Creates a new CResult_boolLightningErrorZ in the error state.
15082 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
15085 * Checks if the given object is currently in the success state
15087 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
15090 * Frees any resources used by the CResult_boolLightningErrorZ.
15092 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
15095 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
15096 * but with all dynamically-allocated buffers duplicated in new buffers.
15098 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
15101 * Creates a new tuple which has the same data as `orig`
15102 * but with all dynamically-allocated buffers duplicated in new buffers.
15104 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
15107 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
15109 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
15112 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
15114 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
15117 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15119 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
15122 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15124 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
15127 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15129 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
15132 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
15134 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
15137 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
15139 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
15142 * Checks if the given object is currently in the success state
15144 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
15147 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
15149 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
15152 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
15153 * but with all dynamically-allocated buffers duplicated in new buffers.
15155 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
15158 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
15160 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
15163 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
15165 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
15168 * Checks if the given object is currently in the success state
15170 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
15173 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
15175 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
15178 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
15179 * but with all dynamically-allocated buffers duplicated in new buffers.
15181 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
15184 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
15186 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
15189 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
15191 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
15194 * Checks if the given object is currently in the success state
15196 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
15199 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
15201 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
15204 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
15205 * but with all dynamically-allocated buffers duplicated in new buffers.
15207 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
15210 * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
15212 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
15215 * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
15217 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
15220 * Checks if the given object is currently in the success state
15222 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
15225 * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
15227 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
15230 * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
15231 * but with all dynamically-allocated buffers duplicated in new buffers.
15233 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
15236 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
15238 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
15241 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
15243 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
15246 * Checks if the given object is currently in the success state
15248 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
15251 * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
15253 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
15256 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
15257 * but with all dynamically-allocated buffers duplicated in new buffers.
15259 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
15262 * Constructs a new COption_AccessZ containing a crate::lightning::chain::Access
15264 struct LDKCOption_AccessZ COption_AccessZ_some(struct LDKAccess o);
15267 * Constructs a new COption_AccessZ containing nothing
15269 struct LDKCOption_AccessZ COption_AccessZ_none(void);
15272 * Frees any resources associated with the crate::lightning::chain::Access, if we are in the Some state
15274 void COption_AccessZ_free(struct LDKCOption_AccessZ _res);
15277 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
15279 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
15282 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
15284 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
15287 * Checks if the given object is currently in the success state
15289 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
15292 * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
15294 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
15297 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
15298 * but with all dynamically-allocated buffers duplicated in new buffers.
15300 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
15303 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
15305 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
15308 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
15310 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
15313 * Checks if the given object is currently in the success state
15315 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
15318 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
15320 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
15323 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
15324 * but with all dynamically-allocated buffers duplicated in new buffers.
15326 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
15329 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
15331 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
15334 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
15336 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
15339 * Checks if the given object is currently in the success state
15341 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
15344 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
15346 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
15349 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
15350 * but with all dynamically-allocated buffers duplicated in new buffers.
15352 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
15355 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
15357 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
15360 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
15362 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
15365 * Checks if the given object is currently in the success state
15367 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
15370 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
15372 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
15375 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
15376 * but with all dynamically-allocated buffers duplicated in new buffers.
15378 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
15381 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15383 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
15386 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
15388 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
15391 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
15393 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
15396 * Checks if the given object is currently in the success state
15398 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
15401 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
15403 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
15406 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
15407 * but with all dynamically-allocated buffers duplicated in new buffers.
15409 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
15412 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
15414 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
15417 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
15419 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
15422 * Checks if the given object is currently in the success state
15424 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
15427 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
15429 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
15432 * Creates a new CResult_NetworkGraphDecodeErrorZ which has the same data as `orig`
15433 * but with all dynamically-allocated buffers duplicated in new buffers.
15435 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
15438 * Constructs a new COption_CVec_NetAddressZZ containing a crate::c_types::derived::CVec_NetAddressZ
15440 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o);
15443 * Constructs a new COption_CVec_NetAddressZZ containing nothing
15445 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_none(void);
15448 * Frees any resources associated with the crate::c_types::derived::CVec_NetAddressZ, if we are in the Some state
15450 void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res);
15453 * Creates a new COption_CVec_NetAddressZZ which has the same data as `orig`
15454 * but with all dynamically-allocated buffers duplicated in new buffers.
15456 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig);
15459 * Creates a new CResult_NetAddressDecodeErrorZ in the success state.
15461 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
15464 * Creates a new CResult_NetAddressDecodeErrorZ in the error state.
15466 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
15469 * Checks if the given object is currently in the success state
15471 bool CResult_NetAddressDecodeErrorZ_is_ok(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR o);
15474 * Frees any resources used by the CResult_NetAddressDecodeErrorZ.
15476 void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
15479 * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig`
15480 * but with all dynamically-allocated buffers duplicated in new buffers.
15482 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
15485 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15487 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
15490 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15492 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
15495 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15497 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
15500 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15502 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
15505 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
15507 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
15510 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
15512 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
15515 * Checks if the given object is currently in the success state
15517 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
15520 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
15522 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
15525 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
15526 * but with all dynamically-allocated buffers duplicated in new buffers.
15528 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
15531 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
15533 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
15536 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
15538 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
15541 * Checks if the given object is currently in the success state
15543 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
15546 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
15548 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
15551 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
15552 * but with all dynamically-allocated buffers duplicated in new buffers.
15554 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
15557 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
15559 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
15562 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
15564 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
15567 * Checks if the given object is currently in the success state
15569 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
15572 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
15574 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
15577 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
15578 * but with all dynamically-allocated buffers duplicated in new buffers.
15580 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
15583 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
15585 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
15588 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
15590 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
15593 * Checks if the given object is currently in the success state
15595 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
15598 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
15600 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
15603 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
15604 * but with all dynamically-allocated buffers duplicated in new buffers.
15606 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
15609 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
15611 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
15614 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
15616 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
15619 * Checks if the given object is currently in the success state
15621 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
15624 * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
15626 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
15629 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
15630 * but with all dynamically-allocated buffers duplicated in new buffers.
15632 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
15635 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
15637 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
15640 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
15642 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
15645 * Checks if the given object is currently in the success state
15647 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
15650 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
15652 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
15655 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
15656 * but with all dynamically-allocated buffers duplicated in new buffers.
15658 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
15661 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
15663 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
15666 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
15668 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
15671 * Checks if the given object is currently in the success state
15673 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
15676 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
15678 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
15681 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
15682 * but with all dynamically-allocated buffers duplicated in new buffers.
15684 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
15687 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
15689 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
15692 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
15694 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
15697 * Checks if the given object is currently in the success state
15699 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
15702 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
15704 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
15707 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
15708 * but with all dynamically-allocated buffers duplicated in new buffers.
15710 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
15713 * Creates a new CResult_FundingLockedDecodeErrorZ in the success state.
15715 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o);
15718 * Creates a new CResult_FundingLockedDecodeErrorZ in the error state.
15720 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e);
15723 * Checks if the given object is currently in the success state
15725 bool CResult_FundingLockedDecodeErrorZ_is_ok(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR o);
15728 * Frees any resources used by the CResult_FundingLockedDecodeErrorZ.
15730 void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res);
15733 * Creates a new CResult_FundingLockedDecodeErrorZ which has the same data as `orig`
15734 * but with all dynamically-allocated buffers duplicated in new buffers.
15736 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig);
15739 * Creates a new CResult_InitDecodeErrorZ in the success state.
15741 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
15744 * Creates a new CResult_InitDecodeErrorZ in the error state.
15746 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
15749 * Checks if the given object is currently in the success state
15751 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
15754 * Frees any resources used by the CResult_InitDecodeErrorZ.
15756 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
15759 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
15760 * but with all dynamically-allocated buffers duplicated in new buffers.
15762 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
15765 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
15767 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
15770 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
15772 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
15775 * Checks if the given object is currently in the success state
15777 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
15780 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
15782 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
15785 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
15786 * but with all dynamically-allocated buffers duplicated in new buffers.
15788 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
15791 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
15793 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
15796 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
15798 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
15801 * Checks if the given object is currently in the success state
15803 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
15806 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
15808 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
15811 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
15812 * but with all dynamically-allocated buffers duplicated in new buffers.
15814 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
15817 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
15819 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
15822 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
15824 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
15827 * Checks if the given object is currently in the success state
15829 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
15832 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
15834 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
15837 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
15838 * but with all dynamically-allocated buffers duplicated in new buffers.
15840 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
15843 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
15845 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
15848 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
15850 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
15853 * Checks if the given object is currently in the success state
15855 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
15858 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
15860 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
15863 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
15864 * but with all dynamically-allocated buffers duplicated in new buffers.
15866 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
15869 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
15871 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
15874 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
15876 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
15879 * Checks if the given object is currently in the success state
15881 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
15884 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
15886 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
15889 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
15890 * but with all dynamically-allocated buffers duplicated in new buffers.
15892 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
15895 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
15897 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
15900 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
15902 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
15905 * Checks if the given object is currently in the success state
15907 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
15910 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
15912 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
15915 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
15916 * but with all dynamically-allocated buffers duplicated in new buffers.
15918 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
15921 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
15923 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
15926 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
15928 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
15931 * Checks if the given object is currently in the success state
15933 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
15936 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
15938 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
15941 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
15942 * but with all dynamically-allocated buffers duplicated in new buffers.
15944 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
15947 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
15949 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
15952 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
15954 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
15957 * Checks if the given object is currently in the success state
15959 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
15962 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
15964 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
15967 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
15968 * but with all dynamically-allocated buffers duplicated in new buffers.
15970 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
15973 * Creates a new CResult_PingDecodeErrorZ in the success state.
15975 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
15978 * Creates a new CResult_PingDecodeErrorZ in the error state.
15980 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
15983 * Checks if the given object is currently in the success state
15985 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
15988 * Frees any resources used by the CResult_PingDecodeErrorZ.
15990 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
15993 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
15994 * but with all dynamically-allocated buffers duplicated in new buffers.
15996 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
15999 * Creates a new CResult_PongDecodeErrorZ in the success state.
16001 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
16004 * Creates a new CResult_PongDecodeErrorZ in the error state.
16006 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
16009 * Checks if the given object is currently in the success state
16011 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
16014 * Frees any resources used by the CResult_PongDecodeErrorZ.
16016 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
16019 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
16020 * but with all dynamically-allocated buffers duplicated in new buffers.
16022 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
16025 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
16027 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
16030 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
16032 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
16035 * Checks if the given object is currently in the success state
16037 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
16040 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
16042 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
16045 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
16046 * but with all dynamically-allocated buffers duplicated in new buffers.
16048 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
16051 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
16053 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
16056 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
16058 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
16061 * Checks if the given object is currently in the success state
16063 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
16066 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
16068 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
16071 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
16072 * but with all dynamically-allocated buffers duplicated in new buffers.
16074 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
16077 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
16079 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
16082 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
16084 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
16087 * Checks if the given object is currently in the success state
16089 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
16092 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
16094 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
16097 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
16098 * but with all dynamically-allocated buffers duplicated in new buffers.
16100 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
16103 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
16105 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
16108 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
16110 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
16113 * Checks if the given object is currently in the success state
16115 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
16118 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
16120 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
16123 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
16124 * but with all dynamically-allocated buffers duplicated in new buffers.
16126 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
16129 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
16131 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
16134 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
16136 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
16139 * Checks if the given object is currently in the success state
16141 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
16144 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
16146 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
16149 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
16150 * but with all dynamically-allocated buffers duplicated in new buffers.
16152 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
16155 * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
16157 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
16160 * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
16162 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
16165 * Checks if the given object is currently in the success state
16167 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
16170 * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
16172 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
16175 * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
16176 * but with all dynamically-allocated buffers duplicated in new buffers.
16178 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
16181 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
16183 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
16186 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
16188 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
16191 * Checks if the given object is currently in the success state
16193 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
16196 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
16198 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
16201 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
16202 * but with all dynamically-allocated buffers duplicated in new buffers.
16204 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
16207 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
16209 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
16212 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
16214 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
16217 * Checks if the given object is currently in the success state
16219 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
16222 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
16224 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
16227 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
16228 * but with all dynamically-allocated buffers duplicated in new buffers.
16230 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
16233 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
16235 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
16238 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
16240 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
16243 * Checks if the given object is currently in the success state
16245 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
16248 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
16250 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
16253 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
16254 * but with all dynamically-allocated buffers duplicated in new buffers.
16256 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
16259 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
16261 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
16264 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
16266 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
16269 * Checks if the given object is currently in the success state
16271 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
16274 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
16276 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
16279 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
16280 * but with all dynamically-allocated buffers duplicated in new buffers.
16282 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
16285 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
16287 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
16290 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
16292 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
16295 * Checks if the given object is currently in the success state
16297 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
16300 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
16302 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
16305 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
16306 * but with all dynamically-allocated buffers duplicated in new buffers.
16308 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
16311 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
16313 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
16316 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
16318 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
16321 * Checks if the given object is currently in the success state
16323 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
16326 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
16328 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
16331 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
16332 * but with all dynamically-allocated buffers duplicated in new buffers.
16334 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
16337 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
16339 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
16342 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
16344 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
16347 * Checks if the given object is currently in the success state
16349 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
16352 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
16354 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
16357 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
16358 * but with all dynamically-allocated buffers duplicated in new buffers.
16360 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
16363 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16365 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
16368 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state.
16370 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o);
16373 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state.
16375 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
16378 * Checks if the given object is currently in the success state
16380 bool CResult_InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
16383 * Frees any resources used by the CResult_InvoiceSignOrCreationErrorZ.
16385 void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res);
16388 * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig`
16389 * but with all dynamically-allocated buffers duplicated in new buffers.
16391 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
16394 * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
16396 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
16399 * Constructs a new COption_FilterZ containing nothing
16401 struct LDKCOption_FilterZ COption_FilterZ_none(void);
16404 * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
16406 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
16409 * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
16411 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
16414 * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
16416 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
16419 * Checks if the given object is currently in the success state
16421 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
16424 * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
16426 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
16429 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16431 void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res);
16434 * Frees any resources used by the PaymentPurpose
16436 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
16439 * Creates a copy of the PaymentPurpose
16441 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
16444 * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
16446 struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret);
16449 * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
16451 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
16454 * Frees any resources used by the ClosureReason
16456 void ClosureReason_free(struct LDKClosureReason this_ptr);
16459 * Creates a copy of the ClosureReason
16461 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
16464 * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
16466 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKStr peer_msg);
16469 * Utility method to constructs a new HolderForceClosed-variant ClosureReason
16471 struct LDKClosureReason ClosureReason_holder_force_closed(void);
16474 * Utility method to constructs a new CooperativeClosure-variant ClosureReason
16476 struct LDKClosureReason ClosureReason_cooperative_closure(void);
16479 * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
16481 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
16484 * Utility method to constructs a new FundingTimedOut-variant ClosureReason
16486 struct LDKClosureReason ClosureReason_funding_timed_out(void);
16489 * Utility method to constructs a new ProcessingError-variant ClosureReason
16491 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
16494 * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
16496 struct LDKClosureReason ClosureReason_disconnected_peer(void);
16499 * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
16501 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
16504 * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
16506 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
16509 * Read a ClosureReason from a byte array, created by ClosureReason_write
16511 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
16514 * Frees any resources used by the Event
16516 void Event_free(struct LDKEvent this_ptr);
16519 * Creates a copy of the Event
16521 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
16524 * Utility method to constructs a new FundingGenerationReady-variant Event
16526 struct LDKEvent Event_funding_generation_ready(struct LDKThirtyTwoBytes temporary_channel_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, uint64_t user_channel_id);
16529 * Utility method to constructs a new PaymentReceived-variant Event
16531 struct LDKEvent Event_payment_received(struct LDKThirtyTwoBytes payment_hash, uint64_t amt, struct LDKPaymentPurpose purpose);
16534 * Utility method to constructs a new PaymentSent-variant Event
16536 struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
16539 * Utility method to constructs a new PaymentPathFailed-variant Event
16541 struct LDKEvent Event_payment_path_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, bool rejected_by_dest, struct LDKCOption_NetworkUpdateZ network_update, bool all_paths_failed, struct LDKCVec_RouteHopZ path, struct LDKCOption_u64Z short_channel_id, struct LDKRouteParameters retry);
16544 * Utility method to constructs a new PaymentFailed-variant Event
16546 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
16549 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
16551 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
16554 * Utility method to constructs a new SpendableOutputs-variant Event
16556 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs);
16559 * Utility method to constructs a new PaymentForwarded-variant Event
16561 struct LDKEvent Event_payment_forwarded(struct LDKCOption_u64Z fee_earned_msat, bool claim_from_onchain_tx);
16564 * Utility method to constructs a new ChannelClosed-variant Event
16566 struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, uint64_t user_channel_id, struct LDKClosureReason reason);
16569 * Utility method to constructs a new DiscardFunding-variant Event
16571 struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
16574 * Utility method to constructs a new PaymentPathSuccessful-variant Event
16576 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path);
16579 * Utility method to constructs a new OpenChannelRequest-variant Event
16581 struct LDKEvent Event_open_channel_request(struct LDKThirtyTwoBytes temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t funding_satoshis, uint64_t push_msat);
16584 * Serialize the Event object into a byte array which can be read by Event_read
16586 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
16589 * Read a Event from a byte array, created by Event_write
16591 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
16594 * Frees any resources used by the MessageSendEvent
16596 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
16599 * Creates a copy of the MessageSendEvent
16601 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
16604 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
16606 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
16609 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
16611 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
16614 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
16616 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
16619 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
16621 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
16624 * Utility method to constructs a new SendFundingLocked-variant MessageSendEvent
16626 struct LDKMessageSendEvent MessageSendEvent_send_funding_locked(struct LDKPublicKey node_id, struct LDKFundingLocked msg);
16629 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
16631 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
16634 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
16636 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
16639 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
16641 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
16644 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
16646 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
16649 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
16651 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
16654 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
16656 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
16659 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
16661 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
16664 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
16666 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
16669 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
16671 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
16674 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
16676 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
16679 * Utility method to constructs a new HandleError-variant MessageSendEvent
16681 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
16684 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
16686 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
16689 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
16691 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
16694 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
16696 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
16699 * Calls the free function if one is set
16701 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
16704 * Calls the free function if one is set
16706 void EventsProvider_free(struct LDKEventsProvider this_ptr);
16709 * Calls the free function if one is set
16711 void EventHandler_free(struct LDKEventHandler this_ptr);
16714 * Frees any resources used by the APIError
16716 void APIError_free(struct LDKAPIError this_ptr);
16719 * Creates a copy of the APIError
16721 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
16724 * Utility method to constructs a new APIMisuseError-variant APIError
16726 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
16729 * Utility method to constructs a new FeeRateTooHigh-variant APIError
16731 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
16734 * Utility method to constructs a new RouteError-variant APIError
16736 struct LDKAPIError APIError_route_error(struct LDKStr err);
16739 * Utility method to constructs a new ChannelUnavailable-variant APIError
16741 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
16744 * Utility method to constructs a new MonitorUpdateFailed-variant APIError
16746 struct LDKAPIError APIError_monitor_update_failed(void);
16749 * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
16751 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
16754 * Creates a digital signature of a message given a SecretKey, like the node's secret.
16755 * 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.
16756 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
16758 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
16761 * Recovers the PublicKey of the signer of the message given the message and the signature.
16763 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
16766 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
16767 * and the PublicKey.
16769 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
16772 * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
16774 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_u5Z data_without_signature);
16777 * Creates a copy of the Level
16779 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
16782 * Utility method to constructs a new Gossip-variant Level
16784 enum LDKLevel Level_gossip(void);
16787 * Utility method to constructs a new Trace-variant Level
16789 enum LDKLevel Level_trace(void);
16792 * Utility method to constructs a new Debug-variant Level
16794 enum LDKLevel Level_debug(void);
16797 * Utility method to constructs a new Info-variant Level
16799 enum LDKLevel Level_info(void);
16802 * Utility method to constructs a new Warn-variant Level
16804 enum LDKLevel Level_warn(void);
16807 * Utility method to constructs a new Error-variant Level
16809 enum LDKLevel Level_error(void);
16812 * Checks if two Levels contain equal inner contents.
16813 * This ignores pointers and is_owned flags and looks at the values in fields.
16815 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
16818 * Checks if two Levels contain equal inner contents.
16820 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
16823 * Returns the most verbose logging level.
16825 MUST_USE_RES enum LDKLevel Level_max(void);
16828 * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
16830 void Record_free(struct LDKRecord this_obj);
16833 * The verbosity level of the message.
16835 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
16838 * The verbosity level of the message.
16840 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
16843 * The message body.
16845 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
16848 * The message body.
16850 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
16853 * The module path of the message.
16855 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
16858 * The module path of the message.
16860 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
16863 * The source file containing the message.
16865 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
16868 * The source file containing the message.
16870 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
16873 * The line containing the message.
16875 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
16878 * The line containing the message.
16880 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
16883 * Creates a copy of the Record
16885 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
16888 * Calls the free function if one is set
16890 void Logger_free(struct LDKLogger this_ptr);
16893 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
16895 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
16898 * Confirmations we will wait for before considering the channel locked in.
16899 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
16900 * equivalent limit applied to outbound channels).
16902 * Default value: 6.
16904 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
16907 * Confirmations we will wait for before considering the channel locked in.
16908 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
16909 * equivalent limit applied to outbound channels).
16911 * Default value: 6.
16913 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
16916 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
16917 * the number of blocks we have to punish our counterparty if they broadcast a revoked
16920 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
16921 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
16922 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
16923 * possibly with time in between to RBF the spending transaction).
16925 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
16926 * case of an honest unilateral channel close, which implicitly decrease the economic value of
16929 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
16930 * can tweak config to ask for more security, not less.
16932 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
16935 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
16936 * the number of blocks we have to punish our counterparty if they broadcast a revoked
16939 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
16940 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
16941 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
16942 * possibly with time in between to RBF the spending transaction).
16944 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
16945 * case of an honest unilateral channel close, which implicitly decrease the economic value of
16948 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
16949 * can tweak config to ask for more security, not less.
16951 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
16954 * Set to the smallest value HTLC we will accept to process.
16956 * This value is sent to our counterparty on channel-open and we close the channel any time
16957 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
16959 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
16962 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
16965 * Set to the smallest value HTLC we will accept to process.
16967 * This value is sent to our counterparty on channel-open and we close the channel any time
16968 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
16970 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
16973 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
16976 * Constructs a new ChannelHandshakeConfig given each field
16978 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);
16981 * Creates a copy of the ChannelHandshakeConfig
16983 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
16986 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
16988 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
16991 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
16993 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
16996 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
16997 * only applies to inbound channels.
16999 * Default value: 0.
17001 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17004 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
17005 * only applies to inbound channels.
17007 * Default value: 0.
17009 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17012 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
17013 * you to limit the maximum minimum-size they can require.
17015 * Default value: u64::max_value.
17017 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17020 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
17021 * you to limit the maximum minimum-size they can require.
17023 * Default value: u64::max_value.
17025 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17028 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
17029 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
17031 * Default value: 0.
17033 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17036 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
17037 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
17039 * Default value: 0.
17041 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17044 * The remote node will require we keep a certain amount in direct payment to ourselves at all
17045 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
17046 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
17048 * Default value: u64::max_value.
17050 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17053 * The remote node will require we keep a certain amount in direct payment to ourselves at all
17054 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
17055 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
17057 * Default value: u64::max_value.
17059 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17062 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
17063 * time. This allows you to set a minimum such value.
17065 * Default value: 0.
17067 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17070 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
17071 * time. This allows you to set a minimum such value.
17073 * Default value: 0.
17075 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
17078 * Before a channel is usable the funding transaction will need to be confirmed by at least a
17079 * certain number of blocks, specified by the node which is not the funder (as the funder can
17080 * assume they aren't going to double-spend themselves).
17081 * This config allows you to set a limit on the maximum amount of time to wait.
17083 * Default value: 144, or roughly one day and only applies to outbound channels.
17085 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17088 * Before a channel is usable the funding transaction will need to be confirmed by at least a
17089 * certain number of blocks, specified by the node which is not the funder (as the funder can
17090 * assume they aren't going to double-spend themselves).
17091 * This config allows you to set a limit on the maximum amount of time to wait.
17093 * Default value: 144, or roughly one day and only applies to outbound channels.
17095 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
17098 * Set to force an incoming channel to match our announced channel preference in
17099 * [`ChannelConfig::announced_channel`].
17101 * For a node which is not online reliably, this should be set to true and
17102 * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public)
17103 * channels will ever be opened.
17105 * Default value: true.
17107 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17110 * Set to force an incoming channel to match our announced channel preference in
17111 * [`ChannelConfig::announced_channel`].
17113 * For a node which is not online reliably, this should be set to true and
17114 * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public)
17115 * channels will ever be opened.
17117 * Default value: true.
17119 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
17122 * Set to the amount of time we're willing to wait to claim money back to us.
17124 * Not checking this value would be a security issue, as our peer would be able to set it to
17125 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
17127 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
17128 * reduce the loss of having useless locked funds (if your peer accepts)
17130 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17133 * Set to the amount of time we're willing to wait to claim money back to us.
17135 * Not checking this value would be a security issue, as our peer would be able to set it to
17136 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
17138 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
17139 * reduce the loss of having useless locked funds (if your peer accepts)
17141 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
17144 * Constructs a new ChannelHandshakeLimits given each field
17146 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_new(uint64_t min_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 force_announced_channel_preference_arg, uint16_t their_to_self_delay_arg);
17149 * Creates a copy of the ChannelHandshakeLimits
17151 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
17154 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
17156 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
17159 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
17161 void ChannelConfig_free(struct LDKChannelConfig this_obj);
17164 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
17165 * over the channel.
17166 * This may be allowed to change at runtime in a later update, however doing so must result in
17167 * update messages sent to notify all nodes of our updated relay fee.
17169 * Default value: 0.
17171 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
17174 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
17175 * over the channel.
17176 * This may be allowed to change at runtime in a later update, however doing so must result in
17177 * update messages sent to notify all nodes of our updated relay fee.
17179 * Default value: 0.
17181 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
17184 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
17185 * excess of [`forwarding_fee_proportional_millionths`].
17186 * This may be allowed to change at runtime in a later update, however doing so must result in
17187 * update messages sent to notify all nodes of our updated relay fee.
17189 * The default value of a single satoshi roughly matches the market rate on many routing nodes
17190 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
17193 * Default value: 1000.
17195 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
17197 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
17200 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
17201 * excess of [`forwarding_fee_proportional_millionths`].
17202 * This may be allowed to change at runtime in a later update, however doing so must result in
17203 * update messages sent to notify all nodes of our updated relay fee.
17205 * The default value of a single satoshi roughly matches the market rate on many routing nodes
17206 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
17209 * Default value: 1000.
17211 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
17213 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
17216 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
17217 * the channel this config applies to.
17219 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
17220 * HTLC balance when a channel appears on-chain whereas
17221 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
17222 * (non-HTLC-encumbered) balance.
17224 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
17225 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
17226 * commitment transaction at least once per this many blocks (minus some margin to allow us
17227 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
17228 * the spending transaction).
17230 * Default value: 72 (12 hours at an average of 6 blocks/hour).
17231 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
17232 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
17234 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
17236 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
17239 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
17240 * the channel this config applies to.
17242 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
17243 * HTLC balance when a channel appears on-chain whereas
17244 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
17245 * (non-HTLC-encumbered) balance.
17247 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
17248 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
17249 * commitment transaction at least once per this many blocks (minus some margin to allow us
17250 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
17251 * the spending transaction).
17253 * Default value: 72 (12 hours at an average of 6 blocks/hour).
17254 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
17255 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
17257 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
17259 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
17262 * Set to announce the channel publicly and notify all nodes that they can route via this
17265 * This should only be set to true for nodes which expect to be online reliably.
17267 * As the node which funds a channel picks this value this will only apply for new outbound
17268 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
17270 * This cannot be changed after the initial channel handshake.
17272 * Default value: false.
17274 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
17277 * Set to announce the channel publicly and notify all nodes that they can route via this
17280 * This should only be set to true for nodes which expect to be online reliably.
17282 * As the node which funds a channel picks this value this will only apply for new outbound
17283 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
17285 * This cannot be changed after the initial channel handshake.
17287 * Default value: false.
17289 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
17292 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
17293 * supports it, they will then enforce the mutual-close output to us matches what we provided
17294 * at intialization, preventing us from closing to an alternate pubkey.
17296 * This is set to true by default to provide a slight increase in security, though ultimately
17297 * any attacker who is able to take control of a channel can just as easily send the funds via
17298 * lightning payments, so we never require that our counterparties support this option.
17300 * This cannot be changed after a channel has been initialized.
17302 * Default value: true.
17304 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
17307 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
17308 * supports it, they will then enforce the mutual-close output to us matches what we provided
17309 * at intialization, preventing us from closing to an alternate pubkey.
17311 * This is set to true by default to provide a slight increase in security, though ultimately
17312 * any attacker who is able to take control of a channel can just as easily send the funds via
17313 * lightning payments, so we never require that our counterparties support this option.
17315 * This cannot be changed after a channel has been initialized.
17317 * Default value: true.
17319 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
17322 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
17323 * small to claim on-chain.
17325 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
17326 * not be claimable on-chain, instead being turned into additional miner fees if either
17327 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
17328 * to such payments may be sustantial if there are many dust HTLCs present when the
17329 * channel is force-closed.
17331 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
17332 * exposure across all three types per-channel. Setting this too low may prevent the
17333 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
17334 * important to prevent stealing of dust HTLCs by miners.
17336 * Default value: 5_000_000 msat.
17338 uint64_t ChannelConfig_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
17341 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
17342 * small to claim on-chain.
17344 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
17345 * not be claimable on-chain, instead being turned into additional miner fees if either
17346 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
17347 * to such payments may be sustantial if there are many dust HTLCs present when the
17348 * channel is force-closed.
17350 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
17351 * exposure across all three types per-channel. Setting this too low may prevent the
17352 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
17353 * important to prevent stealing of dust HTLCs by miners.
17355 * Default value: 5_000_000 msat.
17357 void ChannelConfig_set_max_dust_htlc_exposure_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
17360 * The additional fee we're willing to pay to avoid waiting for the counterparty's
17361 * `to_self_delay` to reclaim funds.
17363 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
17364 * closing transaction which both sides find acceptable, ultimately paid by the channel
17365 * funder/initiator.
17367 * When we are the funder, because we have to pay the channel closing fee, we bound the
17368 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
17369 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
17370 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
17371 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
17374 * When we are not the funder, we require the closing transaction fee pay at least our
17375 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
17376 * Thus, this value is ignored when we are not the funder.
17378 * Default value: 1000 satoshis.
17380 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
17381 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
17383 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
17386 * The additional fee we're willing to pay to avoid waiting for the counterparty's
17387 * `to_self_delay` to reclaim funds.
17389 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
17390 * closing transaction which both sides find acceptable, ultimately paid by the channel
17391 * funder/initiator.
17393 * When we are the funder, because we have to pay the channel closing fee, we bound the
17394 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
17395 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
17396 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
17397 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
17400 * When we are not the funder, we require the closing transaction fee pay at least our
17401 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
17402 * Thus, this value is ignored when we are not the funder.
17404 * Default value: 1000 satoshis.
17406 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
17407 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
17409 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
17412 * Constructs a new ChannelConfig given each field
17414 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, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg, uint64_t max_dust_htlc_exposure_msat_arg, uint64_t force_close_avoidance_max_fee_satoshis_arg);
17417 * Creates a copy of the ChannelConfig
17419 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
17422 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
17424 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
17427 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
17429 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
17432 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
17434 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
17437 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
17439 void UserConfig_free(struct LDKUserConfig this_obj);
17442 * Channel config that we propose to our counterparty.
17444 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
17447 * Channel config that we propose to our counterparty.
17449 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
17452 * Limits applied to our counterparty's proposed channel config settings.
17454 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
17457 * Limits applied to our counterparty's proposed channel config settings.
17459 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
17462 * Channel config which affects behavior during channel lifetime.
17464 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
17467 * Channel config which affects behavior during channel lifetime.
17469 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
17472 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
17473 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
17474 * node which is not online reliably.
17476 * For nodes which are not online reliably, you should set all channels to *not* be announced
17477 * (using [`ChannelConfig::announced_channel`] and
17478 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
17479 * ensure you are not exposed to any forwarding risk.
17481 * Note that because you cannot change a channel's announced state after creation, there is no
17482 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
17483 * from a publicly-announced forwarding node to a private non-forwarding node you must close
17484 * all your channels and open new ones. For privacy, you should also change your node_id
17485 * (swapping all private and public key material for new ones) at that time.
17487 * Default value: false.
17489 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
17492 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
17493 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
17494 * node which is not online reliably.
17496 * For nodes which are not online reliably, you should set all channels to *not* be announced
17497 * (using [`ChannelConfig::announced_channel`] and
17498 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
17499 * ensure you are not exposed to any forwarding risk.
17501 * Note that because you cannot change a channel's announced state after creation, there is no
17502 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
17503 * from a publicly-announced forwarding node to a private non-forwarding node you must close
17504 * all your channels and open new ones. For privacy, you should also change your node_id
17505 * (swapping all private and public key material for new ones) at that time.
17507 * Default value: false.
17509 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
17512 * If this is set to false, we do not accept inbound requests to open a new channel.
17513 * Default value: true.
17515 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
17518 * If this is set to false, we do not accept inbound requests to open a new channel.
17519 * Default value: true.
17521 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
17524 * If this is set to true, the user needs to manually accept inbound requests to open a new
17527 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
17528 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
17529 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
17530 * user explicitly chooses to accept the request.
17532 * Default value: false.
17534 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
17535 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
17536 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
17538 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
17541 * If this is set to true, the user needs to manually accept inbound requests to open a new
17544 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
17545 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
17546 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
17547 * user explicitly chooses to accept the request.
17549 * Default value: false.
17551 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
17552 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
17553 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
17555 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
17558 * Constructs a new UserConfig given each field
17560 MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig own_channel_config_arg, struct LDKChannelHandshakeLimits peer_channel_config_limits_arg, struct LDKChannelConfig channel_options_arg, bool accept_forwards_to_priv_channels_arg, bool accept_inbound_channels_arg, bool manually_accept_inbound_channels_arg);
17563 * Creates a copy of the UserConfig
17565 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
17568 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
17570 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
17573 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
17575 void BestBlock_free(struct LDKBestBlock this_obj);
17578 * Creates a copy of the BestBlock
17580 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
17583 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
17586 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
17589 * Returns a `BestBlock` as identified by the given block hash and height.
17591 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
17594 * Returns the best block hash.
17596 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
17599 * Returns the best block height.
17601 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
17604 * Creates a copy of the AccessError
17606 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
17609 * Utility method to constructs a new UnknownChain-variant AccessError
17611 enum LDKAccessError AccessError_unknown_chain(void);
17614 * Utility method to constructs a new UnknownTx-variant AccessError
17616 enum LDKAccessError AccessError_unknown_tx(void);
17619 * Calls the free function if one is set
17621 void Access_free(struct LDKAccess this_ptr);
17624 * Calls the free function if one is set
17626 void Listen_free(struct LDKListen this_ptr);
17629 * Calls the free function if one is set
17631 void Confirm_free(struct LDKConfirm this_ptr);
17634 * Creates a copy of the ChannelMonitorUpdateErr
17636 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
17639 * Utility method to constructs a new TemporaryFailure-variant ChannelMonitorUpdateErr
17641 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_temporary_failure(void);
17644 * Utility method to constructs a new PermanentFailure-variant ChannelMonitorUpdateErr
17646 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_permanent_failure(void);
17649 * Calls the free function if one is set
17651 void Watch_free(struct LDKWatch this_ptr);
17654 * Calls the free function if one is set
17656 void Filter_free(struct LDKFilter this_ptr);
17659 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
17661 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
17664 * First block where the transaction output may have been spent.
17666 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
17668 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
17671 * First block where the transaction output may have been spent.
17673 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
17675 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
17678 * Outpoint identifying the transaction output.
17680 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
17683 * Outpoint identifying the transaction output.
17685 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
17688 * Spending condition of the transaction output.
17690 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
17693 * Spending condition of the transaction output.
17695 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
17698 * Constructs a new WatchedOutput given each field
17700 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
17703 * Creates a copy of the WatchedOutput
17705 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
17708 * Checks if two WatchedOutputs contain equal inner contents.
17710 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
17713 * Calls the free function if one is set
17715 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
17718 * Creates a copy of the ConfirmationTarget
17720 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
17723 * Utility method to constructs a new Background-variant ConfirmationTarget
17725 enum LDKConfirmationTarget ConfirmationTarget_background(void);
17728 * Utility method to constructs a new Normal-variant ConfirmationTarget
17730 enum LDKConfirmationTarget ConfirmationTarget_normal(void);
17733 * Utility method to constructs a new HighPriority-variant ConfirmationTarget
17735 enum LDKConfirmationTarget ConfirmationTarget_high_priority(void);
17738 * Checks if two ConfirmationTargets contain equal inner contents.
17739 * This ignores pointers and is_owned flags and looks at the values in fields.
17741 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
17744 * Calls the free function if one is set
17746 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
17749 * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
17751 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
17754 * Creates a copy of the MonitorUpdateId
17756 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
17759 * Checks if two MonitorUpdateIds contain equal inner contents.
17761 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
17764 * Checks if two MonitorUpdateIds contain equal inner contents.
17765 * This ignores pointers and is_owned flags and looks at the values in fields.
17766 * Two objects with NULL inner values will be considered "equal" here.
17768 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
17771 * Calls the free function if one is set
17773 void Persist_free(struct LDKPersist this_ptr);
17776 * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
17778 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
17781 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
17783 void ChainMonitor_free(struct LDKChainMonitor this_obj);
17786 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
17788 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
17789 * will call back to it indicating transactions and outputs of interest. This allows clients to
17790 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
17791 * always need to fetch full blocks absent another means for determining which blocks contain
17792 * transactions relevant to the watched channels.
17794 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
17797 * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
17798 * claims which are awaiting confirmation.
17800 * Includes the balances from each [`ChannelMonitor`] *except* those included in
17801 * `ignored_channels`, allowing you to filter out balances from channels which are still open
17802 * (and whose balance should likely be pulled from the [`ChannelDetails`]).
17804 * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
17805 * inclusion in the return value.
17807 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
17810 * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
17811 * such [`ChannelMonitor`] is currently being monitored for.
17813 * Note that the result holds a mutex over our monitor set, and should not be held
17816 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
17819 * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
17821 * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
17822 * monitoring for on-chain state resolutions.
17824 MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
17827 * Indicates the persistence of a [`ChannelMonitor`] has completed after
17828 * [`ChannelMonitorUpdateErr::TemporaryFailure`] was returned from an update operation.
17830 * Thus, the anticipated use is, at a high level:
17831 * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
17832 * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
17833 * returning [`ChannelMonitorUpdateErr::TemporaryFailure`],
17834 * 2) once all remote copies are updated, you call this function with the
17835 * `completed_update_id` that completed, and once all pending updates have completed the
17836 * channel will be re-enabled.
17838 * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
17839 * registered [`ChannelMonitor`]s.
17841 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);
17844 * Constructs a new Listen which calls the relevant methods on this_arg.
17845 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
17847 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
17850 * Constructs a new Confirm which calls the relevant methods on this_arg.
17851 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
17853 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
17856 * Constructs a new Watch which calls the relevant methods on this_arg.
17857 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
17859 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
17862 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
17863 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
17865 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
17868 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
17870 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
17873 * The sequence number of this update. Updates *must* be replayed in-order according to this
17874 * sequence number (and updates may panic if they are not). The update_id values are strictly
17875 * increasing and increase by one for each new update, with one exception specified below.
17877 * This sequence number is also used to track up to which points updates which returned
17878 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
17879 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
17881 * The only instance where update_id values are not strictly increasing is the case where we
17882 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
17883 * its docs for more details.
17885 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
17888 * The sequence number of this update. Updates *must* be replayed in-order according to this
17889 * sequence number (and updates may panic if they are not). The update_id values are strictly
17890 * increasing and increase by one for each new update, with one exception specified below.
17892 * This sequence number is also used to track up to which points updates which returned
17893 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
17894 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
17896 * The only instance where update_id values are not strictly increasing is the case where we
17897 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
17898 * its docs for more details.
17900 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
17903 * Creates a copy of the ChannelMonitorUpdate
17905 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
17908 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
17910 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
17913 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
17915 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
17918 * Frees any resources used by the MonitorEvent
17920 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
17923 * Creates a copy of the MonitorEvent
17925 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
17928 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
17930 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
17933 * Utility method to constructs a new CommitmentTxConfirmed-variant MonitorEvent
17935 struct LDKMonitorEvent MonitorEvent_commitment_tx_confirmed(struct LDKOutPoint a);
17938 * Utility method to constructs a new UpdateCompleted-variant MonitorEvent
17940 struct LDKMonitorEvent MonitorEvent_update_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
17943 * Utility method to constructs a new UpdateFailed-variant MonitorEvent
17945 struct LDKMonitorEvent MonitorEvent_update_failed(struct LDKOutPoint a);
17948 * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
17950 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
17953 * Read a MonitorEvent from a byte array, created by MonitorEvent_write
17955 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
17958 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
17960 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
17963 * Creates a copy of the HTLCUpdate
17965 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
17968 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
17970 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
17973 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
17975 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
17978 * Frees any resources used by the Balance
17980 void Balance_free(struct LDKBalance this_ptr);
17983 * Creates a copy of the Balance
17985 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
17988 * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
17990 struct LDKBalance Balance_claimable_on_channel_close(uint64_t claimable_amount_satoshis);
17993 * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
17995 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t claimable_amount_satoshis, uint32_t confirmation_height);
17998 * Utility method to constructs a new ContentiousClaimable-variant Balance
18000 struct LDKBalance Balance_contentious_claimable(uint64_t claimable_amount_satoshis, uint32_t timeout_height);
18003 * Utility method to constructs a new MaybeClaimableHTLCAwaitingTimeout-variant Balance
18005 struct LDKBalance Balance_maybe_claimable_htlcawaiting_timeout(uint64_t claimable_amount_satoshis, uint32_t claimable_height);
18008 * Checks if two Balances contain equal inner contents.
18009 * This ignores pointers and is_owned flags and looks at the values in fields.
18011 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
18014 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
18016 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
18019 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
18021 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
18024 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
18027 * panics if the given update is not the next update by update_id.
18029 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelMonitor_update_monitor(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKChannelMonitorUpdate *NONNULL_PTR updates, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
18032 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
18035 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18038 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
18040 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18043 * Gets a list of txids, with their output scripts (in the order they appear in the
18044 * transaction), which we must learn about spends of via block_connected().
18046 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18049 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
18050 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
18051 * have been registered.
18053 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
18056 * Get the list of HTLCs who's status has been updated on chain. This should be called by
18057 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
18059 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18062 * Gets the list of pending events which were generated by previous actions, clearing the list
18065 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
18066 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
18067 * no internal locking in ChannelMonitors.
18069 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18072 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
18073 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
18074 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
18075 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
18076 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
18077 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
18078 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
18079 * out-of-band the other node operator to coordinate with him if option is available to you.
18080 * In any-case, choice is up to the user.
18082 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);
18085 * Processes transactions in a newly connected block, which may result in any of the following:
18086 * - update the monitor's state against resolved HTLCs
18087 * - punish the counterparty in the case of seeing a revoked commitment transaction
18088 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
18089 * - detect settled outputs for later spending
18090 * - schedule and bump any in-flight claims
18092 * Returns any new outputs to watch from `txdata`; after called, these are also included in
18093 * [`get_outputs_to_watch`].
18095 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
18097 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);
18100 * Determines if the disconnected block contained any transactions of interest and updates
18103 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);
18106 * Processes transactions confirmed in a block with the given header and height, returning new
18107 * outputs to watch. See [`block_connected`] for details.
18109 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
18110 * blocks. See [`chain::Confirm`] for calling expectations.
18112 * [`block_connected`]: Self::block_connected
18114 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);
18117 * Processes a transaction that was reorganized out of the chain.
18119 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
18120 * than blocks. See [`chain::Confirm`] for calling expectations.
18122 * [`block_disconnected`]: Self::block_disconnected
18124 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);
18127 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
18128 * [`block_connected`] for details.
18130 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
18131 * blocks. See [`chain::Confirm`] for calling expectations.
18133 * [`block_connected`]: Self::block_connected
18135 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);
18138 * Returns the set of txids that should be monitored for re-organization out of the chain.
18140 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18143 * Gets the latest best block which was connected either via the [`chain::Listen`] or
18144 * [`chain::Confirm`] interfaces.
18146 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18149 * Gets the balances in this channel which are either claimable by us if we were to
18150 * force-close the channel now or which are claimable on-chain (possibly awaiting
18153 * Any balances in the channel which are available on-chain (excluding on-chain fees) are
18154 * included here until an [`Event::SpendableOutputs`] event has been generated for the
18155 * balance, or until our counterparty has claimed the balance and accrued several
18156 * confirmations on the claim transaction.
18158 * Note that the balances available when you or your counterparty have broadcasted revoked
18159 * state(s) may not be fully captured here.
18161 * See [`Balance`] for additional details on the types of claimable balances which
18162 * may be returned here and their meanings.
18164 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18167 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
18169 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
18172 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
18174 void OutPoint_free(struct LDKOutPoint this_obj);
18177 * The referenced transaction's txid.
18179 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
18182 * The referenced transaction's txid.
18184 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18187 * The index of the referenced output in its transaction's vout.
18189 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
18192 * The index of the referenced output in its transaction's vout.
18194 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
18197 * Constructs a new OutPoint given each field
18199 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
18202 * Creates a copy of the OutPoint
18204 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
18207 * Checks if two OutPoints contain equal inner contents.
18208 * This ignores pointers and is_owned flags and looks at the values in fields.
18209 * Two objects with NULL inner values will be considered "equal" here.
18211 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
18214 * Checks if two OutPoints contain equal inner contents.
18216 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
18219 * Convert an `OutPoint` to a lightning channel id.
18221 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
18224 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
18226 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
18229 * Read a OutPoint from a byte array, created by OutPoint_write
18231 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
18234 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
18236 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
18239 * The outpoint which is spendable
18241 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
18244 * The outpoint which is spendable
18246 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
18249 * Per commitment point to derive delayed_payment_key by key holder
18251 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
18254 * Per commitment point to derive delayed_payment_key by key holder
18256 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
18259 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
18260 * the witness_script.
18262 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
18265 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
18266 * the witness_script.
18268 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
18271 * The output which is referenced by the given outpoint
18273 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
18276 * The revocation point specific to the commitment transaction which was broadcast. Used to
18277 * derive the witnessScript for this output.
18279 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
18282 * The revocation point specific to the commitment transaction which was broadcast. Used to
18283 * derive the witnessScript for this output.
18285 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
18288 * Arbitrary identification information returned by a call to
18289 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
18290 * the channel to spend the output.
18292 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
18295 * Arbitrary identification information returned by a call to
18296 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
18297 * the channel to spend the output.
18299 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18302 * The value of the channel which this output originated from, possibly indirectly.
18304 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
18307 * The value of the channel which this output originated from, possibly indirectly.
18309 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
18312 * Constructs a new DelayedPaymentOutputDescriptor given each field
18314 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);
18317 * Creates a copy of the DelayedPaymentOutputDescriptor
18319 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
18322 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
18324 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
18327 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
18329 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
18332 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
18334 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
18337 * The outpoint which is spendable
18339 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
18342 * The outpoint which is spendable
18344 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
18347 * The output which is referenced by the given outpoint
18349 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
18352 * Arbitrary identification information returned by a call to
18353 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
18354 * the channel to spend the output.
18356 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
18359 * Arbitrary identification information returned by a call to
18360 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
18361 * the channel to spend the output.
18363 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18366 * The value of the channel which this transactions spends.
18368 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
18371 * The value of the channel which this transactions spends.
18373 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
18376 * Constructs a new StaticPaymentOutputDescriptor given each field
18378 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);
18381 * Creates a copy of the StaticPaymentOutputDescriptor
18383 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
18386 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
18388 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
18391 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
18393 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
18396 * Frees any resources used by the SpendableOutputDescriptor
18398 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
18401 * Creates a copy of the SpendableOutputDescriptor
18403 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
18406 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
18408 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
18411 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
18413 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
18416 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
18418 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
18421 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
18423 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
18426 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
18428 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
18431 * Calls the free function if one is set
18433 void BaseSign_free(struct LDKBaseSign this_ptr);
18436 * Creates a copy of a Sign
18438 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
18441 * Calls the free function if one is set
18443 void Sign_free(struct LDKSign this_ptr);
18446 * Creates a copy of the Recipient
18448 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
18451 * Utility method to constructs a new Node-variant Recipient
18453 enum LDKRecipient Recipient_node(void);
18456 * Utility method to constructs a new PhantomNode-variant Recipient
18458 enum LDKRecipient Recipient_phantom_node(void);
18461 * Calls the free function if one is set
18463 void KeysInterface_free(struct LDKKeysInterface this_ptr);
18466 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
18468 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
18471 * Private key of anchor tx
18473 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
18476 * Private key of anchor tx
18478 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
18481 * Holder secret key for blinded revocation pubkey
18483 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
18486 * Holder secret key for blinded revocation pubkey
18488 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
18491 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
18493 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
18496 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
18498 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
18501 * Holder secret key used in HTLC tx
18503 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
18506 * Holder secret key used in HTLC tx
18508 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
18511 * Holder htlc secret key used in commitment tx htlc outputs
18513 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
18516 * Holder htlc secret key used in commitment tx htlc outputs
18518 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
18523 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
18528 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18531 * Creates a copy of the InMemorySigner
18533 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
18536 * Create a new InMemorySigner
18538 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);
18541 * Counterparty pubkeys.
18542 * Will panic if ready_channel wasn't called.
18544 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
18547 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
18548 * transactions, ie the amount of time that we have to wait to recover our funds if we
18549 * broadcast a transaction.
18550 * Will panic if ready_channel wasn't called.
18552 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
18555 * The contest_delay value specified by us and applied on transactions broadcastable
18556 * by our counterparty, ie the amount of time that they have to wait to recover their funds
18557 * if they broadcast a transaction.
18558 * Will panic if ready_channel wasn't called.
18560 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
18563 * Whether the holder is the initiator
18564 * Will panic if ready_channel wasn't called.
18566 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
18570 * Will panic if ready_channel wasn't called.
18572 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
18575 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
18576 * building transactions.
18578 * Will panic if ready_channel wasn't called.
18580 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
18583 * Whether anchors should be used.
18584 * Will panic if ready_channel wasn't called.
18586 MUST_USE_RES bool InMemorySigner_opt_anchors(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
18589 * Sign the single input of spend_tx at index `input_idx` which spends the output
18590 * described by descriptor, returning the witness stack for the input.
18592 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
18593 * is not spending the outpoint described by `descriptor.outpoint`,
18594 * or if an output descriptor script_pubkey does not match the one we can spend.
18596 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);
18599 * Sign the single input of spend_tx at index `input_idx` which spends the output
18600 * described by descriptor, returning the witness stack for the input.
18602 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
18603 * is not spending the outpoint described by `descriptor.outpoint`, does not have a
18604 * sequence set to `descriptor.to_self_delay`, or if an output descriptor
18605 * script_pubkey does not match the one we can spend.
18607 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);
18610 * Constructs a new BaseSign which calls the relevant methods on this_arg.
18611 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
18613 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
18616 * Constructs a new Sign which calls the relevant methods on this_arg.
18617 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
18619 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
18622 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
18624 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
18627 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
18629 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKSecretKey arg);
18632 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
18634 void KeysManager_free(struct LDKKeysManager this_obj);
18637 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
18638 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
18639 * starting_time isn't strictly required to actually be a time, but it must absolutely,
18640 * without a doubt, be unique to this instance. ie if you start multiple times with the same
18641 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
18642 * simply use the current time (with very high precision).
18644 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
18645 * obviously, starting_time should be unique every time you reload the library - it is only
18646 * used to generate new ephemeral key data (which will be stored by the individual channel if
18649 * Note that the seed is required to recover certain on-chain funds independent of
18650 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
18651 * channel, and some on-chain during-closing funds.
18653 * Note that until the 0.1 release there is no guarantee of backward compatibility between
18654 * versions. Once the library is more fully supported, the docs will be updated to include a
18655 * detailed description of the guarantee.
18657 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
18660 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
18662 * Key derivation parameters are accessible through a per-channel secrets
18663 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
18664 * onchain output detection for which a corresponding delayed_payment_key must be derived.
18666 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]);
18669 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
18670 * output to the given change destination (if sufficient change value remains). The
18671 * transaction will have a feerate, at least, of the given value.
18673 * Returns `Err(())` if the output value is greater than the input value minus required fee,
18674 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
18675 * does not match the one we can spend.
18677 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
18679 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
18680 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
18682 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);
18685 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
18686 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
18688 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
18691 * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
18693 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
18696 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
18697 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
18699 struct LDKKeysInterface PhantomKeysManager_as_KeysInterface(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
18702 * Constructs a `PhantomKeysManager` given a 32-byte seed and an additional `cross_node_seed`
18703 * that is shared across all nodes that intend to participate in [phantom node payments] together.
18705 * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
18706 * `starting_time_nanos`.
18708 * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
18709 * same across restarts, or else inbound payments may fail.
18711 * [phantom node payments]: PhantomKeysManager
18713 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]);
18716 * See [`KeysManager::spend_spendable_outputs`] for documentation on this method.
18718 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);
18721 * See [`KeysManager::derive_channel_keys`] for documentation on this method.
18723 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]);
18726 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
18728 void ChannelManager_free(struct LDKChannelManager this_obj);
18731 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
18733 void ChainParameters_free(struct LDKChainParameters this_obj);
18736 * The network for determining the `chain_hash` in Lightning messages.
18738 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
18741 * The network for determining the `chain_hash` in Lightning messages.
18743 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
18746 * The hash and height of the latest block successfully connected.
18748 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
18750 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
18753 * The hash and height of the latest block successfully connected.
18755 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
18757 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
18760 * Constructs a new ChainParameters given each field
18762 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
18765 * Creates a copy of the ChainParameters
18767 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
18770 * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
18772 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
18775 * Base routing fee in millisatoshis.
18777 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
18780 * Base routing fee in millisatoshis.
18782 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
18785 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
18787 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
18790 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
18792 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
18795 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
18796 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
18797 * `cltv_expiry_delta` for more details.
18799 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
18802 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
18803 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
18804 * `cltv_expiry_delta` for more details.
18806 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
18809 * Constructs a new CounterpartyForwardingInfo given each field
18811 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);
18814 * Creates a copy of the CounterpartyForwardingInfo
18816 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
18819 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
18821 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
18824 * The node_id of our counterparty
18826 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
18829 * The node_id of our counterparty
18831 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
18834 * The Features the channel counterparty provided upon last connection.
18835 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
18836 * many routing-relevant features are present in the init context.
18838 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
18841 * The Features the channel counterparty provided upon last connection.
18842 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
18843 * many routing-relevant features are present in the init context.
18845 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
18848 * The value, in satoshis, that must always be held in the channel for our counterparty. This
18849 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
18850 * claiming at least this value on chain.
18852 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
18854 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
18856 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
18859 * The value, in satoshis, that must always be held in the channel for our counterparty. This
18860 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
18861 * claiming at least this value on chain.
18863 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
18865 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
18867 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
18870 * Information on the fees and requirements that the counterparty requires when forwarding
18871 * payments to us through this channel.
18873 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18875 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
18878 * Information on the fees and requirements that the counterparty requires when forwarding
18879 * payments to us through this channel.
18881 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
18883 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
18886 * Constructs a new ChannelCounterparty given each field
18888 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);
18891 * Creates a copy of the ChannelCounterparty
18893 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
18896 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
18898 void ChannelDetails_free(struct LDKChannelDetails this_obj);
18901 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
18902 * thereafter this is the txid of the funding transaction xor the funding transaction output).
18903 * Note that this means this value is *not* persistent - it can change once during the
18904 * lifetime of the channel.
18906 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
18909 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
18910 * thereafter this is the txid of the funding transaction xor the funding transaction output).
18911 * Note that this means this value is *not* persistent - it can change once during the
18912 * lifetime of the channel.
18914 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18917 * Parameters which apply to our counterparty. See individual fields for more information.
18919 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
18922 * Parameters which apply to our counterparty. See individual fields for more information.
18924 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
18927 * The Channel's funding transaction output, if we've negotiated the funding transaction with
18928 * our counterparty already.
18930 * Note that, if this has been set, `channel_id` will be equivalent to
18931 * `funding_txo.unwrap().to_channel_id()`.
18933 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18935 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
18938 * The Channel's funding transaction output, if we've negotiated the funding transaction with
18939 * our counterparty already.
18941 * Note that, if this has been set, `channel_id` will be equivalent to
18942 * `funding_txo.unwrap().to_channel_id()`.
18944 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
18946 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
18949 * The position of the funding transaction in the chain. None if the funding transaction has
18950 * not yet been confirmed and the channel fully opened.
18952 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
18955 * The position of the funding transaction in the chain. None if the funding transaction has
18956 * not yet been confirmed and the channel fully opened.
18958 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
18961 * The value, in satoshis, of this channel as appears in the funding output
18963 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
18966 * The value, in satoshis, of this channel as appears in the funding output
18968 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
18971 * The value, in satoshis, that must always be held in the channel for us. This value ensures
18972 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
18973 * this value on chain.
18975 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
18977 * This value will be `None` for outbound channels until the counterparty accepts the channel.
18979 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
18981 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
18984 * The value, in satoshis, that must always be held in the channel for us. This value ensures
18985 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
18986 * this value on chain.
18988 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
18990 * This value will be `None` for outbound channels until the counterparty accepts the channel.
18992 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
18994 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
18997 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
18999 uint64_t ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19002 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
19004 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19007 * Our total balance. This is the amount we would get if we close the channel.
19008 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
19009 * amount is not likely to be recoverable on close.
19011 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
19012 * balance is not available for inclusion in new outbound HTLCs). This further does not include
19013 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
19014 * This does not consider any on-chain fees.
19016 * See also [`ChannelDetails::outbound_capacity_msat`]
19018 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19021 * Our total balance. This is the amount we would get if we close the channel.
19022 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
19023 * amount is not likely to be recoverable on close.
19025 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
19026 * balance is not available for inclusion in new outbound HTLCs). This further does not include
19027 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
19028 * This does not consider any on-chain fees.
19030 * See also [`ChannelDetails::outbound_capacity_msat`]
19032 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19035 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
19036 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
19037 * available for inclusion in new outbound HTLCs). This further does not include any pending
19038 * outgoing HTLCs which are awaiting some other resolution to be sent.
19040 * See also [`ChannelDetails::balance_msat`]
19042 * This value is not exact. Due to various in-flight changes, feerate changes, and our
19043 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
19044 * should be able to spend nearly this amount.
19046 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19049 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
19050 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
19051 * available for inclusion in new outbound HTLCs). This further does not include any pending
19052 * outgoing HTLCs which are awaiting some other resolution to be sent.
19054 * See also [`ChannelDetails::balance_msat`]
19056 * This value is not exact. Due to various in-flight changes, feerate changes, and our
19057 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
19058 * should be able to spend nearly this amount.
19060 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19063 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
19064 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
19065 * available for inclusion in new inbound HTLCs).
19066 * Note that there are some corner cases not fully handled here, so the actual available
19067 * inbound capacity may be slightly higher than this.
19069 * This value is not exact. Due to various in-flight changes, feerate changes, and our
19070 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
19071 * However, our counterparty should be able to spend nearly this amount.
19073 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19076 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
19077 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
19078 * available for inclusion in new inbound HTLCs).
19079 * Note that there are some corner cases not fully handled here, so the actual available
19080 * inbound capacity may be slightly higher than this.
19082 * This value is not exact. Due to various in-flight changes, feerate changes, and our
19083 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
19084 * However, our counterparty should be able to spend nearly this amount.
19086 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19089 * The number of required confirmations on the funding transaction before the funding will be
19090 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
19091 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
19092 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
19093 * [`ChannelHandshakeLimits::max_minimum_depth`].
19095 * This value will be `None` for outbound channels until the counterparty accepts the channel.
19097 * [`is_outbound`]: ChannelDetails::is_outbound
19098 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
19099 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
19101 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19104 * The number of required confirmations on the funding transaction before the funding will be
19105 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
19106 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
19107 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
19108 * [`ChannelHandshakeLimits::max_minimum_depth`].
19110 * This value will be `None` for outbound channels until the counterparty accepts the channel.
19112 * [`is_outbound`]: ChannelDetails::is_outbound
19113 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
19114 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
19116 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
19119 * The number of blocks (after our commitment transaction confirms) that we will need to wait
19120 * until we can claim our funds after we force-close the channel. During this time our
19121 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
19122 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
19123 * time to claim our non-HTLC-encumbered funds.
19125 * This value will be `None` for outbound channels until the counterparty accepts the channel.
19127 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19130 * The number of blocks (after our commitment transaction confirms) that we will need to wait
19131 * until we can claim our funds after we force-close the channel. During this time our
19132 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
19133 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
19134 * time to claim our non-HTLC-encumbered funds.
19136 * This value will be `None` for outbound channels until the counterparty accepts the channel.
19138 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
19141 * True if the channel was initiated (and thus funded) by us.
19143 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19146 * True if the channel was initiated (and thus funded) by us.
19148 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
19151 * True if the channel is confirmed, funding_locked messages have been exchanged, and the
19152 * channel is not currently being shut down. `funding_locked` message exchange implies the
19153 * required confirmation count has been reached (and we were connected to the peer at some
19154 * point after the funding transaction received enough confirmations). The required
19155 * confirmation count is provided in [`confirmations_required`].
19157 * [`confirmations_required`]: ChannelDetails::confirmations_required
19159 bool ChannelDetails_get_is_funding_locked(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19162 * True if the channel is confirmed, funding_locked messages have been exchanged, and the
19163 * channel is not currently being shut down. `funding_locked` message exchange implies the
19164 * required confirmation count has been reached (and we were connected to the peer at some
19165 * point after the funding transaction received enough confirmations). The required
19166 * confirmation count is provided in [`confirmations_required`].
19168 * [`confirmations_required`]: ChannelDetails::confirmations_required
19170 void ChannelDetails_set_is_funding_locked(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
19173 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
19174 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
19176 * This is a strict superset of `is_funding_locked`.
19178 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19181 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
19182 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
19184 * This is a strict superset of `is_funding_locked`.
19186 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
19189 * True if this channel is (or will be) publicly-announced.
19191 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19194 * True if this channel is (or will be) publicly-announced.
19196 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
19199 * Constructs a new ChannelDetails given each field
19201 MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKCOption_u64Z short_channel_id_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 inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_funding_locked_arg, bool is_usable_arg, bool is_public_arg);
19204 * Creates a copy of the ChannelDetails
19206 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
19209 * Frees any resources used by the PaymentSendFailure
19211 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
19214 * Creates a copy of the PaymentSendFailure
19216 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
19219 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
19221 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
19224 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
19226 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
19229 * Utility method to constructs a new AllFailedRetrySafe-variant PaymentSendFailure
19231 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_retry_safe(struct LDKCVec_APIErrorZ a);
19234 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
19236 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
19239 * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
19241 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
19244 * The list of channels to be included in the invoice route hints.
19246 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
19249 * The list of channels to be included in the invoice route hints.
19251 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
19254 * A fake scid used for representing the phantom node's fake channel in generating the invoice
19257 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
19260 * A fake scid used for representing the phantom node's fake channel in generating the invoice
19263 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
19266 * The pubkey of the real backing node that would ultimately receive the payment.
19268 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
19271 * The pubkey of the real backing node that would ultimately receive the payment.
19273 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19276 * Constructs a new PhantomRouteHints given each field
19278 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
19281 * Constructs a new ChannelManager to hold several channels and route between them.
19283 * This is the main \"logic hub\" for all channel-related actions, and implements
19284 * ChannelMessageHandler.
19286 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
19288 * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
19290 * Users need to notify the new ChannelManager when a new block is connected or
19291 * disconnected using its `block_connected` and `block_disconnected` methods, starting
19292 * from after `params.latest_hash`.
19294 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);
19297 * Gets the current configuration applied to all new channels, as
19299 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
19302 * Creates a new outbound channel to the given remote node and with the given value.
19304 * `user_channel_id` will be provided back as in
19305 * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
19306 * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to 0
19307 * for inbound channels, so you may wish to avoid using 0 for `user_channel_id` here.
19308 * `user_channel_id` has no meaning inside of LDK, it is simply copied to events and otherwise
19311 * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
19312 * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
19314 * Note that we do not check if you are currently connected to the given peer. If no
19315 * connection is available, the outbound `open_channel` message may fail to send, resulting in
19316 * the channel eventually being silently forgotten (dropped on reload).
19318 * Returns the new Channel's temporary `channel_id`. This ID will appear as
19319 * [`Event::FundingGenerationReady::temporary_channel_id`] and in
19320 * [`ChannelDetails::channel_id`] until after
19321 * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
19322 * one derived from the funding transaction's TXID. If the counterparty rejects the channel
19323 * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
19325 * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
19326 * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
19327 * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
19329 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
19331 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);
19334 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
19335 * more information.
19337 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
19340 * Gets the list of usable channels, in random order. Useful as an argument to
19341 * get_route to ensure non-announced channels are used.
19343 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
19344 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
19347 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
19350 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
19351 * will be accepted on the given channel, and after additional timeout/the closing of all
19352 * pending HTLCs, the channel will be closed on chain.
19354 * * If we are the channel initiator, we will pay between our [`Background`] and
19355 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
19357 * * If our counterparty is the channel initiator, we will require a channel closing
19358 * transaction feerate of at least our [`Background`] feerate or the feerate which
19359 * would appear on a force-closure transaction, whichever is lower. We will allow our
19360 * counterparty to pay as much fee as they'd like, however.
19362 * May generate a SendShutdown message event on success, which should be relayed.
19364 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
19365 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
19366 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
19368 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
19371 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
19372 * will be accepted on the given channel, and after additional timeout/the closing of all
19373 * pending HTLCs, the channel will be closed on chain.
19375 * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
19376 * the channel being closed or not:
19377 * * If we are the channel initiator, we will pay at least this feerate on the closing
19378 * transaction. The upper-bound is set by
19379 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
19380 * estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
19381 * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
19382 * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
19383 * will appear on a force-closure transaction, whichever is lower).
19385 * May generate a SendShutdown message event on success, which should be relayed.
19387 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
19388 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
19389 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
19391 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], uint32_t target_feerate_sats_per_1000_weight);
19394 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
19395 * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
19397 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
19400 * Force close all channels, immediately broadcasting the latest local commitment transaction
19401 * for each to the chain and rejecting new HTLCs on each.
19403 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
19406 * Sends a payment along a given route.
19408 * Value parameters are provided via the last hop in route, see documentation for RouteHop
19409 * fields for more info.
19411 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
19412 * payment), we don't do anything to stop you! We always try to ensure that if the provided
19413 * next hop knows the preimage to payment_hash they can claim an additional amount as
19414 * specified in the last hop in the route! Thus, you should probably do your own
19415 * payment_preimage tracking (which you should already be doing as they represent \"proof of
19416 * payment\") and prevent double-sends yourself.
19418 * May generate SendHTLCs message(s) event on success, which should be relayed.
19420 * Each path may have a different return value, and PaymentSendValue may return a Vec with
19421 * each entry matching the corresponding-index entry in the route paths, see
19422 * PaymentSendFailure for more info.
19424 * In general, a path may raise:
19425 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
19426 * node public key) is specified.
19427 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
19428 * (including due to previous monitor update failure or new permanent monitor update
19430 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
19431 * relevant updates.
19433 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
19434 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
19435 * different route unless you intend to pay twice!
19437 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
19438 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
19439 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
19440 * must not contain multiple paths as multi-path payments require a recipient-provided
19442 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
19443 * bit set (either as required or as available). If multiple paths are present in the Route,
19444 * we assume the invoice had the basic_mpp feature set.
19446 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
19448 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);
19451 * Retries a payment along the given [`Route`].
19453 * Errors returned are a superset of those returned from [`send_payment`], so see
19454 * [`send_payment`] documentation for more details on errors. This method will also error if the
19455 * retry amount puts the payment more than 10% over the payment's total amount, if the payment
19456 * for the given `payment_id` cannot be found (likely due to timeout or success), or if
19457 * further retries have been disabled with [`abandon_payment`].
19459 * [`send_payment`]: [`ChannelManager::send_payment`]
19460 * [`abandon_payment`]: [`ChannelManager::abandon_payment`]
19462 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);
19465 * Signals that no further retries for the given payment will occur.
19467 * After this method returns, any future calls to [`retry_payment`] for the given `payment_id`
19468 * will fail with [`PaymentSendFailure::ParameterError`]. If no such event has been generated,
19469 * an [`Event::PaymentFailed`] event will be generated as soon as there are no remaining
19470 * pending HTLCs for this payment.
19472 * Note that calling this method does *not* prevent a payment from succeeding. You must still
19473 * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
19474 * determine the ultimate status of a payment.
19476 * [`retry_payment`]: Self::retry_payment
19477 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
19478 * [`Event::PaymentSent`]: events::Event::PaymentSent
19480 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
19483 * Send a spontaneous payment, which is a payment that does not require the recipient to have
19484 * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
19485 * the preimage, it must be a cryptographically secure random value that no intermediate node
19486 * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
19487 * never reach the recipient.
19489 * See [`send_payment`] documentation for more details on the return value of this function.
19491 * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
19492 * [`send_payment`] for more information about the risks of duplicate preimage usage.
19494 * Note that `route` must have exactly one path.
19496 * [`send_payment`]: Self::send_payment
19498 * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
19500 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);
19503 * Call this upon creation of a funding transaction for the given channel.
19505 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
19506 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
19508 * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
19509 * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
19511 * May panic if the output found in the funding transaction is duplicative with some other
19512 * channel (note that this should be trivially prevented by using unique funding transaction
19513 * keys per-channel).
19515 * Do NOT broadcast the funding transaction yourself. When we have safely received our
19516 * counterparty's signature the funding transaction will automatically be broadcast via the
19517 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
19519 * Note that this includes RBF or similar transaction replacement strategies - lightning does
19520 * not currently support replacing a funding transaction on an existing channel. Instead,
19521 * create a new channel with a conflicting funding transaction.
19523 * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
19524 * [`Event::ChannelClosed`]: crate::util::events::Event::ChannelClosed
19526 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 LDKTransaction funding_transaction);
19529 * Regenerates channel_announcements and generates a signed node_announcement from the given
19530 * arguments, providing them in corresponding events via
19531 * [`get_and_clear_pending_msg_events`], if at least one public channel has been confirmed
19532 * on-chain. This effectively re-broadcasts all channel announcements and sends our node
19533 * announcement to ensure that the lightning P2P network is aware of the channels we have and
19534 * our network addresses.
19536 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
19537 * node to humans. They carry no in-protocol meaning.
19539 * `addresses` represent the set (possibly empty) of socket addresses on which this node
19540 * accepts incoming connections. These will be included in the node_announcement, publicly
19541 * tying these addresses together and to this node. If you wish to preserve user privacy,
19542 * addresses should likely contain only Tor Onion addresses.
19544 * Panics if `addresses` is absurdly large (more than 500).
19546 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
19548 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
19551 * Processes HTLCs which are pending waiting on random forward delay.
19553 * Should only really ever be called in response to a PendingHTLCsForwardable event.
19554 * Will likely generate further events.
19556 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
19559 * Performs actions which should happen on startup and roughly once per minute thereafter.
19561 * This currently includes:
19562 * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
19563 * * Broadcasting `ChannelUpdate` messages if we've been disconnected from our peer for more
19564 * than a minute, informing the network that they should no longer attempt to route over
19567 * Note that this may cause reentrancy through `chain::Watch::update_channel` calls or feerate
19568 * estimate fetches.
19570 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
19573 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
19574 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
19575 * along the path (including in our own channel on which we received it).
19576 * Returns false if no payment was found to fail backwards, true if the process of failing the
19577 * HTLC backwards has been started.
19579 MUST_USE_RES bool ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
19582 * Provides a payment preimage in response to [`Event::PaymentReceived`], generating any
19583 * [`MessageSendEvent`]s needed to claim the payment.
19585 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
19586 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
19587 * event matches your expectation. If you fail to do so and call this method, you may provide
19588 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
19590 * Returns whether any HTLCs were claimed, and thus if any new [`MessageSendEvent`]s are now
19591 * pending for processing via [`get_and_clear_pending_msg_events`].
19593 * [`Event::PaymentReceived`]: crate::util::events::Event::PaymentReceived
19594 * [`create_inbound_payment`]: Self::create_inbound_payment
19595 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
19596 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
19598 MUST_USE_RES bool ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
19601 * Gets the node_id held by this ChannelManager
19603 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
19606 * Called to accept a request to open a channel after [`Event::OpenChannelRequest`] has been
19609 * The `temporary_channel_id` parameter indicates which inbound channel should be accepted.
19611 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
19613 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32]);
19616 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
19619 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
19620 * [`PaymentHash`] and [`PaymentPreimage`] for you.
19622 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
19623 * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
19624 * passed directly to [`claim_funds`].
19626 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
19628 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
19629 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
19633 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
19634 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
19636 * Errors if `min_value_msat` is greater than total bitcoin supply.
19638 * [`claim_funds`]: Self::claim_funds
19639 * [`PaymentReceived`]: events::Event::PaymentReceived
19640 * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
19641 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
19643 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);
19646 * Legacy version of [`create_inbound_payment`]. Use this method if you wish to share
19647 * serialized state with LDK node(s) running 0.0.103 and earlier.
19650 * This method is deprecated and will be removed soon.
19652 * [`create_inbound_payment`]: Self::create_inbound_payment
19654 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);
19657 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
19658 * stored external to LDK.
19660 * A [`PaymentReceived`] event will only be generated if the [`PaymentSecret`] matches a
19661 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
19662 * the `min_value_msat` provided here, if one is provided.
19664 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
19665 * note that LDK will not stop you from registering duplicate payment hashes for inbound
19668 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
19669 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
19670 * before a [`PaymentReceived`] event will be generated, ensuring that we do not provide the
19671 * sender \"proof-of-payment\" unless they have paid the required amount.
19673 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
19674 * in excess of the current time. This should roughly match the expiry time set in the invoice.
19675 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
19676 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
19677 * invoices when no timeout is set.
19679 * Note that we use block header time to time-out pending inbound payments (with some margin
19680 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
19681 * accept a payment and generate a [`PaymentReceived`] event for some time after the expiry.
19682 * If you need exact expiry semantics, you should enforce them upon receipt of
19683 * [`PaymentReceived`].
19685 * May panic if `invoice_expiry_delta_secs` is greater than one year.
19687 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
19688 * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
19690 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
19691 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
19695 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
19696 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
19698 * Errors if `min_value_msat` is greater than total bitcoin supply.
19700 * [`create_inbound_payment`]: Self::create_inbound_payment
19701 * [`PaymentReceived`]: events::Event::PaymentReceived
19703 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);
19706 * Legacy version of [`create_inbound_payment_for_hash`]. Use this method if you wish to share
19707 * serialized state with LDK node(s) running 0.0.103 and earlier.
19710 * This method is deprecated and will be removed soon.
19712 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
19714 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);
19717 * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
19718 * previously returned from [`create_inbound_payment`].
19720 * [`create_inbound_payment`]: Self::create_inbound_payment
19722 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);
19725 * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
19726 * are used when constructing the phantom invoice's route hints.
19728 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
19730 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
19733 * Gets route hints for use in receiving [phantom node payments].
19735 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
19737 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
19740 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
19741 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
19743 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
19746 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
19747 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
19749 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
19752 * Constructs a new Listen which calls the relevant methods on this_arg.
19753 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
19755 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
19758 * Constructs a new Confirm which calls the relevant methods on this_arg.
19759 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
19761 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
19764 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
19765 * indicating whether persistence is necessary. Only one listener on
19766 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
19769 * Note that this method is not available with the `no-std` feature.
19771 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
19774 * Blocks until ChannelManager needs to be persisted. Only one listener on
19775 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
19778 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
19781 * Gets the latest best block which was connected either via the [`chain::Listen`] or
19782 * [`chain::Confirm`] interfaces.
19784 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
19787 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
19788 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
19790 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
19793 * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
19795 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
19798 * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
19800 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
19803 * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
19805 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
19808 * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
19810 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
19813 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
19815 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
19818 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
19820 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
19823 * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
19825 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
19828 * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
19830 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
19833 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
19835 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
19838 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
19840 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
19843 * The keys provider which will give us relevant keys. Some keys will be loaded during
19844 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
19847 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
19850 * The keys provider which will give us relevant keys. Some keys will be loaded during
19851 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
19854 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
19857 * The fee_estimator for use in the ChannelManager in the future.
19859 * No calls to the FeeEstimator will be made during deserialization.
19861 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
19864 * The fee_estimator for use in the ChannelManager in the future.
19866 * No calls to the FeeEstimator will be made during deserialization.
19868 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
19871 * The chain::Watch for use in the ChannelManager in the future.
19873 * No calls to the chain::Watch will be made during deserialization. It is assumed that
19874 * you have deserialized ChannelMonitors separately and will add them to your
19875 * chain::Watch after deserializing this ChannelManager.
19877 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
19880 * The chain::Watch for use in the ChannelManager in the future.
19882 * No calls to the chain::Watch will be made during deserialization. It is assumed that
19883 * you have deserialized ChannelMonitors separately and will add them to your
19884 * chain::Watch after deserializing this ChannelManager.
19886 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
19889 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
19890 * used to broadcast the latest local commitment transactions of channels which must be
19891 * force-closed during deserialization.
19893 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
19896 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
19897 * used to broadcast the latest local commitment transactions of channels which must be
19898 * force-closed during deserialization.
19900 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
19903 * The Logger for use in the ChannelManager and which may be used to log information during
19906 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
19909 * The Logger for use in the ChannelManager and which may be used to log information during
19912 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
19915 * Default settings used for new channels. Any existing channels will continue to use the
19916 * runtime settings which were stored when the ChannelManager was serialized.
19918 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
19921 * Default settings used for new channels. Any existing channels will continue to use the
19922 * runtime settings which were stored when the ChannelManager was serialized.
19924 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
19927 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
19928 * HashMap for you. This is primarily useful for C bindings where it is not practical to
19929 * populate a HashMap directly from C.
19931 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);
19934 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
19936 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
19939 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
19941 void DecodeError_free(struct LDKDecodeError this_obj);
19944 * Creates a copy of the DecodeError
19946 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
19949 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
19951 void Init_free(struct LDKInit this_obj);
19954 * The relevant features which the sender supports
19956 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
19959 * The relevant features which the sender supports
19961 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
19964 * Constructs a new Init given each field
19966 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
19969 * Creates a copy of the Init
19971 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
19974 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
19976 void ErrorMessage_free(struct LDKErrorMessage this_obj);
19979 * The channel ID involved in the error.
19981 * All-0s indicates a general error unrelated to a specific channel, after which all channels
19982 * with the sending peer should be closed.
19984 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
19987 * The channel ID involved in the error.
19989 * All-0s indicates a general error unrelated to a specific channel, after which all channels
19990 * with the sending peer should be closed.
19992 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19995 * A possibly human-readable error description.
19996 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
19997 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
19998 * the terminal emulator or the logging subsystem.
20000 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
20003 * A possibly human-readable error description.
20004 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
20005 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
20006 * the terminal emulator or the logging subsystem.
20008 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
20011 * Constructs a new ErrorMessage given each field
20013 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
20016 * Creates a copy of the ErrorMessage
20018 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
20021 * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
20023 void WarningMessage_free(struct LDKWarningMessage this_obj);
20026 * The channel ID involved in the warning.
20028 * All-0s indicates a warning unrelated to a specific channel.
20030 const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32];
20033 * The channel ID involved in the warning.
20035 * All-0s indicates a warning unrelated to a specific channel.
20037 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20040 * A possibly human-readable warning description.
20041 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
20042 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
20043 * the terminal emulator or the logging subsystem.
20045 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
20048 * A possibly human-readable warning description.
20049 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
20050 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
20051 * the terminal emulator or the logging subsystem.
20053 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
20056 * Constructs a new WarningMessage given each field
20058 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
20061 * Creates a copy of the WarningMessage
20063 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
20066 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
20068 void Ping_free(struct LDKPing this_obj);
20071 * The desired response length
20073 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
20076 * The desired response length
20078 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
20081 * The ping packet size.
20082 * This field is not sent on the wire. byteslen zeros are sent.
20084 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
20087 * The ping packet size.
20088 * This field is not sent on the wire. byteslen zeros are sent.
20090 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
20093 * Constructs a new Ping given each field
20095 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
20098 * Creates a copy of the Ping
20100 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
20103 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
20105 void Pong_free(struct LDKPong this_obj);
20108 * The pong packet size.
20109 * This field is not sent on the wire. byteslen zeros are sent.
20111 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
20114 * The pong packet size.
20115 * This field is not sent on the wire. byteslen zeros are sent.
20117 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
20120 * Constructs a new Pong given each field
20122 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
20125 * Creates a copy of the Pong
20127 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
20130 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
20132 void OpenChannel_free(struct LDKOpenChannel this_obj);
20135 * The genesis hash of the blockchain where the channel is to be opened
20137 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
20140 * The genesis hash of the blockchain where the channel is to be opened
20142 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20145 * A temporary channel ID, until the funding outpoint is announced
20147 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
20150 * A temporary channel ID, until the funding outpoint is announced
20152 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20155 * The channel value
20157 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20160 * The channel value
20162 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
20165 * The amount to push to the counterparty as part of the open, in milli-satoshi
20167 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20170 * The amount to push to the counterparty as part of the open, in milli-satoshi
20172 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
20175 * The threshold below which outputs on transactions broadcast by sender will be omitted
20177 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20180 * The threshold below which outputs on transactions broadcast by sender will be omitted
20182 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
20185 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
20187 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20190 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
20192 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
20195 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
20197 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20200 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
20202 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
20205 * The minimum HTLC size incoming to sender, in milli-satoshi
20207 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20210 * The minimum HTLC size incoming to sender, in milli-satoshi
20212 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
20215 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
20217 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20220 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
20222 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
20225 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
20227 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20230 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
20232 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
20235 * The maximum number of inbound HTLCs towards sender
20237 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20240 * The maximum number of inbound HTLCs towards sender
20242 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
20245 * The sender's key controlling the funding transaction
20247 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20250 * The sender's key controlling the funding transaction
20252 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20255 * Used to derive a revocation key for transactions broadcast by counterparty
20257 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20260 * Used to derive a revocation key for transactions broadcast by counterparty
20262 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20265 * A payment key to sender for transactions broadcast by counterparty
20267 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20270 * A payment key to sender for transactions broadcast by counterparty
20272 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20275 * Used to derive a payment key to sender for transactions broadcast by sender
20277 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20280 * Used to derive a payment key to sender for transactions broadcast by sender
20282 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20285 * Used to derive an HTLC payment key to sender
20287 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20290 * Used to derive an HTLC payment key to sender
20292 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20295 * The first to-be-broadcast-by-sender transaction's per commitment point
20297 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20300 * The first to-be-broadcast-by-sender transaction's per commitment point
20302 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20307 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20312 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
20315 * The channel type that this channel will represent. If none is set, we derive the channel
20316 * type from the intersection of our feature bits with our counterparty's feature bits from
20317 * the Init message.
20319 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20321 struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20324 * The channel type that this channel will represent. If none is set, we derive the channel
20325 * type from the intersection of our feature bits with our counterparty's feature bits from
20326 * the Init message.
20328 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
20330 void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
20333 * Creates a copy of the OpenChannel
20335 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
20338 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
20340 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
20343 * A temporary channel ID, until the funding outpoint is announced
20345 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
20348 * A temporary channel ID, until the funding outpoint is announced
20350 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20353 * The threshold below which outputs on transactions broadcast by sender will be omitted
20355 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20358 * The threshold below which outputs on transactions broadcast by sender will be omitted
20360 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
20363 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
20365 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20368 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
20370 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
20373 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
20375 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20378 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
20380 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
20383 * The minimum HTLC size incoming to sender, in milli-satoshi
20385 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20388 * The minimum HTLC size incoming to sender, in milli-satoshi
20390 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
20393 * Minimum depth of the funding transaction before the channel is considered open
20395 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20398 * Minimum depth of the funding transaction before the channel is considered open
20400 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
20403 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
20405 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20408 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
20410 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
20413 * The maximum number of inbound HTLCs towards sender
20415 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20418 * The maximum number of inbound HTLCs towards sender
20420 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
20423 * The sender's key controlling the funding transaction
20425 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20428 * The sender's key controlling the funding transaction
20430 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20433 * Used to derive a revocation key for transactions broadcast by counterparty
20435 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20438 * Used to derive a revocation key for transactions broadcast by counterparty
20440 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20443 * A payment key to sender for transactions broadcast by counterparty
20445 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20448 * A payment key to sender for transactions broadcast by counterparty
20450 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20453 * Used to derive a payment key to sender for transactions broadcast by sender
20455 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20458 * Used to derive a payment key to sender for transactions broadcast by sender
20460 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20463 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
20465 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20468 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
20470 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20473 * The first to-be-broadcast-by-sender transaction's per commitment point
20475 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20478 * The first to-be-broadcast-by-sender transaction's per commitment point
20480 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20483 * The channel type that this channel will represent. If none is set, we derive the channel
20484 * type from the intersection of our feature bits with our counterparty's feature bits from
20485 * the Init message.
20487 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
20489 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20491 struct LDKChannelTypeFeatures AcceptChannel_get_channel_type(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20494 * The channel type that this channel will represent. If none is set, we derive the channel
20495 * type from the intersection of our feature bits with our counterparty's feature bits from
20496 * the Init message.
20498 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
20500 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
20502 void AcceptChannel_set_channel_type(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
20505 * Creates a copy of the AcceptChannel
20507 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
20510 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
20512 void FundingCreated_free(struct LDKFundingCreated this_obj);
20515 * A temporary channel ID, until the funding is established
20517 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
20520 * A temporary channel ID, until the funding is established
20522 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20525 * The funding transaction ID
20527 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
20530 * The funding transaction ID
20532 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20535 * The specific output index funding this channel
20537 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
20540 * The specific output index funding this channel
20542 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
20545 * The signature of the channel initiator (funder) on the initial commitment transaction
20547 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
20550 * The signature of the channel initiator (funder) on the initial commitment transaction
20552 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
20555 * Constructs a new FundingCreated given each field
20557 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);
20560 * Creates a copy of the FundingCreated
20562 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
20565 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
20567 void FundingSigned_free(struct LDKFundingSigned this_obj);
20572 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
20577 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20580 * The signature of the channel acceptor (fundee) on the initial commitment transaction
20582 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
20585 * The signature of the channel acceptor (fundee) on the initial commitment transaction
20587 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
20590 * Constructs a new FundingSigned given each field
20592 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
20595 * Creates a copy of the FundingSigned
20597 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
20600 * Frees any resources used by the FundingLocked, if is_owned is set and inner is non-NULL.
20602 void FundingLocked_free(struct LDKFundingLocked this_obj);
20607 const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32];
20612 void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20615 * The per-commitment point of the second commitment transaction
20617 struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr);
20620 * The per-commitment point of the second commitment transaction
20622 void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20625 * Constructs a new FundingLocked given each field
20627 MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
20630 * Creates a copy of the FundingLocked
20632 struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
20635 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
20637 void Shutdown_free(struct LDKShutdown this_obj);
20642 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
20647 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20650 * The destination of this peer's funds on closing.
20651 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
20653 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
20656 * The destination of this peer's funds on closing.
20657 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
20659 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
20662 * Constructs a new Shutdown given each field
20664 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
20667 * Creates a copy of the Shutdown
20669 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
20672 * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
20674 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
20677 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
20680 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
20683 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
20686 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
20689 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
20692 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
20695 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
20698 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
20701 * Constructs a new ClosingSignedFeeRange given each field
20703 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
20706 * Creates a copy of the ClosingSignedFeeRange
20708 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
20711 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
20713 void ClosingSigned_free(struct LDKClosingSigned this_obj);
20718 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
20723 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20726 * The proposed total fee for the closing transaction
20728 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
20731 * The proposed total fee for the closing transaction
20733 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
20736 * A signature on the closing transaction
20738 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
20741 * A signature on the closing transaction
20743 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
20746 * The minimum and maximum fees which the sender is willing to accept, provided only by new
20749 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20751 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
20754 * The minimum and maximum fees which the sender is willing to accept, provided only by new
20757 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
20759 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
20762 * Constructs a new ClosingSigned given each field
20764 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);
20767 * Creates a copy of the ClosingSigned
20769 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
20772 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
20774 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
20779 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
20784 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20789 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
20794 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
20797 * The HTLC value in milli-satoshi
20799 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
20802 * The HTLC value in milli-satoshi
20804 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
20807 * The payment hash, the pre-image of which controls HTLC redemption
20809 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
20812 * The payment hash, the pre-image of which controls HTLC redemption
20814 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20817 * The expiry height of the HTLC
20819 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
20822 * The expiry height of the HTLC
20824 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
20827 * Creates a copy of the UpdateAddHTLC
20829 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
20832 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
20834 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
20839 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
20844 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20849 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
20854 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
20857 * The pre-image of the payment hash, allowing HTLC redemption
20859 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
20862 * The pre-image of the payment hash, allowing HTLC redemption
20864 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20867 * Constructs a new UpdateFulfillHTLC given each field
20869 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
20872 * Creates a copy of the UpdateFulfillHTLC
20874 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
20877 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
20879 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
20884 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
20889 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20894 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
20899 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
20902 * Creates a copy of the UpdateFailHTLC
20904 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
20907 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
20909 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
20914 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
20919 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20924 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
20929 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
20934 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
20939 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
20942 * Creates a copy of the UpdateFailMalformedHTLC
20944 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
20947 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
20949 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
20954 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
20959 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20962 * A signature on the commitment transaction
20964 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
20967 * A signature on the commitment transaction
20969 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
20972 * Signatures on the HTLC transactions
20974 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
20977 * Constructs a new CommitmentSigned given each field
20979 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
20982 * Creates a copy of the CommitmentSigned
20984 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
20987 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
20989 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
20994 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
20999 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21002 * The secret corresponding to the per-commitment point
21004 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
21007 * The secret corresponding to the per-commitment point
21009 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21012 * The next sender-broadcast commitment transaction's per-commitment point
21014 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
21017 * The next sender-broadcast commitment transaction's per-commitment point
21019 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21022 * Constructs a new RevokeAndACK given each field
21024 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);
21027 * Creates a copy of the RevokeAndACK
21029 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
21032 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
21034 void UpdateFee_free(struct LDKUpdateFee this_obj);
21039 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
21044 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21047 * Fee rate per 1000-weight of the transaction
21049 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
21052 * Fee rate per 1000-weight of the transaction
21054 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
21057 * Constructs a new UpdateFee given each field
21059 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
21062 * Creates a copy of the UpdateFee
21064 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
21067 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
21069 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
21072 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
21073 * belonging to the recipient
21075 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
21078 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
21079 * belonging to the recipient
21081 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21084 * The sender's per-commitment point for their current commitment transaction
21086 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
21089 * The sender's per-commitment point for their current commitment transaction
21091 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21094 * Constructs a new DataLossProtect given each field
21096 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
21099 * Creates a copy of the DataLossProtect
21101 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
21104 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
21106 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
21111 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
21116 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21119 * The next commitment number for the sender
21121 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
21124 * The next commitment number for the sender
21126 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
21129 * The next commitment number for the recipient
21131 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
21134 * The next commitment number for the recipient
21136 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
21139 * Creates a copy of the ChannelReestablish
21141 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
21144 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
21146 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
21151 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
21156 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21159 * The short channel ID
21161 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
21164 * The short channel ID
21166 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
21169 * A signature by the node key
21171 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
21174 * A signature by the node key
21176 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
21179 * A signature by the funding key
21181 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
21184 * A signature by the funding key
21186 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
21189 * Constructs a new AnnouncementSignatures given each field
21191 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);
21194 * Creates a copy of the AnnouncementSignatures
21196 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
21199 * Frees any resources used by the NetAddress
21201 void NetAddress_free(struct LDKNetAddress this_ptr);
21204 * Creates a copy of the NetAddress
21206 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
21209 * Utility method to constructs a new IPv4-variant NetAddress
21211 struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port);
21214 * Utility method to constructs a new IPv6-variant NetAddress
21216 struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port);
21219 * Utility method to constructs a new OnionV2-variant NetAddress
21221 struct LDKNetAddress NetAddress_onion_v2(struct LDKTwelveBytes a);
21224 * Utility method to constructs a new OnionV3-variant NetAddress
21226 struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
21229 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
21231 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
21234 * Read a NetAddress from a byte array, created by NetAddress_write
21236 struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
21239 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
21241 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
21244 * The advertised features
21246 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
21249 * The advertised features
21251 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
21254 * A strictly monotonic announcement counter, with gaps allowed
21256 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
21259 * A strictly monotonic announcement counter, with gaps allowed
21261 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
21264 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
21267 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
21270 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
21273 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21276 * An RGB color for UI purposes
21278 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
21281 * An RGB color for UI purposes
21283 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
21286 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
21289 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
21292 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
21295 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21298 * List of addresses on which this node is reachable
21300 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
21303 * Creates a copy of the UnsignedNodeAnnouncement
21305 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
21308 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
21310 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
21313 * The signature by the node key
21315 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
21318 * The signature by the node key
21320 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
21323 * The actual content of the announcement
21325 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
21328 * The actual content of the announcement
21330 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
21333 * Constructs a new NodeAnnouncement given each field
21335 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
21338 * Creates a copy of the NodeAnnouncement
21340 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
21343 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
21345 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
21348 * The advertised channel features
21350 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
21353 * The advertised channel features
21355 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
21358 * The genesis hash of the blockchain where the channel is to be opened
21360 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
21363 * The genesis hash of the blockchain where the channel is to be opened
21365 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21368 * The short channel ID
21370 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
21373 * The short channel ID
21375 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
21378 * One of the two node_ids which are endpoints of this channel
21380 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
21383 * One of the two node_ids which are endpoints of this channel
21385 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21388 * The other of the two node_ids which are endpoints of this channel
21390 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
21393 * The other of the two node_ids which are endpoints of this channel
21395 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21398 * The funding key for the first node
21400 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
21403 * The funding key for the first node
21405 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21408 * The funding key for the second node
21410 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
21413 * The funding key for the second node
21415 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21418 * Creates a copy of the UnsignedChannelAnnouncement
21420 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
21423 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
21425 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
21428 * Authentication of the announcement by the first public node
21430 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
21433 * Authentication of the announcement by the first public node
21435 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
21438 * Authentication of the announcement by the second public node
21440 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
21443 * Authentication of the announcement by the second public node
21445 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
21448 * Proof of funding UTXO ownership by the first public node
21450 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
21453 * Proof of funding UTXO ownership by the first public node
21455 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
21458 * Proof of funding UTXO ownership by the second public node
21460 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
21463 * Proof of funding UTXO ownership by the second public node
21465 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
21468 * The actual announcement
21470 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
21473 * The actual announcement
21475 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
21478 * Constructs a new ChannelAnnouncement given each field
21480 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);
21483 * Creates a copy of the ChannelAnnouncement
21485 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
21488 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
21490 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
21493 * The genesis hash of the blockchain where the channel is to be opened
21495 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
21498 * The genesis hash of the blockchain where the channel is to be opened
21500 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21503 * The short channel ID
21505 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
21508 * The short channel ID
21510 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
21513 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
21515 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
21518 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
21520 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
21525 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
21530 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
21533 * The number of blocks such that if:
21534 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
21535 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
21536 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
21537 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
21538 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
21539 * forwarding. Note that the HTLC sender is the one who originally sets this value when
21540 * constructing the route.
21542 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
21545 * The number of blocks such that if:
21546 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
21547 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
21548 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
21549 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
21550 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
21551 * forwarding. Note that the HTLC sender is the one who originally sets this value when
21552 * constructing the route.
21554 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
21557 * The minimum HTLC size incoming to sender, in milli-satoshi
21559 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
21562 * The minimum HTLC size incoming to sender, in milli-satoshi
21564 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
21567 * The base HTLC fee charged by sender, in milli-satoshi
21569 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
21572 * The base HTLC fee charged by sender, in milli-satoshi
21574 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
21577 * The amount to fee multiplier, in micro-satoshi
21579 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
21582 * The amount to fee multiplier, in micro-satoshi
21584 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
21587 * Creates a copy of the UnsignedChannelUpdate
21589 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
21592 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
21594 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
21597 * A signature of the channel update
21599 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
21602 * A signature of the channel update
21604 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
21607 * The actual channel update
21609 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
21612 * The actual channel update
21614 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
21617 * Constructs a new ChannelUpdate given each field
21619 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
21622 * Creates a copy of the ChannelUpdate
21624 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
21627 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
21629 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
21632 * The genesis hash of the blockchain being queried
21634 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
21637 * The genesis hash of the blockchain being queried
21639 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21642 * The height of the first block for the channel UTXOs being queried
21644 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
21647 * The height of the first block for the channel UTXOs being queried
21649 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
21652 * The number of blocks to include in the query results
21654 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
21657 * The number of blocks to include in the query results
21659 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
21662 * Constructs a new QueryChannelRange given each field
21664 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
21667 * Creates a copy of the QueryChannelRange
21669 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
21672 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
21674 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
21677 * The genesis hash of the blockchain being queried
21679 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
21682 * The genesis hash of the blockchain being queried
21684 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21687 * The height of the first block in the range of the reply
21689 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
21692 * The height of the first block in the range of the reply
21694 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
21697 * The number of blocks included in the range of the reply
21699 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
21702 * The number of blocks included in the range of the reply
21704 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
21707 * True when this is the final reply for a query
21709 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
21712 * True when this is the final reply for a query
21714 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
21717 * The short_channel_ids in the channel range
21719 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
21722 * Constructs a new ReplyChannelRange given each field
21724 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);
21727 * Creates a copy of the ReplyChannelRange
21729 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
21732 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
21734 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
21737 * The genesis hash of the blockchain being queried
21739 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
21742 * The genesis hash of the blockchain being queried
21744 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21747 * The short_channel_ids that are being queried
21749 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
21752 * Constructs a new QueryShortChannelIds given each field
21754 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
21757 * Creates a copy of the QueryShortChannelIds
21759 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
21762 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
21764 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
21767 * The genesis hash of the blockchain that was queried
21769 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
21772 * The genesis hash of the blockchain that was queried
21774 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21777 * Indicates if the query recipient maintains up-to-date channel
21778 * information for the chain_hash
21780 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
21783 * Indicates if the query recipient maintains up-to-date channel
21784 * information for the chain_hash
21786 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
21789 * Constructs a new ReplyShortChannelIdsEnd given each field
21791 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
21794 * Creates a copy of the ReplyShortChannelIdsEnd
21796 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
21799 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
21801 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
21804 * The genesis hash of the blockchain for channel and node information
21806 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
21809 * The genesis hash of the blockchain for channel and node information
21811 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21814 * The starting unix timestamp
21816 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
21819 * The starting unix timestamp
21821 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
21824 * The range of information in seconds
21826 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
21829 * The range of information in seconds
21831 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
21834 * Constructs a new GossipTimestampFilter given each field
21836 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
21839 * Creates a copy of the GossipTimestampFilter
21841 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
21844 * Frees any resources used by the ErrorAction
21846 void ErrorAction_free(struct LDKErrorAction this_ptr);
21849 * Creates a copy of the ErrorAction
21851 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
21854 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
21856 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
21859 * Utility method to constructs a new IgnoreError-variant ErrorAction
21861 struct LDKErrorAction ErrorAction_ignore_error(void);
21864 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
21866 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
21869 * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
21871 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
21874 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
21876 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
21879 * Utility method to constructs a new SendWarningMessage-variant ErrorAction
21881 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
21884 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
21886 void LightningError_free(struct LDKLightningError this_obj);
21889 * A human-readable message describing the error
21891 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
21894 * A human-readable message describing the error
21896 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
21899 * The action which should be taken against the offending peer.
21901 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
21904 * The action which should be taken against the offending peer.
21906 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
21909 * Constructs a new LightningError given each field
21911 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
21914 * Creates a copy of the LightningError
21916 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
21919 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
21921 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
21924 * update_add_htlc messages which should be sent
21926 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
21929 * update_add_htlc messages which should be sent
21931 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
21934 * update_fulfill_htlc messages which should be sent
21936 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
21939 * update_fulfill_htlc messages which should be sent
21941 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
21944 * update_fail_htlc messages which should be sent
21946 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
21949 * update_fail_htlc messages which should be sent
21951 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
21954 * update_fail_malformed_htlc messages which should be sent
21956 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
21959 * update_fail_malformed_htlc messages which should be sent
21961 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
21964 * An update_fee message which should be sent
21966 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21968 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
21971 * An update_fee message which should be sent
21973 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21975 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
21978 * Finally, the commitment_signed message which should be sent
21980 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
21983 * Finally, the commitment_signed message which should be sent
21985 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
21988 * Constructs a new CommitmentUpdate given each field
21990 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);
21993 * Creates a copy of the CommitmentUpdate
21995 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
21998 * Calls the free function if one is set
22000 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
22003 * Calls the free function if one is set
22005 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
22008 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
22010 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
22013 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
22015 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
22018 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
22020 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
22023 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
22025 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
22028 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
22030 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
22033 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
22035 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
22038 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
22040 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
22043 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
22045 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
22048 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
22050 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
22053 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
22055 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
22058 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
22060 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
22063 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
22065 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
22068 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
22070 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
22073 * Read a FundingCreated from a byte array, created by FundingCreated_write
22075 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
22078 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
22080 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
22083 * Read a FundingSigned from a byte array, created by FundingSigned_write
22085 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
22088 * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
22090 struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
22093 * Read a FundingLocked from a byte array, created by FundingLocked_write
22095 struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
22098 * Serialize the Init object into a byte array which can be read by Init_read
22100 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
22103 * Read a Init from a byte array, created by Init_write
22105 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
22108 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
22110 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
22113 * Read a OpenChannel from a byte array, created by OpenChannel_write
22115 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
22118 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
22120 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
22123 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
22125 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
22128 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
22130 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
22133 * Read a Shutdown from a byte array, created by Shutdown_write
22135 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
22138 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
22140 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
22143 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
22145 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
22148 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
22150 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
22153 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
22155 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
22158 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
22160 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
22163 * Read a UpdateFee from a byte array, created by UpdateFee_write
22165 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
22168 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
22170 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
22173 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
22175 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
22178 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
22180 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
22183 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
22185 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
22188 * Serialize the Ping object into a byte array which can be read by Ping_read
22190 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
22193 * Read a Ping from a byte array, created by Ping_write
22195 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
22198 * Serialize the Pong object into a byte array which can be read by Pong_read
22200 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
22203 * Read a Pong from a byte array, created by Pong_write
22205 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
22208 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
22210 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
22213 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
22215 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
22218 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
22220 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
22223 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
22225 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
22228 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
22230 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
22233 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
22235 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
22238 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
22240 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
22243 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
22245 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
22248 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
22250 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
22253 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
22255 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
22258 * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
22260 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
22263 * Read a WarningMessage from a byte array, created by WarningMessage_write
22265 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
22268 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
22270 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
22273 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
22275 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
22278 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
22280 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
22283 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
22285 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
22288 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
22290 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
22293 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
22295 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
22298 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
22300 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
22303 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
22305 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
22308 *\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
22310 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
22313 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
22315 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
22318 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
22320 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
22323 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
22325 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
22328 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
22330 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
22333 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
22335 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
22338 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
22340 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
22343 * Calls the free function if one is set
22345 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
22348 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
22350 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
22353 * Constructs a new IgnoringMessageHandler given each field
22355 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
22358 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
22359 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
22361 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
22364 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
22365 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
22367 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
22370 * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
22371 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
22373 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
22376 * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
22377 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
22379 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
22382 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
22384 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
22387 * Constructs a new ErroringMessageHandler
22389 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
22392 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
22393 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
22395 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
22398 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
22399 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
22401 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
22404 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
22406 void MessageHandler_free(struct LDKMessageHandler this_obj);
22409 * A message handler which handles messages specific to channels. Usually this is just a
22410 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
22412 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
22414 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
22417 * A message handler which handles messages specific to channels. Usually this is just a
22418 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
22420 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
22422 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
22425 * A message handler which handles messages updating our knowledge of the network channel
22426 * graph. Usually this is just a [`NetGraphMsgHandler`] object or an
22427 * [`IgnoringMessageHandler`].
22429 * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler
22431 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
22434 * A message handler which handles messages updating our knowledge of the network channel
22435 * graph. Usually this is just a [`NetGraphMsgHandler`] object or an
22436 * [`IgnoringMessageHandler`].
22438 * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler
22440 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
22443 * Constructs a new MessageHandler given each field
22445 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
22448 * Creates a copy of a SocketDescriptor
22450 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
22453 * Calls the free function if one is set
22455 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
22458 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
22460 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
22463 * Used to indicate that we probably can't make any future connections to this peer, implying
22464 * we should go ahead and force-close any channels we have with it.
22466 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
22469 * Used to indicate that we probably can't make any future connections to this peer, implying
22470 * we should go ahead and force-close any channels we have with it.
22472 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
22475 * Constructs a new PeerHandleError given each field
22477 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
22480 * Creates a copy of the PeerHandleError
22482 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
22485 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
22487 void PeerManager_free(struct LDKPeerManager this_obj);
22490 * Constructs a new PeerManager with the given message handlers and node_id secret key
22491 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
22492 * cryptographically secure random bytes.
22494 MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, struct LDKSecretKey our_node_secret, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger, struct LDKCustomMessageHandler custom_message_handler);
22497 * Get the list of node ids for peers which have completed the initial handshake.
22499 * For outbound connections, this will be the same as the their_node_id parameter passed in to
22500 * new_outbound_connection, however entries will only appear once the initial handshake has
22501 * completed and we are sure the remote peer has the private key for the given node_id.
22503 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
22506 * Indicates a new outbound connection has been established to a node with the given node_id.
22507 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
22508 * descriptor but must disconnect the connection immediately.
22510 * Returns a small number of bytes to send to the remote node (currently always 50).
22512 * Panics if descriptor is duplicative with some other descriptor which has not yet been
22513 * [`socket_disconnected()`].
22515 * [`socket_disconnected()`]: PeerManager::socket_disconnected
22517 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);
22520 * Indicates a new inbound connection has been established.
22522 * May refuse the connection by returning an Err, but will never write bytes to the remote end
22523 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
22524 * call socket_disconnected for the new descriptor but must disconnect the connection
22527 * Panics if descriptor is duplicative with some other descriptor which has not yet been
22528 * [`socket_disconnected()`].
22530 * [`socket_disconnected()`]: PeerManager::socket_disconnected
22532 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor);
22535 * Indicates that there is room to write data to the given socket descriptor.
22537 * May return an Err to indicate that the connection should be closed.
22539 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
22540 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
22541 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
22542 * ready to call `[write_buffer_space_avail`] again if a write call generated here isn't
22545 * [`send_data`]: SocketDescriptor::send_data
22546 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
22548 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
22551 * Indicates that data was read from the given socket descriptor.
22553 * May return an Err to indicate that the connection should be closed.
22555 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
22556 * Thus, however, you should call [`process_events`] after any `read_event` to generate
22557 * [`send_data`] calls to handle responses.
22559 * If `Ok(true)` is returned, further read_events should not be triggered until a
22560 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
22563 * [`send_data`]: SocketDescriptor::send_data
22564 * [`process_events`]: PeerManager::process_events
22566 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);
22569 * Checks for any events generated by our handlers and processes them. Includes sending most
22570 * response messages as well as messages generated by calls to handler functions directly (eg
22571 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
22573 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
22576 * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
22577 * or one of the other clients provided in our language bindings.
22579 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
22580 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
22581 * [`send_data`]: SocketDescriptor::send_data
22583 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
22586 * Indicates that the given socket descriptor's connection is now closed.
22588 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
22591 * Disconnect a peer given its node id.
22593 * Set `no_connection_possible` to true to prevent any further connection with this peer,
22594 * force-closing any channels we have with it.
22596 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
22597 * peer. Thus, be very careful about reentrancy issues.
22599 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
22601 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
22604 * Disconnects all currently-connected peers. This is useful on platforms where there may be
22605 * an indication that TCP sockets have stalled even if we weren't around to time them out
22606 * using regular ping/pongs.
22608 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
22611 * Send pings to each peer and disconnect those which did not respond to the last round of
22614 * This may be called on any timescale you want, however, roughly once every five to ten
22615 * seconds is preferred. The call rate determines both how often we send a ping to our peers
22616 * and how much time they have to respond before we disconnect them.
22618 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
22621 * [`send_data`]: SocketDescriptor::send_data
22623 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
22626 * Gets the weight for an HTLC-Success transaction.
22628 uint64_t htlc_success_tx_weight(bool opt_anchors);
22631 * Gets the weight for an HTLC-Timeout transaction.
22633 uint64_t htlc_timeout_tx_weight(bool opt_anchors);
22636 * Build the commitment secret from the seed and the commitment number
22638 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
22641 * Build a closing transaction
22643 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);
22646 * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
22648 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
22651 * Creates a copy of the CounterpartyCommitmentSecrets
22653 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
22656 * Creates a new empty `CounterpartyCommitmentSecrets` structure.
22658 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
22661 * Returns the minimum index of all stored secrets. Note that indexes start
22662 * at 1 << 48 and get decremented by one for each new secret.
22664 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
22667 * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
22668 * was generated in accordance with BOLT 3 and is consistent with previous secrets.
22670 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
22673 * Returns the secret at `idx`.
22674 * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
22676 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22678 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
22681 * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
22683 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
22686 * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
22688 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
22691 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
22692 * from the base secret and the per_commitment_point.
22694 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
22695 * generated (ie our own).
22697 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
22700 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
22701 * from the base point and the per_commitment_key. This is the public equivalent of
22702 * derive_private_key - using only public keys to derive a public key instead of private keys.
22704 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
22705 * generated (ie our own).
22707 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
22710 * Derives a per-commitment-transaction revocation key from its constituent parts.
22712 * Only the cheating participant owns a valid witness to propagate a revoked
22713 * commitment transaction, thus per_commitment_secret always come from cheater
22714 * and revocation_base_secret always come from punisher, which is the broadcaster
22715 * of the transaction spending with this key knowledge.
22717 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
22718 * generated (ie our own).
22720 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
22723 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
22724 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
22725 * public key instead of private keys.
22727 * Only the cheating participant owns a valid witness to propagate a revoked
22728 * commitment transaction, thus per_commitment_point always come from cheater
22729 * and revocation_base_point always come from punisher, which is the broadcaster
22730 * of the transaction spending with this key knowledge.
22732 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
22733 * generated (ie our own).
22735 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
22738 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
22740 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
22743 * The broadcaster's per-commitment public key which was used to derive the other keys.
22745 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
22748 * The broadcaster's per-commitment public key which was used to derive the other keys.
22750 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22753 * The revocation key which is used to allow the broadcaster of the commitment
22754 * transaction to provide their counterparty the ability to punish them if they broadcast
22757 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
22760 * The revocation key which is used to allow the broadcaster of the commitment
22761 * transaction to provide their counterparty the ability to punish them if they broadcast
22764 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22767 * Broadcaster's HTLC Key
22769 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
22772 * Broadcaster's HTLC Key
22774 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22777 * Countersignatory's HTLC Key
22779 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
22782 * Countersignatory's HTLC Key
22784 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22787 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
22789 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
22792 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
22794 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22797 * Constructs a new TxCreationKeys given each field
22799 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);
22802 * Creates a copy of the TxCreationKeys
22804 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
22807 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
22809 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
22812 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
22814 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
22817 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
22819 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
22822 * The public key which is used to sign all commitment transactions, as it appears in the
22823 * on-chain channel lock-in 2-of-2 multisig output.
22825 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
22828 * The public key which is used to sign all commitment transactions, as it appears in the
22829 * on-chain channel lock-in 2-of-2 multisig output.
22831 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22834 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
22835 * revocation keys. This is combined with the per-commitment-secret generated by the
22836 * counterparty to create a secret which the counterparty can reveal to revoke previous
22839 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
22842 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
22843 * revocation keys. This is combined with the per-commitment-secret generated by the
22844 * counterparty to create a secret which the counterparty can reveal to revoke previous
22847 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22850 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
22851 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
22852 * static across every commitment transaction.
22854 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
22857 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
22858 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
22859 * static across every commitment transaction.
22861 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22864 * The base point which is used (with derive_public_key) to derive a per-commitment payment
22865 * public key which receives non-HTLC-encumbered funds which are only available for spending
22866 * after some delay (or can be claimed via the revocation path).
22868 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
22871 * The base point which is used (with derive_public_key) to derive a per-commitment payment
22872 * public key which receives non-HTLC-encumbered funds which are only available for spending
22873 * after some delay (or can be claimed via the revocation path).
22875 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22878 * The base point which is used (with derive_public_key) to derive a per-commitment public key
22879 * which is used to encumber HTLC-in-flight outputs.
22881 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
22884 * The base point which is used (with derive_public_key) to derive a per-commitment public key
22885 * which is used to encumber HTLC-in-flight outputs.
22887 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22890 * Constructs a new ChannelPublicKeys given each field
22892 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);
22895 * Creates a copy of the ChannelPublicKeys
22897 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
22900 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
22902 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
22905 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
22907 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
22910 * Create per-state keys from channel base points and the per-commitment point.
22911 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
22913 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);
22916 * Generate per-state keys from channel static keys.
22917 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
22919 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);
22922 * A script either spendable by the revocation
22923 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
22924 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
22926 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
22929 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
22931 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
22934 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
22935 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
22936 * need to compare this value to whether the commitment transaction in question is that of
22937 * the counterparty or our own.
22939 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
22942 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
22943 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
22944 * need to compare this value to whether the commitment transaction in question is that of
22945 * the counterparty or our own.
22947 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
22950 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
22951 * this divided by 1000.
22953 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
22956 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
22957 * this divided by 1000.
22959 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
22962 * The CLTV lock-time at which this HTLC expires.
22964 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
22967 * The CLTV lock-time at which this HTLC expires.
22969 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
22972 * The hash of the preimage which unlocks this HTLC.
22974 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
22977 * The hash of the preimage which unlocks this HTLC.
22979 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22982 * The position within the commitment transactions' outputs. This may be None if the value is
22983 * below the dust limit (in which case no output appears in the commitment transaction and the
22984 * value is spent to additional transaction fees).
22986 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
22989 * The position within the commitment transactions' outputs. This may be None if the value is
22990 * below the dust limit (in which case no output appears in the commitment transaction and the
22991 * value is spent to additional transaction fees).
22993 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
22996 * Constructs a new HTLCOutputInCommitment given each field
22998 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);
23001 * Creates a copy of the HTLCOutputInCommitment
23003 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
23006 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
23008 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
23011 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
23013 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
23016 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
23017 * does not need to have its previous_output_index filled.
23019 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, const struct LDKTxCreationKeys *NONNULL_PTR keys);
23022 * Gets the redeemscript for a funding output from the two funding public keys.
23023 * Note that the order of funding public keys does not matter.
23025 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
23028 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
23029 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
23030 * transaction which needs signing, and can be used to construct an HTLC transaction which is
23031 * broadcastable given a counterparty HTLC signature.
23033 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
23034 * commitment transaction).
23036 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);
23039 * Gets the witnessScript for an anchor output from the funding public key.
23040 * The witness in the spending input must be:
23041 * <BIP 143 funding_signature>
23042 * After 16 blocks of confirmation, an alternative satisfying witness could be:
23044 * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
23046 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
23049 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
23051 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
23054 * Holder public keys
23056 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
23059 * Holder public keys
23061 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
23064 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
23066 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
23069 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
23071 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
23074 * Whether the holder is the initiator of this channel.
23075 * This is an input to the commitment number obscure factor computation.
23077 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
23080 * Whether the holder is the initiator of this channel.
23081 * This is an input to the commitment number obscure factor computation.
23083 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
23086 * The late-bound counterparty channel transaction parameters.
23087 * These parameters are populated at the point in the protocol where the counterparty provides them.
23089 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23091 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
23094 * The late-bound counterparty channel transaction parameters.
23095 * These parameters are populated at the point in the protocol where the counterparty provides them.
23097 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
23099 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
23102 * The late-bound funding outpoint
23104 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23106 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
23109 * The late-bound funding outpoint
23111 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
23113 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
23116 * Are anchors used for this channel. Boolean is serialization backwards-compatible
23118 enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
23121 * Are anchors used for this channel. Boolean is serialization backwards-compatible
23123 void ChannelTransactionParameters_set_opt_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
23126 * Constructs a new ChannelTransactionParameters given each field
23128 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);
23131 * Creates a copy of the ChannelTransactionParameters
23133 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
23136 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
23138 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
23141 * Counter-party public keys
23143 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
23146 * Counter-party public keys
23148 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
23151 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
23153 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
23156 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
23158 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
23161 * Constructs a new CounterpartyChannelTransactionParameters given each field
23163 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
23166 * Creates a copy of the CounterpartyChannelTransactionParameters
23168 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
23171 * Whether the late bound parameters are populated.
23173 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
23176 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
23177 * given that the holder is the broadcaster.
23179 * self.is_populated() must be true before calling this function.
23181 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
23184 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
23185 * given that the counterparty is the broadcaster.
23187 * self.is_populated() must be true before calling this function.
23189 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
23192 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
23194 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
23197 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
23199 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
23202 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
23204 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
23207 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
23209 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
23212 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
23214 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
23217 * Get the channel pubkeys for the broadcaster
23219 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
23222 * Get the channel pubkeys for the countersignatory
23224 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
23227 * Get the contest delay applicable to the transactions.
23228 * Note that the contest delay was selected by the countersignatory.
23230 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
23233 * Whether the channel is outbound from the broadcaster.
23235 * The boolean representing the side that initiated the channel is
23236 * an input to the commitment number obscure factor computation.
23238 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
23241 * The funding outpoint
23243 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
23246 * Whether to use anchors for this channel
23248 MUST_USE_RES bool DirectedChannelTransactionParameters_opt_anchors(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
23251 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
23253 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
23256 * Our counterparty's signature for the transaction
23258 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
23261 * Our counterparty's signature for the transaction
23263 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
23266 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
23268 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
23271 * Creates a copy of the HolderCommitmentTransaction
23273 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
23276 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
23278 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
23281 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
23283 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
23286 * Create a new holder transaction with the given counterparty signatures.
23287 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
23289 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);
23292 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
23294 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
23297 * The commitment transaction
23299 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
23302 * The commitment transaction
23304 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
23307 * The txid for the commitment transaction.
23309 * This is provided as a performance optimization, instead of calling transaction.txid()
23312 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
23315 * The txid for the commitment transaction.
23317 * This is provided as a performance optimization, instead of calling transaction.txid()
23320 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23323 * Constructs a new BuiltCommitmentTransaction given each field
23325 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
23328 * Creates a copy of the BuiltCommitmentTransaction
23330 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
23333 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
23335 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
23338 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
23340 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
23343 * Get the SIGHASH_ALL sighash value of the transaction.
23345 * This can be used to verify a signature.
23347 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);
23350 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
23351 * because we are about to broadcast a holder transaction.
23353 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);
23356 * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
23358 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
23361 * Creates a copy of the ClosingTransaction
23363 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
23366 * Checks if two ClosingTransactions contain equal inner contents.
23368 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
23371 * Construct an object of the class
23373 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);
23376 * Trust our pre-built transaction.
23378 * Applies a wrapper which allows access to the transaction.
23380 * This should only be used if you fully trust the builder of this object. It should not
23381 * be used by an external signer - instead use the verify function.
23383 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
23386 * Verify our pre-built transaction.
23388 * Applies a wrapper which allows access to the transaction.
23390 * An external validating signer must call this method before signing
23391 * or using the built transaction.
23393 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
23396 * The value to be sent to the holder, or zero if the output will be omitted
23398 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
23401 * The value to be sent to the counterparty, or zero if the output will be omitted
23403 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
23406 * The destination of the holder's output
23408 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
23411 * The destination of the counterparty's output
23413 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
23416 * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
23418 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
23421 * The pre-built Bitcoin commitment transaction
23423 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
23426 * Get the SIGHASH_ALL sighash value of the transaction.
23428 * This can be used to verify a signature.
23430 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);
23433 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
23434 * because we are about to broadcast a holder transaction.
23436 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);
23439 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
23441 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
23444 * Creates a copy of the CommitmentTransaction
23446 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
23449 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
23451 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
23454 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
23456 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
23459 * The backwards-counting commitment number
23461 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
23464 * The value to be sent to the broadcaster
23466 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
23469 * The value to be sent to the counterparty
23471 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
23474 * The feerate paid per 1000-weight-unit in this commitment transaction.
23476 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
23479 * Trust our pre-built transaction and derived transaction creation public keys.
23481 * Applies a wrapper which allows access to these fields.
23483 * This should only be used if you fully trust the builder of this object. It should not
23484 * be used by an external signer - instead use the verify function.
23486 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
23489 * Verify our pre-built transaction and derived transaction creation public keys.
23491 * Applies a wrapper which allows access to these fields.
23493 * An external validating signer must call this method before signing
23494 * or using the built transaction.
23496 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);
23499 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
23501 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
23504 * The transaction ID of the built Bitcoin transaction
23506 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
23509 * The pre-built Bitcoin commitment transaction
23511 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
23514 * The pre-calculated transaction creation public keys.
23516 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
23519 * Should anchors be used.
23521 MUST_USE_RES bool TrustedCommitmentTransaction_opt_anchors(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
23524 * Get a signature for each HTLC which was included in the commitment transaction (ie for
23525 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
23527 * The returned Vec has one entry for each HTLC, and in the same order.
23529 * This function is only valid in the holder commitment context, it always uses SigHashType::All.
23531 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);
23534 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
23535 * shared secret first. This prevents on-chain observers from discovering how many commitment
23536 * transactions occurred in a channel before it was closed.
23538 * This function gets the shared secret from relevant channel public keys and can be used to
23539 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
23541 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
23544 * Checks if two InitFeaturess contain equal inner contents.
23545 * This ignores pointers and is_owned flags and looks at the values in fields.
23546 * Two objects with NULL inner values will be considered "equal" here.
23548 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
23551 * Checks if two NodeFeaturess contain equal inner contents.
23552 * This ignores pointers and is_owned flags and looks at the values in fields.
23553 * Two objects with NULL inner values will be considered "equal" here.
23555 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
23558 * Checks if two ChannelFeaturess contain equal inner contents.
23559 * This ignores pointers and is_owned flags and looks at the values in fields.
23560 * Two objects with NULL inner values will be considered "equal" here.
23562 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
23565 * Checks if two InvoiceFeaturess contain equal inner contents.
23566 * This ignores pointers and is_owned flags and looks at the values in fields.
23567 * Two objects with NULL inner values will be considered "equal" here.
23569 bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b);
23572 * Checks if two ChannelTypeFeaturess contain equal inner contents.
23573 * This ignores pointers and is_owned flags and looks at the values in fields.
23574 * Two objects with NULL inner values will be considered "equal" here.
23576 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
23579 * Creates a copy of the InitFeatures
23581 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
23584 * Creates a copy of the NodeFeatures
23586 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
23589 * Creates a copy of the ChannelFeatures
23591 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
23594 * Creates a copy of the InvoiceFeatures
23596 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
23599 * Creates a copy of the ChannelTypeFeatures
23601 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
23604 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
23606 void InitFeatures_free(struct LDKInitFeatures this_obj);
23609 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
23611 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
23614 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
23616 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
23619 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
23621 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
23624 * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
23626 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
23629 * Create a blank Features with no features set
23631 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
23634 * Creates a Features with the bits set which are known by the implementation
23636 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
23639 * Returns true if this `Features` object contains unknown feature flags which are set as
23642 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
23645 * Create a blank Features with no features set
23647 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
23650 * Creates a Features with the bits set which are known by the implementation
23652 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
23655 * Returns true if this `Features` object contains unknown feature flags which are set as
23658 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
23661 * Create a blank Features with no features set
23663 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
23666 * Creates a Features with the bits set which are known by the implementation
23668 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
23671 * Returns true if this `Features` object contains unknown feature flags which are set as
23674 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
23677 * Create a blank Features with no features set
23679 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
23682 * Creates a Features with the bits set which are known by the implementation
23684 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
23687 * Returns true if this `Features` object contains unknown feature flags which are set as
23690 MUST_USE_RES bool InvoiceFeatures_requires_unknown_bits(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
23693 * Create a blank Features with no features set
23695 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
23698 * Creates a Features with the bits set which are known by the implementation
23700 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_known(void);
23703 * Returns true if this `Features` object contains unknown feature flags which are set as
23706 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
23709 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
23711 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
23714 * Read a InitFeatures from a byte array, created by InitFeatures_write
23716 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
23719 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
23721 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
23724 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
23726 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
23729 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
23731 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
23734 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
23736 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
23739 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
23741 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
23744 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
23746 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
23749 * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
23751 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
23754 * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
23756 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
23759 * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
23761 void ShutdownScript_free(struct LDKShutdownScript this_obj);
23764 * Creates a copy of the ShutdownScript
23766 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
23769 * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
23771 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
23774 * The script that did not meet the requirements from [BOLT #2].
23776 * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md
23778 struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
23781 * The script that did not meet the requirements from [BOLT #2].
23783 * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md
23785 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
23788 * Constructs a new InvalidShutdownScript given each field
23790 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
23793 * Creates a copy of the InvalidShutdownScript
23795 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
23798 * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
23800 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
23803 * Read a ShutdownScript from a byte array, created by ShutdownScript_write
23805 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
23808 * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
23810 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
23813 * Generates a P2WSH script pubkey from the given [`WScriptHash`].
23815 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
23818 * Generates a witness script pubkey from the given segwit version and program.
23820 * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
23821 * [`ShutdownScript::new_p2wsh`] instead.
23825 * This function may return an error if `program` is invalid for the segwit `version`.
23827 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(uint8_t version, struct LDKu8slice program);
23830 * Converts the shutdown script into the underlying [`Script`].
23832 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
23835 * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
23837 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23839 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
23842 * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
23844 * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
23846 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
23849 * Calls the free function if one is set
23851 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
23854 * Calls the free function if one is set
23856 void Type_free(struct LDKType this_ptr);
23859 * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
23861 void NodeId_free(struct LDKNodeId this_obj);
23864 * Creates a copy of the NodeId
23866 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
23869 * Create a new NodeId from a public key
23871 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
23874 * Get the public key slice from this NodeId
23876 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
23879 * Checks if two NodeIds contain equal inner contents.
23881 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
23884 * Serialize the NodeId object into a byte array which can be read by NodeId_read
23886 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
23889 * Read a NodeId from a byte array, created by NodeId_write
23891 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
23894 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
23896 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
23899 * Creates a copy of the NetworkGraph
23901 struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
23904 * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
23906 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
23909 * Frees any resources used by the NetworkUpdate
23911 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
23914 * Creates a copy of the NetworkUpdate
23916 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
23919 * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
23921 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
23924 * Utility method to constructs a new ChannelClosed-variant NetworkUpdate
23926 struct LDKNetworkUpdate NetworkUpdate_channel_closed(uint64_t short_channel_id, bool is_permanent);
23929 * Utility method to constructs a new NodeFailure-variant NetworkUpdate
23931 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
23934 * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
23936 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
23939 * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
23941 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
23944 * Constructs a new EventHandler which calls the relevant methods on this_arg.
23945 * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
23947 struct LDKEventHandler NetGraphMsgHandler_as_EventHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
23950 * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
23952 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
23955 * Creates a new tracker of the actual state of the network of channels and nodes,
23956 * assuming an existing Network Graph.
23957 * Chain monitor is used to make sure announced channels exist on-chain,
23958 * channel data is correct, and that the announcement is signed with
23959 * channel owners' keys.
23961 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_AccessZ chain_access, struct LDKLogger logger);
23964 * Adds a provider used to check new announcements. Does not affect
23965 * existing announcements unless they are updated.
23966 * Add, update or remove the provider would replace the current one.
23968 void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKCOption_AccessZ chain_access);
23971 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
23972 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
23974 struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
23977 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
23978 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
23980 struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
23983 * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
23985 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
23988 * When the last update to the channel direction was issued.
23989 * Value is opaque, as set in the announcement.
23991 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
23994 * When the last update to the channel direction was issued.
23995 * Value is opaque, as set in the announcement.
23997 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
24000 * Whether the channel can be currently used for payments (in this one direction).
24002 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
24005 * Whether the channel can be currently used for payments (in this one direction).
24007 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
24010 * The difference in CLTV values that you must have when routing through this channel.
24012 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
24015 * The difference in CLTV values that you must have when routing through this channel.
24017 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
24020 * The minimum value, which must be relayed to the next hop via the channel
24022 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
24025 * The minimum value, which must be relayed to the next hop via the channel
24027 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
24030 * The maximum value which may be relayed to the next hop via the channel.
24032 struct LDKCOption_u64Z ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
24035 * The maximum value which may be relayed to the next hop via the channel.
24037 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
24040 * Fees charged when the channel is used for routing
24042 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
24045 * Fees charged when the channel is used for routing
24047 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
24050 * Most recent update for the channel received from the network
24051 * Mostly redundant with the data we store in fields explicitly.
24052 * Everything else is useful only for sending out for initial routing sync.
24053 * Not stored if contains excess data to prevent DoS.
24055 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24057 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
24060 * Most recent update for the channel received from the network
24061 * Mostly redundant with the data we store in fields explicitly.
24062 * Everything else is useful only for sending out for initial routing sync.
24063 * Not stored if contains excess data to prevent DoS.
24065 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24067 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
24070 * Constructs a new ChannelUpdateInfo given each field
24072 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, struct LDKCOption_u64Z htlc_maximum_msat_arg, struct LDKRoutingFees fees_arg, struct LDKChannelUpdate last_update_message_arg);
24075 * Creates a copy of the ChannelUpdateInfo
24077 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
24080 * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
24082 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
24085 * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
24087 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
24090 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
24092 void ChannelInfo_free(struct LDKChannelInfo this_obj);
24095 * Protocol features of a channel communicated during its announcement
24097 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
24100 * Protocol features of a channel communicated during its announcement
24102 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
24105 * Source node of the first direction of a channel
24107 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
24110 * Source node of the first direction of a channel
24112 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
24115 * Details about the first direction of a channel
24117 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24119 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
24122 * Details about the first direction of a channel
24124 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24126 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
24129 * Source node of the second direction of a channel
24131 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
24134 * Source node of the second direction of a channel
24136 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
24139 * Details about the second direction of a channel
24141 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24143 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
24146 * Details about the second direction of a channel
24148 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24150 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
24153 * The channel capacity as seen on-chain, if chain lookup is available.
24155 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
24158 * The channel capacity as seen on-chain, if chain lookup is available.
24160 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
24163 * An initial announcement of the channel
24164 * Mostly redundant with the data we store in fields explicitly.
24165 * Everything else is useful only for sending out for initial routing sync.
24166 * Not stored if contains excess data to prevent DoS.
24168 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24170 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
24173 * An initial announcement of the channel
24174 * Mostly redundant with the data we store in fields explicitly.
24175 * Everything else is useful only for sending out for initial routing sync.
24176 * Not stored if contains excess data to prevent DoS.
24178 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24180 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
24183 * Creates a copy of the ChannelInfo
24185 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
24188 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
24190 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
24193 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
24195 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
24198 * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
24200 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
24203 * Creates a copy of the DirectedChannelInfo
24205 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
24208 * Returns information for the channel.
24210 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
24213 * Returns information for the direction.
24215 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24217 MUST_USE_RES struct LDKChannelUpdateInfo DirectedChannelInfo_direction(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
24220 * Returns the [`EffectiveCapacity`] of the channel in the direction.
24222 * This is either the total capacity from the funding transaction, if known, or the
24223 * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
24224 * whichever is smaller.
24226 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
24229 * Frees any resources used by the EffectiveCapacity
24231 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
24234 * Creates a copy of the EffectiveCapacity
24236 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
24239 * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
24241 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
24244 * Utility method to constructs a new MaximumHTLC-variant EffectiveCapacity
24246 struct LDKEffectiveCapacity EffectiveCapacity_maximum_htlc(uint64_t amount_msat);
24249 * Utility method to constructs a new Total-variant EffectiveCapacity
24251 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat);
24254 * Utility method to constructs a new Infinite-variant EffectiveCapacity
24256 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
24259 * Utility method to constructs a new Unknown-variant EffectiveCapacity
24261 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
24264 * Returns the effective capacity denominated in millisatoshi.
24266 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
24269 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
24271 void RoutingFees_free(struct LDKRoutingFees this_obj);
24274 * Flat routing fee in satoshis
24276 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
24279 * Flat routing fee in satoshis
24281 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
24284 * Liquidity-based routing fee in millionths of a routed amount.
24285 * In other words, 10000 is 1%.
24287 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
24290 * Liquidity-based routing fee in millionths of a routed amount.
24291 * In other words, 10000 is 1%.
24293 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
24296 * Constructs a new RoutingFees given each field
24298 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
24301 * Checks if two RoutingFeess contain equal inner contents.
24302 * This ignores pointers and is_owned flags and looks at the values in fields.
24303 * Two objects with NULL inner values will be considered "equal" here.
24305 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
24308 * Creates a copy of the RoutingFees
24310 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
24313 * Checks if two RoutingFeess contain equal inner contents.
24315 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
24318 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
24320 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
24323 * Read a RoutingFees from a byte array, created by RoutingFees_write
24325 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
24328 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
24330 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
24333 * Protocol features the node announced support for
24335 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
24338 * Protocol features the node announced support for
24340 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
24343 * When the last known update to the node state was issued.
24344 * Value is opaque, as set in the announcement.
24346 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
24349 * When the last known update to the node state was issued.
24350 * Value is opaque, as set in the announcement.
24352 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
24355 * Color assigned to the node
24357 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
24360 * Color assigned to the node
24362 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
24365 * Moniker assigned to the node.
24366 * May be invalid or malicious (eg control chars),
24367 * should not be exposed to the user.
24369 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
24372 * Moniker assigned to the node.
24373 * May be invalid or malicious (eg control chars),
24374 * should not be exposed to the user.
24376 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24379 * Internet-level addresses via which one can connect to the node
24381 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
24384 * An initial announcement of the node
24385 * Mostly redundant with the data we store in fields explicitly.
24386 * Everything else is useful only for sending out for initial routing sync.
24387 * Not stored if contains excess data to prevent DoS.
24389 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24391 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
24394 * An initial announcement of the node
24395 * Mostly redundant with the data we store in fields explicitly.
24396 * Everything else is useful only for sending out for initial routing sync.
24397 * Not stored if contains excess data to prevent DoS.
24399 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24401 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
24404 * Constructs a new NodeAnnouncementInfo given each field
24406 MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKThirtyTwoBytes alias_arg, struct LDKCVec_NetAddressZ addresses_arg, struct LDKNodeAnnouncement announcement_message_arg);
24409 * Creates a copy of the NodeAnnouncementInfo
24411 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
24414 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
24416 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
24419 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
24421 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
24424 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
24426 void NodeInfo_free(struct LDKNodeInfo this_obj);
24429 * All valid channels a node has announced
24431 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
24434 * Lowest fees enabling routing via any of the enabled, known channels to a node.
24435 * The two fields (flat and proportional fee) are independent,
24436 * meaning they don't have to refer to the same channel.
24438 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24440 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
24443 * Lowest fees enabling routing via any of the enabled, known channels to a node.
24444 * The two fields (flat and proportional fee) are independent,
24445 * meaning they don't have to refer to the same channel.
24447 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24449 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
24452 * More information about a node from node_announcement.
24453 * Optional because we store a Node entry after learning about it from
24454 * a channel announcement, but before receiving a node announcement.
24456 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24458 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
24461 * More information about a node from node_announcement.
24462 * Optional because we store a Node entry after learning about it from
24463 * a channel announcement, but before receiving a node announcement.
24465 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24467 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
24470 * Constructs a new NodeInfo given each field
24472 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
24475 * Creates a copy of the NodeInfo
24477 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
24480 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
24482 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
24485 * Read a NodeInfo from a byte array, created by NodeInfo_write
24487 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
24490 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
24492 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
24495 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
24497 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
24500 * Creates a new, empty, network graph.
24502 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
24505 * Returns a read-only view of the network graph.
24507 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
24510 * For an already known node (from channel announcements), update its stored properties from a
24511 * given node announcement.
24513 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
24514 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
24515 * routing messages from a source using a protocol other than the lightning P2P protocol.
24517 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
24520 * For an already known node (from channel announcements), update its stored properties from a
24521 * given node announcement without verifying the associated signatures. Because we aren't
24522 * given the associated signatures here we cannot relay the node announcement to any of our
24525 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);
24528 * Store or update channel info from a channel announcement.
24530 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
24531 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
24532 * routing messages from a source using a protocol other than the lightning P2P protocol.
24534 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
24535 * the corresponding UTXO exists on chain and is correctly-formatted.
24537 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);
24540 * Store or update channel info from a channel announcement without verifying the associated
24541 * signatures. Because we aren't given the associated signatures here we cannot relay the
24542 * channel announcement to any of our peers.
24544 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
24545 * the corresponding UTXO exists on chain and is correctly-formatted.
24547 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);
24550 * Close a channel if a corresponding HTLC fail was sent.
24551 * If permanent, removes a channel from the local storage.
24552 * May cause the removal of nodes too, if this was their last channel.
24553 * If not permanent, makes channels unavailable for routing.
24555 void NetworkGraph_close_channel_from_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
24558 * Marks a node in the graph as failed.
24560 void NetworkGraph_fail_node(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey _node_id, bool is_permanent);
24563 * Removes information about channels that we haven't heard any updates about in some time.
24564 * This can be used regularly to prune the network graph of channels that likely no longer
24567 * While there is no formal requirement that nodes regularly re-broadcast their channel
24568 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
24569 * pruning occur for updates which are at least two weeks old, which we implement here.
24571 * Note that for users of the `lightning-background-processor` crate this method may be
24572 * automatically called regularly for you.
24574 * This method is only available with the `std` feature. See
24575 * [`NetworkGraph::remove_stale_channels_with_time`] for `no-std` use.
24577 void NetworkGraph_remove_stale_channels(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
24580 * Removes information about channels that we haven't heard any updates about in some time.
24581 * This can be used regularly to prune the network graph of channels that likely no longer
24584 * While there is no formal requirement that nodes regularly re-broadcast their channel
24585 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
24586 * pruning occur for updates which are at least two weeks old, which we implement here.
24588 * This function takes the current unix time as an argument. For users with the `std` feature
24589 * enabled, [`NetworkGraph::remove_stale_channels`] may be preferable.
24591 void NetworkGraph_remove_stale_channels_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
24594 * For an already known (from announcement) channel, update info about one of the directions
24597 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
24598 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
24599 * routing messages from a source using a protocol other than the lightning P2P protocol.
24601 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
24602 * materially in the future will be rejected.
24604 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
24607 * For an already known (from announcement) channel, update info about one of the directions
24608 * of the channel without verifying the associated signatures. Because we aren't given the
24609 * associated signatures here we cannot relay the channel update to any of our peers.
24611 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
24612 * materially in the future will be rejected.
24614 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
24617 * Get network addresses by node id.
24618 * Returns None if the requested node is completely unknown,
24619 * or if node announcement for the node was never received.
24621 MUST_USE_RES struct LDKCOption_CVec_NetAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
24624 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
24626 void RouteHop_free(struct LDKRouteHop this_obj);
24629 * The node_id of the node at this hop.
24631 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
24634 * The node_id of the node at this hop.
24636 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24639 * The node_announcement features of the node at this hop. For the last hop, these may be
24640 * amended to match the features present in the invoice this node generated.
24642 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
24645 * The node_announcement features of the node at this hop. For the last hop, these may be
24646 * amended to match the features present in the invoice this node generated.
24648 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
24651 * The channel that should be used from the previous hop to reach this node.
24653 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
24656 * The channel that should be used from the previous hop to reach this node.
24658 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
24661 * The channel_announcement features of the channel that should be used from the previous hop
24662 * to reach this node.
24664 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
24667 * The channel_announcement features of the channel that should be used from the previous hop
24668 * to reach this node.
24670 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
24673 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
24674 * For the last hop, this should be the full value of the payment (might be more than
24675 * requested if we had to match htlc_minimum_msat).
24677 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
24680 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
24681 * For the last hop, this should be the full value of the payment (might be more than
24682 * requested if we had to match htlc_minimum_msat).
24684 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
24687 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
24688 * expected at the destination, in excess of the current block height.
24690 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
24693 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
24694 * expected at the destination, in excess of the current block height.
24696 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
24699 * Constructs a new RouteHop given each field
24701 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);
24704 * Creates a copy of the RouteHop
24706 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
24709 * Checks if two RouteHops contain equal inner contents.
24711 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
24714 * Checks if two RouteHops contain equal inner contents.
24715 * This ignores pointers and is_owned flags and looks at the values in fields.
24716 * Two objects with NULL inner values will be considered "equal" here.
24718 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
24721 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
24723 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
24726 * Read a RouteHop from a byte array, created by RouteHop_write
24728 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
24731 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
24733 void Route_free(struct LDKRoute this_obj);
24736 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
24737 * last RouteHop in each path must be the same.
24738 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
24739 * destination. Thus, this must always be at least length one. While the maximum length of any
24740 * given path is variable, keeping the length of any path to less than 20 should currently
24741 * ensure it is viable.
24743 struct LDKCVec_CVec_RouteHopZZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
24746 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
24747 * last RouteHop in each path must be the same.
24748 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
24749 * destination. Thus, this must always be at least length one. While the maximum length of any
24750 * given path is variable, keeping the length of any path to less than 20 should currently
24751 * ensure it is viable.
24753 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
24756 * The `payment_params` parameter passed to [`find_route`].
24757 * This is used by `ChannelManager` to track information which may be required for retries,
24758 * provided back to you via [`Event::PaymentPathFailed`].
24760 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
24762 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24764 struct LDKPaymentParameters Route_get_payment_params(const struct LDKRoute *NONNULL_PTR this_ptr);
24767 * The `payment_params` parameter passed to [`find_route`].
24768 * This is used by `ChannelManager` to track information which may be required for retries,
24769 * provided back to you via [`Event::PaymentPathFailed`].
24771 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
24773 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24775 void Route_set_payment_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
24778 * Constructs a new Route given each field
24780 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg, struct LDKPaymentParameters payment_params_arg);
24783 * Creates a copy of the Route
24785 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
24788 * Checks if two Routes contain equal inner contents.
24790 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
24793 * Checks if two Routes contain equal inner contents.
24794 * This ignores pointers and is_owned flags and looks at the values in fields.
24795 * Two objects with NULL inner values will be considered "equal" here.
24797 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
24800 * Returns the total amount of fees paid on this [`Route`].
24802 * This doesn't include any extra payment made to the recipient, which can happen in excess of
24803 * the amount passed to [`find_route`]'s `params.final_value_msat`.
24805 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
24808 * Returns the total amount paid on this [`Route`], excluding the fees.
24810 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
24813 * Serialize the Route object into a byte array which can be read by Route_read
24815 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
24818 * Read a Route from a byte array, created by Route_write
24820 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
24823 * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
24825 void RouteParameters_free(struct LDKRouteParameters this_obj);
24828 * The parameters of the failed payment path.
24830 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
24833 * The parameters of the failed payment path.
24835 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
24838 * The amount in msats sent on the failed payment path.
24840 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
24843 * The amount in msats sent on the failed payment path.
24845 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
24848 * The CLTV on the final hop of the failed payment path.
24850 uint32_t RouteParameters_get_final_cltv_expiry_delta(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
24853 * The CLTV on the final hop of the failed payment path.
24855 void RouteParameters_set_final_cltv_expiry_delta(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint32_t val);
24858 * Constructs a new RouteParameters given each field
24860 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);
24863 * Creates a copy of the RouteParameters
24865 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
24868 * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
24870 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
24873 * Read a RouteParameters from a byte array, created by RouteParameters_write
24875 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
24878 * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
24880 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
24883 * The node id of the payee.
24885 struct LDKPublicKey PaymentParameters_get_payee_pubkey(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
24888 * The node id of the payee.
24890 void PaymentParameters_set_payee_pubkey(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24893 * Features supported by the payee.
24895 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
24896 * does not contain any features.
24898 * [`for_keysend`]: Self::for_keysend
24900 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24902 struct LDKInvoiceFeatures PaymentParameters_get_features(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
24905 * Features supported by the payee.
24907 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
24908 * does not contain any features.
24910 * [`for_keysend`]: Self::for_keysend
24912 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24914 void PaymentParameters_set_features(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKInvoiceFeatures val);
24917 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
24919 struct LDKCVec_RouteHintZ PaymentParameters_get_route_hints(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
24922 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
24924 void PaymentParameters_set_route_hints(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintZ val);
24927 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
24929 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
24932 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
24934 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
24937 * The maximum total CLTV delta we accept for the route.
24939 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
24942 * The maximum total CLTV delta we accept for the route.
24944 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
24947 * Constructs a new PaymentParameters given each field
24949 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);
24952 * Creates a copy of the PaymentParameters
24954 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
24957 * Checks if two PaymentParameterss contain equal inner contents.
24959 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
24962 * Checks if two PaymentParameterss contain equal inner contents.
24963 * This ignores pointers and is_owned flags and looks at the values in fields.
24964 * Two objects with NULL inner values will be considered "equal" here.
24966 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
24969 * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
24971 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
24974 * Read a PaymentParameters from a byte array, created by PaymentParameters_write
24976 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser);
24979 * Creates a payee with the node id of the given `pubkey`.
24981 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey);
24984 * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
24986 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey);
24989 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
24991 void RouteHint_free(struct LDKRouteHint this_obj);
24993 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
24995 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
24998 * Constructs a new RouteHint given each field
25000 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
25003 * Creates a copy of the RouteHint
25005 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
25008 * Checks if two RouteHints contain equal inner contents.
25010 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
25013 * Checks if two RouteHints contain equal inner contents.
25014 * This ignores pointers and is_owned flags and looks at the values in fields.
25015 * Two objects with NULL inner values will be considered "equal" here.
25017 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
25020 * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
25022 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
25025 * Read a RouteHint from a byte array, created by RouteHint_write
25027 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
25030 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
25032 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
25035 * The node_id of the non-target end of the route
25037 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
25040 * The node_id of the non-target end of the route
25042 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25045 * The short_channel_id of this channel
25047 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
25050 * The short_channel_id of this channel
25052 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
25055 * The fees which must be paid to use this channel
25057 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
25060 * The fees which must be paid to use this channel
25062 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
25065 * The difference in CLTV values between this node and the next node.
25067 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
25070 * The difference in CLTV values between this node and the next node.
25072 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
25075 * The minimum value, in msat, which must be relayed to the next hop.
25077 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
25080 * The minimum value, in msat, which must be relayed to the next hop.
25082 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
25085 * The maximum value in msat available for routing with a single HTLC.
25087 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
25090 * The maximum value in msat available for routing with a single HTLC.
25092 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
25095 * Constructs a new RouteHintHop given each field
25097 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);
25100 * Creates a copy of the RouteHintHop
25102 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
25105 * Checks if two RouteHintHops contain equal inner contents.
25107 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
25110 * Checks if two RouteHintHops contain equal inner contents.
25111 * This ignores pointers and is_owned flags and looks at the values in fields.
25112 * Two objects with NULL inner values will be considered "equal" here.
25114 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
25117 * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
25119 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
25122 * Read a RouteHintHop from a byte array, created by RouteHintHop_write
25124 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
25127 * Finds a route from us (payer) to the given target node (payee).
25129 * If the payee provided features in their invoice, they should be provided via `params.payee`.
25130 * Without this, MPP will only be used if the payee's features are available in the network graph.
25132 * Private routing paths between a public node and the target may be included in `params.payee`.
25134 * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
25135 * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of our local
25136 * channels from [`NetworkGraph`] will be ignored, and only those in `first_hops` will be used.
25138 * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
25139 * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
25140 * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
25144 * May be used to re-compute a [`Route`] when handling a [`Event::PaymentPathFailed`]. Any
25145 * adjustments to the [`NetworkGraph`] and channel scores should be made prior to calling this
25150 * Panics if first_hops contains channels without short_channel_ids;
25151 * [`ChannelManager::list_usable_channels`] will never include such channels.
25153 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
25154 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
25156 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
25158 struct LDKCResult_RouteLightningErrorZ find_route(struct LDKPublicKey our_node_pubkey, const struct LDKRouteParameters *NONNULL_PTR route_params, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKLogger logger, const struct LDKScore *NONNULL_PTR scorer);
25161 * Calls the free function if one is set
25163 void Score_free(struct LDKScore this_ptr);
25166 * Calls the free function if one is set
25168 void LockableScore_free(struct LDKLockableScore this_ptr);
25171 * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
25173 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
25176 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
25178 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
25181 * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
25183 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
25186 * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
25188 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
25191 * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
25193 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser);
25196 * Creates a new scorer using `penalty_msat`.
25198 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
25201 * Constructs a new Score which calls the relevant methods on this_arg.
25202 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
25204 struct LDKScore FixedPenaltyScorer_as_Score(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
25207 * Frees any resources used by the Scorer, if is_owned is set and inner is non-NULL.
25209 void Scorer_free(struct LDKScorer this_obj);
25212 * Frees any resources used by the ScoringParameters, if is_owned is set and inner is non-NULL.
25214 void ScoringParameters_free(struct LDKScoringParameters this_obj);
25217 * A fixed penalty in msats to apply to each channel.
25219 * Default value: 500 msat
25221 uint64_t ScoringParameters_get_base_penalty_msat(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
25224 * A fixed penalty in msats to apply to each channel.
25226 * Default value: 500 msat
25228 void ScoringParameters_set_base_penalty_msat(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
25231 * A penalty in msats to apply to a channel upon failing to relay a payment.
25233 * This accumulates for each failure but may be reduced over time based on
25234 * [`failure_penalty_half_life`] or when successfully routing through a channel.
25236 * Default value: 1,024,000 msat
25238 * [`failure_penalty_half_life`]: Self::failure_penalty_half_life
25240 uint64_t ScoringParameters_get_failure_penalty_msat(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
25243 * A penalty in msats to apply to a channel upon failing to relay a payment.
25245 * This accumulates for each failure but may be reduced over time based on
25246 * [`failure_penalty_half_life`] or when successfully routing through a channel.
25248 * Default value: 1,024,000 msat
25250 * [`failure_penalty_half_life`]: Self::failure_penalty_half_life
25252 void ScoringParameters_set_failure_penalty_msat(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
25255 * When the amount being sent over a channel is this many 1024ths of the total channel
25256 * capacity, we begin applying [`overuse_penalty_msat_per_1024th`].
25258 * Default value: 128 1024ths (i.e. begin penalizing when an HTLC uses 1/8th of a channel)
25260 * [`overuse_penalty_msat_per_1024th`]: Self::overuse_penalty_msat_per_1024th
25262 uint16_t ScoringParameters_get_overuse_penalty_start_1024th(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
25265 * When the amount being sent over a channel is this many 1024ths of the total channel
25266 * capacity, we begin applying [`overuse_penalty_msat_per_1024th`].
25268 * Default value: 128 1024ths (i.e. begin penalizing when an HTLC uses 1/8th of a channel)
25270 * [`overuse_penalty_msat_per_1024th`]: Self::overuse_penalty_msat_per_1024th
25272 void ScoringParameters_set_overuse_penalty_start_1024th(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint16_t val);
25275 * A penalty applied, per whole 1024ths of the channel capacity which the amount being sent
25276 * over the channel exceeds [`overuse_penalty_start_1024th`] by.
25278 * Default value: 20 msat (i.e. 2560 msat penalty to use 1/4th of a channel, 7680 msat penalty
25279 * to use half a channel, and 12,560 msat penalty to use 3/4ths of a channel)
25281 * [`overuse_penalty_start_1024th`]: Self::overuse_penalty_start_1024th
25283 uint64_t ScoringParameters_get_overuse_penalty_msat_per_1024th(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
25286 * A penalty applied, per whole 1024ths of the channel capacity which the amount being sent
25287 * over the channel exceeds [`overuse_penalty_start_1024th`] by.
25289 * Default value: 20 msat (i.e. 2560 msat penalty to use 1/4th of a channel, 7680 msat penalty
25290 * to use half a channel, and 12,560 msat penalty to use 3/4ths of a channel)
25292 * [`overuse_penalty_start_1024th`]: Self::overuse_penalty_start_1024th
25294 void ScoringParameters_set_overuse_penalty_msat_per_1024th(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
25297 * The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are
25300 * Successfully routing through a channel will immediately cut the penalty in half as well.
25302 * Default value: 1 hour
25306 * When built with the `no-std` feature, time will never elapse. Therefore, this penalty will
25309 * [`failure_penalty_msat`]: Self::failure_penalty_msat
25311 uint64_t ScoringParameters_get_failure_penalty_half_life(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
25314 * The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are
25317 * Successfully routing through a channel will immediately cut the penalty in half as well.
25319 * Default value: 1 hour
25323 * When built with the `no-std` feature, time will never elapse. Therefore, this penalty will
25326 * [`failure_penalty_msat`]: Self::failure_penalty_msat
25328 void ScoringParameters_set_failure_penalty_half_life(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
25331 * Constructs a new ScoringParameters given each field
25333 MUST_USE_RES struct LDKScoringParameters ScoringParameters_new(uint64_t base_penalty_msat_arg, uint64_t failure_penalty_msat_arg, uint16_t overuse_penalty_start_1024th_arg, uint64_t overuse_penalty_msat_per_1024th_arg, uint64_t failure_penalty_half_life_arg);
25336 * Serialize the ScoringParameters object into a byte array which can be read by ScoringParameters_read
25338 struct LDKCVec_u8Z ScoringParameters_write(const struct LDKScoringParameters *NONNULL_PTR obj);
25341 * Read a ScoringParameters from a byte array, created by ScoringParameters_write
25343 struct LDKCResult_ScoringParametersDecodeErrorZ ScoringParameters_read(struct LDKu8slice ser);
25346 * Creates a new scorer using the given scoring parameters.
25348 MUST_USE_RES struct LDKScorer Scorer_new(struct LDKScoringParameters params);
25351 * Creates a "default" Scorer. See struct and individual field documentaiton for details on which values are used.
25353 MUST_USE_RES struct LDKScorer Scorer_default(void);
25356 * Creates a "default" ScoringParameters. See struct and individual field documentaiton for details on which values are used.
25358 MUST_USE_RES struct LDKScoringParameters ScoringParameters_default(void);
25361 * Constructs a new Score which calls the relevant methods on this_arg.
25362 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
25364 struct LDKScore Scorer_as_Score(const struct LDKScorer *NONNULL_PTR this_arg);
25367 * Serialize the Scorer object into a byte array which can be read by Scorer_read
25369 struct LDKCVec_u8Z Scorer_write(const struct LDKScorer *NONNULL_PTR obj);
25372 * Read a Scorer from a byte array, created by Scorer_write
25374 struct LDKCResult_ScorerDecodeErrorZ Scorer_read(struct LDKu8slice ser);
25377 * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
25379 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
25382 * Frees any resources used by the ProbabilisticScoringParameters, if is_owned is set and inner is non-NULL.
25384 void ProbabilisticScoringParameters_free(struct LDKProbabilisticScoringParameters this_obj);
25387 * A multiplier used to determine the amount in msats willing to be paid to avoid routing
25388 * through a channel, as per multiplying by the negative `log10` of the channel's success
25389 * probability for a payment.
25391 * The success probability is determined by the effective channel capacity, the payment amount,
25392 * and knowledge learned from prior successful and unsuccessful payments. The lower bound of
25393 * the success probability is 0.01, effectively limiting the penalty to the range
25394 * `0..=2*liquidity_penalty_multiplier_msat`. The knowledge learned is decayed over time based
25395 * on [`liquidity_offset_half_life`].
25397 * Default value: 10,000 msat
25399 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
25401 uint64_t ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
25404 * A multiplier used to determine the amount in msats willing to be paid to avoid routing
25405 * through a channel, as per multiplying by the negative `log10` of the channel's success
25406 * probability for a payment.
25408 * The success probability is determined by the effective channel capacity, the payment amount,
25409 * and knowledge learned from prior successful and unsuccessful payments. The lower bound of
25410 * the success probability is 0.01, effectively limiting the penalty to the range
25411 * `0..=2*liquidity_penalty_multiplier_msat`. The knowledge learned is decayed over time based
25412 * on [`liquidity_offset_half_life`].
25414 * Default value: 10,000 msat
25416 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
25418 void ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
25421 * The time required to elapse before any knowledge learned about channel liquidity balances is
25424 * The bounds are defined in terms of offsets and are initially zero. Increasing the offsets
25425 * gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases
25426 * the certainty of the channel liquidity balance.
25428 * Default value: 1 hour
25432 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
25433 * liquidity knowledge will never decay except when the bounds cross.
25435 uint64_t ProbabilisticScoringParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
25438 * The time required to elapse before any knowledge learned about channel liquidity balances is
25441 * The bounds are defined in terms of offsets and are initially zero. Increasing the offsets
25442 * gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases
25443 * the certainty of the channel liquidity balance.
25445 * Default value: 1 hour
25449 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
25450 * liquidity knowledge will never decay except when the bounds cross.
25452 void ProbabilisticScoringParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
25455 * Constructs a new ProbabilisticScoringParameters given each field
25457 MUST_USE_RES struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_new(uint64_t liquidity_penalty_multiplier_msat_arg, uint64_t liquidity_offset_half_life_arg);
25460 * Creates a copy of the ProbabilisticScoringParameters
25462 struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_clone(const struct LDKProbabilisticScoringParameters *NONNULL_PTR orig);
25465 * Serialize the ProbabilisticScoringParameters object into a byte array which can be read by ProbabilisticScoringParameters_read
25467 struct LDKCVec_u8Z ProbabilisticScoringParameters_write(const struct LDKProbabilisticScoringParameters *NONNULL_PTR obj);
25470 * Read a ProbabilisticScoringParameters from a byte array, created by ProbabilisticScoringParameters_write
25472 struct LDKCResult_ProbabilisticScoringParametersDecodeErrorZ ProbabilisticScoringParameters_read(struct LDKu8slice ser);
25475 * Creates a new scorer using the given scoring parameters for sending payments from a node
25476 * through a network graph.
25478 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringParameters params, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
25481 * Creates a "default" ProbabilisticScoringParameters. See struct and individual field documentaiton for details on which values are used.
25483 MUST_USE_RES struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_default(void);
25486 * Constructs a new Score which calls the relevant methods on this_arg.
25487 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
25489 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
25492 * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
25494 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
25497 * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
25499 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKC2Tuple_ProbabilisticScoringParametersNetworkGraphZ arg);
25502 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
25504 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
25507 * Initialize a new FilesystemPersister and set the path to the individual channels'
25510 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
25513 * Get the directory which was provided when this persister was initialized.
25515 MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
25518 * Writes the provided `ChannelManager` to the path provided at `FilesystemPersister`
25519 * initialization, within a file called \"manager\".
25521 MUST_USE_RES struct LDKCResult_NoneErrorZ FilesystemPersister_persist_manager(struct LDKStr data_dir, const struct LDKChannelManager *NONNULL_PTR manager);
25524 * Read `ChannelMonitor`s from disk.
25526 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
25529 * Constructs a new Persist which calls the relevant methods on this_arg.
25530 * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
25532 struct LDKPersist FilesystemPersister_as_Persist(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
25535 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
25537 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
25540 * Calls the free function if one is set
25542 void ChannelManagerPersister_free(struct LDKChannelManagerPersister this_ptr);
25545 * Start a background thread that takes care of responsibilities enumerated in the [top-level
25548 * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
25549 * `persist_manager` returns an error. In case of an error, the error is retrieved by calling
25550 * either [`join`] or [`stop`].
25552 * # Data Persistence
25554 * `persist_manager` is responsible for writing out the [`ChannelManager`] to disk, and/or
25555 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
25556 * [`ChannelManager`]. See [`FilesystemPersister::persist_manager`] for Rust-Lightning's
25557 * provided implementation.
25559 * Typically, users should either implement [`ChannelManagerPersister`] to never return an
25560 * error or call [`join`] and handle any error that may arise. For the latter case,
25561 * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
25565 * `event_handler` is responsible for handling events that users should be notified of (e.g.,
25566 * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
25567 * functionality implemented by other handlers.
25568 * * [`NetGraphMsgHandler`] if given will update the [`NetworkGraph`] based on payment failures.
25570 * [top-level documentation]: BackgroundProcessor
25571 * [`join`]: Self::join
25572 * [`stop`]: Self::stop
25573 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
25574 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
25575 * [`FilesystemPersister::persist_manager`]: lightning_persister::FilesystemPersister::persist_manager
25576 * [`NetworkGraph`]: lightning::routing::network_graph::NetworkGraph
25578 * Note that net_graph_msg_handler (or a relevant inner pointer) may be NULL or all-0s to represent None
25580 MUST_USE_RES struct LDKBackgroundProcessor BackgroundProcessor_start(struct LDKChannelManagerPersister persister, struct LDKEventHandler event_handler, const struct LDKChainMonitor *NONNULL_PTR chain_monitor, const struct LDKChannelManager *NONNULL_PTR channel_manager, struct LDKNetGraphMsgHandler net_graph_msg_handler, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger);
25583 * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
25584 * [`ChannelManager`].
25588 * This function panics if the background thread has panicked such as while persisting or
25591 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
25593 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
25596 * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
25597 * [`ChannelManager`].
25601 * This function panics if the background thread has panicked such as while persisting or
25604 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
25606 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
25609 * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
25611 void Invoice_free(struct LDKInvoice this_obj);
25614 * Checks if two Invoices contain equal inner contents.
25615 * This ignores pointers and is_owned flags and looks at the values in fields.
25616 * Two objects with NULL inner values will be considered "equal" here.
25618 bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
25621 * Creates a copy of the Invoice
25623 struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
25626 * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
25628 void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
25631 * Checks if two SignedRawInvoices contain equal inner contents.
25632 * This ignores pointers and is_owned flags and looks at the values in fields.
25633 * Two objects with NULL inner values will be considered "equal" here.
25635 bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b);
25638 * Creates a copy of the SignedRawInvoice
25640 struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
25643 * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
25645 void RawInvoice_free(struct LDKRawInvoice this_obj);
25650 struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
25655 void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
25658 * Checks if two RawInvoices contain equal inner contents.
25659 * This ignores pointers and is_owned flags and looks at the values in fields.
25660 * Two objects with NULL inner values will be considered "equal" here.
25662 bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b);
25665 * Creates a copy of the RawInvoice
25667 struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
25670 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
25672 void RawDataPart_free(struct LDKRawDataPart this_obj);
25675 * generation time of the invoice
25677 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
25680 * generation time of the invoice
25682 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
25685 * Checks if two RawDataParts contain equal inner contents.
25686 * This ignores pointers and is_owned flags and looks at the values in fields.
25687 * Two objects with NULL inner values will be considered "equal" here.
25689 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
25692 * Creates a copy of the RawDataPart
25694 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
25697 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
25699 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
25702 * Checks if two PositiveTimestamps contain equal inner contents.
25703 * This ignores pointers and is_owned flags and looks at the values in fields.
25704 * Two objects with NULL inner values will be considered "equal" here.
25706 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
25709 * Creates a copy of the PositiveTimestamp
25711 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
25714 * Creates a copy of the SiPrefix
25716 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
25719 * Utility method to constructs a new Milli-variant SiPrefix
25721 enum LDKSiPrefix SiPrefix_milli(void);
25724 * Utility method to constructs a new Micro-variant SiPrefix
25726 enum LDKSiPrefix SiPrefix_micro(void);
25729 * Utility method to constructs a new Nano-variant SiPrefix
25731 enum LDKSiPrefix SiPrefix_nano(void);
25734 * Utility method to constructs a new Pico-variant SiPrefix
25736 enum LDKSiPrefix SiPrefix_pico(void);
25739 * Checks if two SiPrefixs contain equal inner contents.
25740 * This ignores pointers and is_owned flags and looks at the values in fields.
25742 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
25745 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
25746 * This is effectively 10^12 * the prefix multiplier
25748 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
25751 * Creates a copy of the Currency
25753 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
25756 * Utility method to constructs a new Bitcoin-variant Currency
25758 enum LDKCurrency Currency_bitcoin(void);
25761 * Utility method to constructs a new BitcoinTestnet-variant Currency
25763 enum LDKCurrency Currency_bitcoin_testnet(void);
25766 * Utility method to constructs a new Regtest-variant Currency
25768 enum LDKCurrency Currency_regtest(void);
25771 * Utility method to constructs a new Simnet-variant Currency
25773 enum LDKCurrency Currency_simnet(void);
25776 * Utility method to constructs a new Signet-variant Currency
25778 enum LDKCurrency Currency_signet(void);
25781 * Checks if two Currencys contain equal inner contents.
25783 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
25786 * Checks if two Currencys contain equal inner contents.
25787 * This ignores pointers and is_owned flags and looks at the values in fields.
25789 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
25792 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
25794 void Sha256_free(struct LDKSha256 this_obj);
25797 * Creates a copy of the Sha256
25799 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
25802 * Checks if two Sha256s contain equal inner contents.
25804 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
25807 * Checks if two Sha256s contain equal inner contents.
25808 * This ignores pointers and is_owned flags and looks at the values in fields.
25809 * Two objects with NULL inner values will be considered "equal" here.
25811 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
25814 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
25816 void Description_free(struct LDKDescription this_obj);
25819 * Creates a copy of the Description
25821 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
25824 * Checks if two Descriptions contain equal inner contents.
25826 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
25829 * Checks if two Descriptions contain equal inner contents.
25830 * This ignores pointers and is_owned flags and looks at the values in fields.
25831 * Two objects with NULL inner values will be considered "equal" here.
25833 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
25836 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
25838 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
25840 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
25842 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25845 * Constructs a new PayeePubKey given each field
25847 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
25850 * Creates a copy of the PayeePubKey
25852 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
25855 * Checks if two PayeePubKeys contain equal inner contents.
25857 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
25860 * Checks if two PayeePubKeys contain equal inner contents.
25861 * This ignores pointers and is_owned flags and looks at the values in fields.
25862 * Two objects with NULL inner values will be considered "equal" here.
25864 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
25867 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
25869 void ExpiryTime_free(struct LDKExpiryTime this_obj);
25872 * Creates a copy of the ExpiryTime
25874 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
25877 * Checks if two ExpiryTimes contain equal inner contents.
25879 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
25882 * Checks if two ExpiryTimes contain equal inner contents.
25883 * This ignores pointers and is_owned flags and looks at the values in fields.
25884 * Two objects with NULL inner values will be considered "equal" here.
25886 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
25889 * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
25891 void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
25893 uint64_t MinFinalCltvExpiry_get_a(const struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr);
25895 void MinFinalCltvExpiry_set_a(struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr, uint64_t val);
25898 * Constructs a new MinFinalCltvExpiry given each field
25900 MUST_USE_RES struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_new(uint64_t a_arg);
25903 * Creates a copy of the MinFinalCltvExpiry
25905 struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
25908 * Checks if two MinFinalCltvExpirys contain equal inner contents.
25910 uint64_t MinFinalCltvExpiry_hash(const struct LDKMinFinalCltvExpiry *NONNULL_PTR o);
25913 * Checks if two MinFinalCltvExpirys contain equal inner contents.
25914 * This ignores pointers and is_owned flags and looks at the values in fields.
25915 * Two objects with NULL inner values will be considered "equal" here.
25917 bool MinFinalCltvExpiry_eq(const struct LDKMinFinalCltvExpiry *NONNULL_PTR a, const struct LDKMinFinalCltvExpiry *NONNULL_PTR b);
25920 * Frees any resources used by the Fallback
25922 void Fallback_free(struct LDKFallback this_ptr);
25925 * Creates a copy of the Fallback
25927 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
25930 * Utility method to constructs a new SegWitProgram-variant Fallback
25932 struct LDKFallback Fallback_seg_wit_program(struct LDKu5 version, struct LDKCVec_u8Z program);
25935 * Utility method to constructs a new PubKeyHash-variant Fallback
25937 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
25940 * Utility method to constructs a new ScriptHash-variant Fallback
25942 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
25945 * Checks if two Fallbacks contain equal inner contents.
25947 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
25950 * Checks if two Fallbacks contain equal inner contents.
25951 * This ignores pointers and is_owned flags and looks at the values in fields.
25953 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
25956 * Frees any resources used by the InvoiceSignature, if is_owned is set and inner is non-NULL.
25958 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
25961 * Creates a copy of the InvoiceSignature
25963 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
25966 * Checks if two InvoiceSignatures contain equal inner contents.
25967 * This ignores pointers and is_owned flags and looks at the values in fields.
25968 * Two objects with NULL inner values will be considered "equal" here.
25970 bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b);
25973 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
25975 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
25978 * Creates a copy of the PrivateRoute
25980 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
25983 * Checks if two PrivateRoutes contain equal inner contents.
25985 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
25988 * Checks if two PrivateRoutes contain equal inner contents.
25989 * This ignores pointers and is_owned flags and looks at the values in fields.
25990 * Two objects with NULL inner values will be considered "equal" here.
25992 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
25995 * Disassembles the `SignedRawInvoice` into its three parts:
25997 * 2. hash of the raw invoice
26000 MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg);
26003 * The `RawInvoice` which was signed.
26005 MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
26008 * The hash of the `RawInvoice` that was signed.
26010 MUST_USE_RES const uint8_t (*SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32];
26013 * InvoiceSignature for the invoice.
26015 MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
26018 * Recovers the public key used for signing the invoice from the recoverable signature.
26020 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
26023 * Checks if the signature is valid for the included payee public key or if none exists if it's
26024 * valid for the recovered signature (which should always be true?).
26026 MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
26029 * Calculate the hash of the encoded `RawInvoice`
26031 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26035 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26037 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26041 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26043 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26047 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26049 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26053 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26055 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26059 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26061 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26065 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26067 MUST_USE_RES struct LDKMinFinalCltvExpiry RawInvoice_min_final_cltv_expiry(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26071 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26073 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26077 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26079 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26081 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawInvoice_private_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26083 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26085 MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26088 * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
26090 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
26092 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
26095 * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
26096 * the range `0..=MAX_TIMESTAMP`.
26098 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
26100 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
26103 * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
26104 * `0..=MAX_TIMESTAMP`.
26106 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
26108 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
26111 * Returns the Unix timestamp representing the stored time
26113 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
26116 * Returns the duration of the stored time since the Unix epoch
26118 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
26121 * Returns the [`SystemTime`] representing the stored time
26123 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
26126 * Transform the `Invoice` into it's unchecked version
26128 MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg);
26131 * Check that the invoice is signed correctly and that key recovery works
26133 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
26136 * Constructs an `Invoice` from a `SignedRawInvoice` by checking all its invariants.
26138 * use lightning_invoice::*;
26140 * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
26141 * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
26142 * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
26143 * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
26144 * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
26145 * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
26146 * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
26147 * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
26148 * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
26149 * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
26150 * j5r6drg6k6zcqj0fcwg\";
26152 * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
26154 * assert!(Invoice::from_signed(signed).is_ok());
26157 MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice);
26160 * Returns the `Invoice`'s timestamp (should equal its creation time)
26162 MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg);
26165 * Returns the `Invoice`'s timestamp as a duration since the Unix epoch
26167 MUST_USE_RES uint64_t Invoice_duration_since_epoch(const struct LDKInvoice *NONNULL_PTR this_arg);
26170 * Returns the hash to which we will receive the preimage on completion of the payment
26172 MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
26175 * Get the payee's public key if one was included in the invoice
26177 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26179 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
26182 * Get the payment secret if one was included in the invoice
26184 MUST_USE_RES const uint8_t (*Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
26187 * Get the invoice features if they were included in the invoice
26189 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26191 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
26194 * Recover the payee's public key (only to be used if none was included in the invoice)
26196 MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
26199 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
26201 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
26204 * Returns whether the invoice has expired.
26206 MUST_USE_RES bool Invoice_is_expired(const struct LDKInvoice *NONNULL_PTR this_arg);
26209 * Returns whether the expiry time would pass at the given point in time.
26210 * `at_time` is the timestamp as a duration since the Unix epoch.
26212 MUST_USE_RES bool Invoice_would_expire(const struct LDKInvoice *NONNULL_PTR this_arg, uint64_t at_time);
26215 * Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
26216 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`].
26218 MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
26221 * Returns a list of all routes included in the invoice
26223 MUST_USE_RES struct LDKCVec_PrivateRouteZ Invoice_private_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
26226 * Returns a list of all routes included in the invoice as the underlying hints
26228 MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_route_hints(const struct LDKInvoice *NONNULL_PTR this_arg);
26231 * Returns the currency for which the invoice was issued
26233 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
26236 * Returns the amount if specified in the invoice as millisatoshis.
26238 MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_milli_satoshis(const struct LDKInvoice *NONNULL_PTR this_arg);
26241 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
26242 * returns `CreationError::DescriptionTooLong` otherwise
26244 * Please note that single characters may use more than one byte due to UTF8 encoding.
26246 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
26249 * Returns the underlying description `String`
26251 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
26254 * Construct an `ExpiryTime` from seconds.
26256 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
26259 * Construct an `ExpiryTime` from a `Duration`.
26261 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
26264 * Returns the expiry time in seconds
26266 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
26269 * Returns a reference to the underlying `Duration` (=expiry time)
26271 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
26274 * Creates a new (partial) route from a list of hops
26276 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
26279 * Returns the underlying list of hops
26281 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
26284 * Creates a copy of the CreationError
26286 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
26289 * Utility method to constructs a new DescriptionTooLong-variant CreationError
26291 enum LDKCreationError CreationError_description_too_long(void);
26294 * Utility method to constructs a new RouteTooLong-variant CreationError
26296 enum LDKCreationError CreationError_route_too_long(void);
26299 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
26301 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
26304 * Utility method to constructs a new InvalidAmount-variant CreationError
26306 enum LDKCreationError CreationError_invalid_amount(void);
26309 * Utility method to constructs a new MissingRouteHints-variant CreationError
26311 enum LDKCreationError CreationError_missing_route_hints(void);
26314 * Checks if two CreationErrors contain equal inner contents.
26315 * This ignores pointers and is_owned flags and looks at the values in fields.
26317 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
26320 * Get the string representation of a CreationError object
26322 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
26325 * Creates a copy of the SemanticError
26327 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
26330 * Utility method to constructs a new NoPaymentHash-variant SemanticError
26332 enum LDKSemanticError SemanticError_no_payment_hash(void);
26335 * Utility method to constructs a new MultiplePaymentHashes-variant SemanticError
26337 enum LDKSemanticError SemanticError_multiple_payment_hashes(void);
26340 * Utility method to constructs a new NoDescription-variant SemanticError
26342 enum LDKSemanticError SemanticError_no_description(void);
26345 * Utility method to constructs a new MultipleDescriptions-variant SemanticError
26347 enum LDKSemanticError SemanticError_multiple_descriptions(void);
26350 * Utility method to constructs a new NoPaymentSecret-variant SemanticError
26352 enum LDKSemanticError SemanticError_no_payment_secret(void);
26355 * Utility method to constructs a new MultiplePaymentSecrets-variant SemanticError
26357 enum LDKSemanticError SemanticError_multiple_payment_secrets(void);
26360 * Utility method to constructs a new InvalidFeatures-variant SemanticError
26362 enum LDKSemanticError SemanticError_invalid_features(void);
26365 * Utility method to constructs a new InvalidRecoveryId-variant SemanticError
26367 enum LDKSemanticError SemanticError_invalid_recovery_id(void);
26370 * Utility method to constructs a new InvalidSignature-variant SemanticError
26372 enum LDKSemanticError SemanticError_invalid_signature(void);
26375 * Utility method to constructs a new ImpreciseAmount-variant SemanticError
26377 enum LDKSemanticError SemanticError_imprecise_amount(void);
26380 * Checks if two SemanticErrors contain equal inner contents.
26381 * This ignores pointers and is_owned flags and looks at the values in fields.
26383 bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b);
26386 * Get the string representation of a SemanticError object
26388 struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
26391 * Frees any resources used by the SignOrCreationError
26393 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
26396 * Creates a copy of the SignOrCreationError
26398 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
26401 * Utility method to constructs a new SignError-variant SignOrCreationError
26403 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
26406 * Utility method to constructs a new CreationError-variant SignOrCreationError
26408 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
26411 * Checks if two SignOrCreationErrors contain equal inner contents.
26412 * This ignores pointers and is_owned flags and looks at the values in fields.
26414 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
26417 * Get the string representation of a SignOrCreationError object
26419 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
26422 * Frees any resources used by the InvoicePayer, if is_owned is set and inner is non-NULL.
26424 void InvoicePayer_free(struct LDKInvoicePayer this_obj);
26427 * Calls the free function if one is set
26429 void Payer_free(struct LDKPayer this_ptr);
26432 * Calls the free function if one is set
26434 void Router_free(struct LDKRouter this_ptr);
26437 * Frees any resources used by the RetryAttempts, if is_owned is set and inner is non-NULL.
26439 void RetryAttempts_free(struct LDKRetryAttempts this_obj);
26441 uintptr_t RetryAttempts_get_a(const struct LDKRetryAttempts *NONNULL_PTR this_ptr);
26443 void RetryAttempts_set_a(struct LDKRetryAttempts *NONNULL_PTR this_ptr, uintptr_t val);
26446 * Constructs a new RetryAttempts given each field
26448 MUST_USE_RES struct LDKRetryAttempts RetryAttempts_new(uintptr_t a_arg);
26451 * Creates a copy of the RetryAttempts
26453 struct LDKRetryAttempts RetryAttempts_clone(const struct LDKRetryAttempts *NONNULL_PTR orig);
26456 * Checks if two RetryAttemptss contain equal inner contents.
26457 * This ignores pointers and is_owned flags and looks at the values in fields.
26458 * Two objects with NULL inner values will be considered "equal" here.
26460 bool RetryAttempts_eq(const struct LDKRetryAttempts *NONNULL_PTR a, const struct LDKRetryAttempts *NONNULL_PTR b);
26463 * Checks if two RetryAttemptss contain equal inner contents.
26465 uint64_t RetryAttempts_hash(const struct LDKRetryAttempts *NONNULL_PTR o);
26468 * Frees any resources used by the PaymentError
26470 void PaymentError_free(struct LDKPaymentError this_ptr);
26473 * Creates a copy of the PaymentError
26475 struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig);
26478 * Utility method to constructs a new Invoice-variant PaymentError
26480 struct LDKPaymentError PaymentError_invoice(struct LDKStr a);
26483 * Utility method to constructs a new Routing-variant PaymentError
26485 struct LDKPaymentError PaymentError_routing(struct LDKLightningError a);
26488 * Utility method to constructs a new Sending-variant PaymentError
26490 struct LDKPaymentError PaymentError_sending(struct LDKPaymentSendFailure a);
26493 * Creates an invoice payer that retries failed payment paths.
26495 * Will forward any [`Event::PaymentPathFailed`] events to the decorated `event_handler` once
26496 * `retry_attempts` has been exceeded for a given [`Invoice`].
26498 MUST_USE_RES struct LDKInvoicePayer InvoicePayer_new(struct LDKPayer payer, struct LDKRouter router, const struct LDKMultiThreadedLockableScore *NONNULL_PTR scorer, struct LDKLogger logger, struct LDKEventHandler event_handler, struct LDKRetryAttempts retry_attempts);
26501 * Pays the given [`Invoice`], caching it for later use in case a retry is needed.
26503 * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
26504 * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
26507 MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice);
26510 * Pays the given zero-value [`Invoice`] using the given amount, caching it for later use in
26511 * case a retry is needed.
26513 * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
26514 * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
26517 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);
26520 * Pays `pubkey` an amount using the hash of the given preimage, caching it for later use in
26521 * case a retry is needed.
26523 * You should ensure that `payment_preimage` is unique and that its `payment_hash` has never
26524 * been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so for you.
26526 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);
26529 * Removes the payment cached by the given payment hash.
26531 * Should be called once a payment has failed or succeeded if not using [`InvoicePayer`] as an
26532 * [`EventHandler`]. Otherwise, calling this method is unnecessary.
26534 void InvoicePayer_remove_cached_payment(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
26537 * Constructs a new EventHandler which calls the relevant methods on this_arg.
26538 * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
26540 struct LDKEventHandler InvoicePayer_as_EventHandler(const struct LDKInvoicePayer *NONNULL_PTR this_arg);
26543 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
26544 * See [`PhantomKeysManager`] for more information on phantom node payments.
26546 * `phantom_route_hints` parameter:
26547 * * Contains channel info for all nodes participating in the phantom invoice
26548 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
26549 * participating node
26550 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
26551 * updated when a channel becomes disabled or closes
26552 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
26553 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
26556 * `payment_hash` and `payment_secret` come from [`ChannelManager::create_inbound_payment`] or
26557 * [`ChannelManager::create_inbound_payment_for_hash`]. These values can be retrieved from any
26558 * participating node.
26560 * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom
26561 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
26564 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
26565 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
26566 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
26568 struct LDKCResult_InvoiceSignOrCreationErrorZ create_phantom_invoice(struct LDKCOption_u64Z amt_msat, struct LDKStr description, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKKeysInterface keys_manager, enum LDKCurrency network);
26571 * Utility to construct an invoice. Generally, unless you want to do something like a custom
26572 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
26573 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
26574 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
26575 * that the payment secret is valid when the invoice is paid.
26577 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);
26580 * See [`create_invoice_from_channelmanager`]
26581 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
26582 * available and the current time is supplied by the caller.
26584 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);
26587 * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
26589 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
26592 * Creates a new router using the given [`NetworkGraph`] and [`Logger`].
26594 MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
26597 * Constructs a new Router which calls the relevant methods on this_arg.
26598 * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
26600 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
26603 * Constructs a new Payer which calls the relevant methods on this_arg.
26604 * This copies the `inner` pointer in this_arg and thus the returned Payer must be freed before this_arg is
26606 struct LDKPayer ChannelManager_as_Payer(const struct LDKChannelManager *NONNULL_PTR this_arg);
26609 * Read a SiPrefix object from a string
26611 struct LDKCResult_SiPrefixNoneZ SiPrefix_from_str(struct LDKStr s);
26614 * Read a Invoice object from a string
26616 struct LDKCResult_InvoiceNoneZ Invoice_from_str(struct LDKStr s);
26619 * Read a SignedRawInvoice object from a string
26621 struct LDKCResult_SignedRawInvoiceNoneZ SignedRawInvoice_from_str(struct LDKStr s);
26624 * Get the string representation of a Invoice object
26626 struct LDKStr Invoice_to_str(const struct LDKInvoice *NONNULL_PTR o);
26629 * Get the string representation of a SignedRawInvoice object
26631 struct LDKStr SignedRawInvoice_to_str(const struct LDKSignedRawInvoice *NONNULL_PTR o);
26634 * Get the string representation of a Currency object
26636 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
26639 * Get the string representation of a SiPrefix object
26641 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
26643 #endif /* LDK_C_BINDINGS_H */
26645 #include "ldk_ver.h"