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;
2774 * Features used within the channel_type field in an OpenChannel message.
2776 * A channel is always of some known \"type\", describing the transaction formats used and the exact
2777 * semantics of our interaction with our peer.
2779 * Note that because a channel is a specific type which is proposed by the opener and accepted by
2780 * the counterparty, only required features are allowed here.
2782 * This is serialized differently from other feature types - it is not prefixed by a length, and
2783 * thus must only appear inside a TLV where its length is known in advance.
2785 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
2787 * A pointer to the opaque Rust object.
2788 * Nearly everywhere, inner must be non-null, however in places where
2789 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2791 LDKnativeChannelTypeFeatures *inner;
2793 * Indicates that this is the only struct which contains the same pointer.
2794 * Rust functions which take ownership of an object provided via an argument require
2795 * this to be true and invalidate the object pointed to by inner.
2798 } LDKChannelTypeFeatures;
2801 * An Event which you should probably take some action in response to.
2803 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
2804 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
2805 * written as it makes no sense to respond to it after reconnecting to peers).
2807 typedef enum LDKEvent_Tag {
2809 * Used to indicate that the client should generate a funding transaction with the given
2810 * parameters and then call [`ChannelManager::funding_transaction_generated`].
2811 * Generated in [`ChannelManager`] message handling.
2812 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
2813 * counterparty can steal your funds!
2815 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2816 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
2818 LDKEvent_FundingGenerationReady,
2820 * Indicates we've received money! Just gotta dig out that payment preimage and feed it to
2821 * [`ChannelManager::claim_funds`] to get it....
2822 * Note that if the preimage is not known, you should call
2823 * [`ChannelManager::fail_htlc_backwards`] to free up resources for this HTLC and avoid
2824 * network congestion.
2825 * If you fail to call either [`ChannelManager::claim_funds`] or
2826 * [`ChannelManager::fail_htlc_backwards`] within the HTLC's timeout, the HTLC will be
2827 * automatically failed.
2830 * LDK will not stop an inbound payment from being paid multiple times, so multiple
2831 * `PaymentReceived` events may be generated for the same payment.
2833 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2834 * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
2836 LDKEvent_PaymentReceived,
2838 * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
2839 * and we got back the payment preimage for it).
2841 * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
2842 * event. In this situation, you SHOULD treat this payment as having succeeded.
2844 LDKEvent_PaymentSent,
2846 * Indicates an outbound HTLC we sent failed. Probably some intermediary node dropped
2847 * something. You may wish to retry with a different route.
2849 * Note that this does *not* indicate that all paths for an MPP payment have failed, see
2850 * [`Event::PaymentFailed`] and [`all_paths_failed`].
2852 * [`all_paths_failed`]: Self::PaymentPathFailed::all_paths_failed
2854 LDKEvent_PaymentPathFailed,
2856 * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
2857 * provide failure information for each MPP part in the payment.
2859 * This event is provided once there are no further pending HTLCs for the payment and the
2860 * payment is no longer retryable, either due to a several-block timeout or because
2861 * [`ChannelManager::abandon_payment`] was previously called for the corresponding payment.
2863 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
2865 LDKEvent_PaymentFailed,
2867 * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
2868 * a time in the future.
2870 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
2872 LDKEvent_PendingHTLCsForwardable,
2874 * Used to indicate that an output which you should know how to spend was confirmed on chain
2875 * and is now spendable.
2876 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
2877 * counterparty spending them due to some kind of timeout. Thus, you need to store them
2878 * somewhere and spend them when you create on-chain transactions.
2880 LDKEvent_SpendableOutputs,
2882 * This event is generated when a payment has been successfully forwarded through us and a
2883 * forwarding fee earned.
2885 LDKEvent_PaymentForwarded,
2887 * Used to indicate that a channel with the given `channel_id` is in the process of closure.
2889 LDKEvent_ChannelClosed,
2891 * Used to indicate to the user that they can abandon the funding transaction and recycle the
2892 * inputs for another purpose.
2894 LDKEvent_DiscardFunding,
2896 * Indicates that a path for an outbound payment was successful.
2898 * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
2899 * [`Event::PaymentSent`] for obtaining the payment preimage.
2901 LDKEvent_PaymentPathSuccessful,
2903 * Indicates a request to open a new channel by a peer.
2905 * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the
2906 * request, call [`ChannelManager::force_close_channel`].
2908 * The event is only triggered when a new open channel request is received and the
2909 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
2911 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
2912 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel
2913 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
2915 LDKEvent_OpenChannelRequest,
2917 * Must be last for serialization purposes
2922 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
2924 * The random channel_id we picked which you'll need to pass into
2925 * ChannelManager::funding_transaction_generated.
2927 struct LDKThirtyTwoBytes temporary_channel_id;
2929 * The value, in satoshis, that the output should have.
2931 uint64_t channel_value_satoshis;
2933 * The script which should be used in the transaction output.
2935 struct LDKCVec_u8Z output_script;
2937 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or 0 for
2938 * an inbound channel.
2940 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
2942 uint64_t user_channel_id;
2943 } LDKEvent_LDKFundingGenerationReady_Body;
2945 typedef struct LDKEvent_LDKPaymentReceived_Body {
2947 * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
2948 * not stop you from registering duplicate payment hashes for inbound payments.
2950 struct LDKThirtyTwoBytes payment_hash;
2952 * The value, in thousandths of a satoshi, that this payment is for.
2956 * Information for claiming this received payment, based on whether the purpose of the
2957 * payment is to pay an invoice or to send a spontaneous payment.
2959 struct LDKPaymentPurpose purpose;
2960 } LDKEvent_LDKPaymentReceived_Body;
2962 typedef struct LDKEvent_LDKPaymentSent_Body {
2964 * The id returned by [`ChannelManager::send_payment`] and used with
2965 * [`ChannelManager::retry_payment`].
2967 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
2968 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
2970 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2972 struct LDKThirtyTwoBytes payment_id;
2974 * The preimage to the hash given to ChannelManager::send_payment.
2975 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
2978 struct LDKThirtyTwoBytes payment_preimage;
2980 * The hash that was given to [`ChannelManager::send_payment`].
2982 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
2984 struct LDKThirtyTwoBytes payment_hash;
2986 * The total fee which was spent at intermediate hops in this payment, across all paths.
2988 * Note that, like [`Route::get_total_fees`] this does *not* include any potential
2989 * overpayment to the recipient node.
2991 * If the recipient or an intermediate node misbehaves and gives us free money, this may
2992 * overstate the amount paid, though this is unlikely.
2994 * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
2996 struct LDKCOption_u64Z fee_paid_msat;
2997 } LDKEvent_LDKPaymentSent_Body;
2999 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
3001 * The id returned by [`ChannelManager::send_payment`] and used with
3002 * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
3004 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3005 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3006 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3008 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3010 struct LDKThirtyTwoBytes payment_id;
3012 * The hash that was given to [`ChannelManager::send_payment`].
3014 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3016 struct LDKThirtyTwoBytes payment_hash;
3018 * Indicates the payment was rejected for some reason by the recipient. This implies that
3019 * the payment has failed, not just the route in question. If this is not set, you may
3020 * retry the payment via a different route.
3022 bool rejected_by_dest;
3024 * Any failure information conveyed via the Onion return packet by a node along the failed
3027 * Should be applied to the [`NetworkGraph`] so that routing decisions can take into
3028 * account the update. [`NetGraphMsgHandler`] is capable of doing this.
3030 * [`NetworkGraph`]: crate::routing::network_graph::NetworkGraph
3031 * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler
3033 struct LDKCOption_NetworkUpdateZ network_update;
3035 * For both single-path and multi-path payments, this is set if all paths of the payment have
3036 * failed. This will be set to false if (1) this is an MPP payment and (2) other parts of the
3037 * larger MPP payment were still in flight when this event was generated.
3039 * Note that if you are retrying individual MPP parts, using this value to determine if a
3040 * payment has fully failed is race-y. Because multiple failures can happen prior to events
3041 * being processed, you may retry in response to a first failure, with a second failure
3042 * (with `all_paths_failed` set) still pending. Then, when the second failure is processed
3043 * you will see `all_paths_failed` set even though the retry of the first failure still
3044 * has an associated in-flight HTLC. See (1) for an example of such a failure.
3046 * If you wish to retry individual MPP parts and learn when a payment has failed, you must
3047 * call [`ChannelManager::abandon_payment`] and wait for a [`Event::PaymentFailed`] event.
3049 * (1) <https://github.com/lightningdevkit/rust-lightning/issues/1164>
3051 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3053 bool all_paths_failed;
3055 * The payment path that failed.
3057 struct LDKCVec_RouteHopZ path;
3059 * The channel responsible for the failed payment path.
3061 * If this is `Some`, then the corresponding channel should be avoided when the payment is
3062 * retried. May be `None` for older [`Event`] serializations.
3064 struct LDKCOption_u64Z short_channel_id;
3066 * Parameters needed to compute a new [`Route`] when retrying the failed payment path.
3068 * See [`find_route`] for details.
3070 * [`Route`]: crate::routing::router::Route
3071 * [`find_route`]: crate::routing::router::find_route
3073 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3075 struct LDKRouteParameters retry;
3076 } LDKEvent_LDKPaymentPathFailed_Body;
3078 typedef struct LDKEvent_LDKPaymentFailed_Body {
3080 * The id returned by [`ChannelManager::send_payment`] and used with
3081 * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
3083 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3084 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3085 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3087 struct LDKThirtyTwoBytes payment_id;
3089 * The hash that was given to [`ChannelManager::send_payment`].
3091 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3093 struct LDKThirtyTwoBytes payment_hash;
3094 } LDKEvent_LDKPaymentFailed_Body;
3096 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
3098 * The minimum amount of time that should be waited prior to calling
3099 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
3100 * you should wait a random amount of time in roughly the range (now + time_forwardable,
3101 * now + 5*time_forwardable).
3103 uint64_t time_forwardable;
3104 } LDKEvent_LDKPendingHTLCsForwardable_Body;
3106 typedef struct LDKEvent_LDKSpendableOutputs_Body {
3108 * The outputs which you should store as spendable by you.
3110 struct LDKCVec_SpendableOutputDescriptorZ outputs;
3111 } LDKEvent_LDKSpendableOutputs_Body;
3113 typedef struct LDKEvent_LDKPaymentForwarded_Body {
3115 * The fee, in milli-satoshis, which was earned as a result of the payment.
3117 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
3118 * was pending, the amount the next hop claimed will have been rounded down to the nearest
3119 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
3120 * claimed the full value in millisatoshis from the source. In this case,
3121 * `claim_from_onchain_tx` will be set.
3123 * If the channel which sent us the payment has been force-closed, we will claim the funds
3124 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
3125 * fees which we will spend and will instead set this to `None`. It is possible duplicate
3126 * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
3129 struct LDKCOption_u64Z fee_earned_msat;
3131 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
3134 bool claim_from_onchain_tx;
3135 } LDKEvent_LDKPaymentForwarded_Body;
3137 typedef struct LDKEvent_LDKChannelClosed_Body {
3139 * The channel_id of the channel which has been closed. Note that on-chain transactions
3140 * resolving the channel are likely still awaiting confirmation.
3142 struct LDKThirtyTwoBytes channel_id;
3144 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
3145 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
3146 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
3147 * `user_channel_id` will be 0 for an inbound channel.
3148 * This will always be zero for objects serialized with LDK versions prior to 0.0.102.
3150 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
3151 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3152 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
3154 uint64_t user_channel_id;
3156 * The reason the channel was closed.
3158 struct LDKClosureReason reason;
3159 } LDKEvent_LDKChannelClosed_Body;
3161 typedef struct LDKEvent_LDKDiscardFunding_Body {
3163 * The channel_id of the channel which has been closed.
3165 struct LDKThirtyTwoBytes channel_id;
3167 * The full transaction received from the user
3169 struct LDKTransaction transaction;
3170 } LDKEvent_LDKDiscardFunding_Body;
3172 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
3174 * The id returned by [`ChannelManager::send_payment`] and used with
3175 * [`ChannelManager::retry_payment`].
3177 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3178 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3180 struct LDKThirtyTwoBytes payment_id;
3182 * The hash that was given to [`ChannelManager::send_payment`].
3184 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3186 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3188 struct LDKThirtyTwoBytes payment_hash;
3190 * The payment path that was successful.
3192 * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
3194 struct LDKCVec_RouteHopZ path;
3195 } LDKEvent_LDKPaymentPathSuccessful_Body;
3197 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
3199 * The temporary channel ID of the channel requested to be opened.
3201 * When responding to the request, the `temporary_channel_id` should be passed
3202 * back to the ChannelManager with [`ChannelManager::accept_inbound_channel`] to accept,
3203 * or to [`ChannelManager::force_close_channel`] to reject.
3205 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3206 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel
3208 struct LDKThirtyTwoBytes temporary_channel_id;
3210 * The node_id of the counterparty requesting to open the channel.
3212 struct LDKPublicKey counterparty_node_id;
3214 * The channel value of the requested channel.
3216 uint64_t funding_satoshis;
3218 * Our starting balance in the channel if the request is accepted, in milli-satoshi.
3222 * The features that this channel will operate with. If you reject the channel, a
3223 * well-behaved counterparty may automatically re-attempt the channel with a new set of
3226 * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
3227 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
3230 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3232 struct LDKChannelTypeFeatures channel_type;
3233 } LDKEvent_LDKOpenChannelRequest_Body;
3235 typedef struct MUST_USE_STRUCT LDKEvent {
3238 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
3239 LDKEvent_LDKPaymentReceived_Body payment_received;
3240 LDKEvent_LDKPaymentSent_Body payment_sent;
3241 LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
3242 LDKEvent_LDKPaymentFailed_Body payment_failed;
3243 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
3244 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
3245 LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
3246 LDKEvent_LDKChannelClosed_Body channel_closed;
3247 LDKEvent_LDKDiscardFunding_Body discard_funding;
3248 LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
3249 LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
3254 * An enum which can either contain a crate::lightning::util::events::Event or not
3256 typedef enum LDKCOption_EventZ_Tag {
3258 * When we're in this state, this COption_EventZ contains a crate::lightning::util::events::Event
3260 LDKCOption_EventZ_Some,
3262 * When we're in this state, this COption_EventZ contains nothing
3264 LDKCOption_EventZ_None,
3266 * Must be last for serialization purposes
3268 LDKCOption_EventZ_Sentinel,
3269 } LDKCOption_EventZ_Tag;
3271 typedef struct LDKCOption_EventZ {
3272 LDKCOption_EventZ_Tag tag;
3275 struct LDKEvent some;
3278 } LDKCOption_EventZ;
3281 * The contents of CResult_COption_EventZDecodeErrorZ
3283 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
3285 * A pointer to the contents in the success state.
3286 * Reading from this pointer when `result_ok` is not set is undefined.
3288 struct LDKCOption_EventZ *result;
3290 * A pointer to the contents in the error state.
3291 * Reading from this pointer when `result_ok` is set is undefined.
3293 struct LDKDecodeError *err;
3294 } LDKCResult_COption_EventZDecodeErrorZPtr;
3297 * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
3298 * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
3299 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3301 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
3303 * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
3304 * `err` or `result` depending on the state of `result_ok`.
3306 union LDKCResult_COption_EventZDecodeErrorZPtr contents;
3308 * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
3311 } LDKCResult_COption_EventZDecodeErrorZ;
3316 * An accept_channel message to be sent or received from a peer
3318 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
3320 * A pointer to the opaque Rust object.
3321 * Nearly everywhere, inner must be non-null, however in places where
3322 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3324 LDKnativeAcceptChannel *inner;
3326 * Indicates that this is the only struct which contains the same pointer.
3327 * Rust functions which take ownership of an object provided via an argument require
3328 * this to be true and invalidate the object pointed to by inner.
3336 * An open_channel message to be sent or received from a peer
3338 typedef struct MUST_USE_STRUCT LDKOpenChannel {
3340 * A pointer to the opaque Rust object.
3341 * Nearly everywhere, inner must be non-null, however in places where
3342 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3344 LDKnativeOpenChannel *inner;
3346 * Indicates that this is the only struct which contains the same pointer.
3347 * Rust functions which take ownership of an object provided via an argument require
3348 * this to be true and invalidate the object pointed to by inner.
3356 * A funding_created message to be sent or received from a peer
3358 typedef struct MUST_USE_STRUCT LDKFundingCreated {
3360 * A pointer to the opaque Rust object.
3361 * Nearly everywhere, inner must be non-null, however in places where
3362 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3364 LDKnativeFundingCreated *inner;
3366 * Indicates that this is the only struct which contains the same pointer.
3367 * Rust functions which take ownership of an object provided via an argument require
3368 * this to be true and invalidate the object pointed to by inner.
3371 } LDKFundingCreated;
3376 * A funding_signed message to be sent or received from a peer
3378 typedef struct MUST_USE_STRUCT LDKFundingSigned {
3380 * A pointer to the opaque Rust object.
3381 * Nearly everywhere, inner must be non-null, however in places where
3382 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3384 LDKnativeFundingSigned *inner;
3386 * Indicates that this is the only struct which contains the same pointer.
3387 * Rust functions which take ownership of an object provided via an argument require
3388 * this to be true and invalidate the object pointed to by inner.
3396 * A funding_locked message to be sent or received from a peer
3398 typedef struct MUST_USE_STRUCT LDKFundingLocked {
3400 * A pointer to the opaque Rust object.
3401 * Nearly everywhere, inner must be non-null, however in places where
3402 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3404 LDKnativeFundingLocked *inner;
3406 * Indicates that this is the only struct which contains the same pointer.
3407 * Rust functions which take ownership of an object provided via an argument require
3408 * this to be true and invalidate the object pointed to by inner.
3416 * An announcement_signatures message to be sent or received from a peer
3418 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
3420 * A pointer to the opaque Rust object.
3421 * Nearly everywhere, inner must be non-null, however in places where
3422 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3424 LDKnativeAnnouncementSignatures *inner;
3426 * Indicates that this is the only struct which contains the same pointer.
3427 * Rust functions which take ownership of an object provided via an argument require
3428 * this to be true and invalidate the object pointed to by inner.
3431 } LDKAnnouncementSignatures;
3436 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
3437 * transaction updates if they were pending.
3439 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
3441 * A pointer to the opaque Rust object.
3442 * Nearly everywhere, inner must be non-null, however in places where
3443 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3445 LDKnativeCommitmentUpdate *inner;
3447 * Indicates that this is the only struct which contains the same pointer.
3448 * Rust functions which take ownership of an object provided via an argument require
3449 * this to be true and invalidate the object pointed to by inner.
3452 } LDKCommitmentUpdate;
3457 * A revoke_and_ack message to be sent or received from a peer
3459 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
3461 * A pointer to the opaque Rust object.
3462 * Nearly everywhere, inner must be non-null, however in places where
3463 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3465 LDKnativeRevokeAndACK *inner;
3467 * Indicates that this is the only struct which contains the same pointer.
3468 * Rust functions which take ownership of an object provided via an argument require
3469 * this to be true and invalidate the object pointed to by inner.
3477 * A closing_signed message to be sent or received from a peer
3479 typedef struct MUST_USE_STRUCT LDKClosingSigned {
3481 * A pointer to the opaque Rust object.
3482 * Nearly everywhere, inner must be non-null, however in places where
3483 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3485 LDKnativeClosingSigned *inner;
3487 * Indicates that this is the only struct which contains the same pointer.
3488 * Rust functions which take ownership of an object provided via an argument require
3489 * this to be true and invalidate the object pointed to by inner.
3497 * A shutdown message to be sent or received from a peer
3499 typedef struct MUST_USE_STRUCT LDKShutdown {
3501 * A pointer to the opaque Rust object.
3502 * Nearly everywhere, inner must be non-null, however in places where
3503 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3505 LDKnativeShutdown *inner;
3507 * Indicates that this is the only struct which contains the same pointer.
3508 * Rust functions which take ownership of an object provided via an argument require
3509 * this to be true and invalidate the object pointed to by inner.
3517 * A channel_reestablish message to be sent or received from a peer
3519 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
3521 * A pointer to the opaque Rust object.
3522 * Nearly everywhere, inner must be non-null, however in places where
3523 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3525 LDKnativeChannelReestablish *inner;
3527 * Indicates that this is the only struct which contains the same pointer.
3528 * Rust functions which take ownership of an object provided via an argument require
3529 * this to be true and invalidate the object pointed to by inner.
3532 } LDKChannelReestablish;
3537 * A channel_announcement message to be sent or received from a peer
3539 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
3541 * A pointer to the opaque Rust object.
3542 * Nearly everywhere, inner must be non-null, however in places where
3543 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3545 LDKnativeChannelAnnouncement *inner;
3547 * Indicates that this is the only struct which contains the same pointer.
3548 * Rust functions which take ownership of an object provided via an argument require
3549 * this to be true and invalidate the object pointed to by inner.
3552 } LDKChannelAnnouncement;
3557 * A node_announcement message to be sent or received from a peer
3559 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
3561 * A pointer to the opaque Rust object.
3562 * Nearly everywhere, inner must be non-null, however in places where
3563 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3565 LDKnativeNodeAnnouncement *inner;
3567 * Indicates that this is the only struct which contains the same pointer.
3568 * Rust functions which take ownership of an object provided via an argument require
3569 * this to be true and invalidate the object pointed to by inner.
3572 } LDKNodeAnnouncement;
3577 * An error message to be sent or received from a peer
3579 typedef struct MUST_USE_STRUCT LDKErrorMessage {
3581 * A pointer to the opaque Rust object.
3582 * Nearly everywhere, inner must be non-null, however in places where
3583 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3585 LDKnativeErrorMessage *inner;
3587 * Indicates that this is the only struct which contains the same pointer.
3588 * Rust functions which take ownership of an object provided via an argument require
3589 * this to be true and invalidate the object pointed to by inner.
3597 * A warning message to be sent or received from a peer
3599 typedef struct MUST_USE_STRUCT LDKWarningMessage {
3601 * A pointer to the opaque Rust object.
3602 * Nearly everywhere, inner must be non-null, however in places where
3603 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3605 LDKnativeWarningMessage *inner;
3607 * Indicates that this is the only struct which contains the same pointer.
3608 * Rust functions which take ownership of an object provided via an argument require
3609 * this to be true and invalidate the object pointed to by inner.
3612 } LDKWarningMessage;
3615 * Used to put an error message in a LightningError
3617 typedef enum LDKErrorAction_Tag {
3619 * The peer took some action which made us think they were useless. Disconnect them.
3621 LDKErrorAction_DisconnectPeer,
3623 * The peer did something harmless that we weren't able to process, just log and ignore
3625 LDKErrorAction_IgnoreError,
3627 * The peer did something harmless that we weren't able to meaningfully process.
3628 * If the error is logged, log it at the given level.
3630 LDKErrorAction_IgnoreAndLog,
3632 * The peer provided us with a gossip message which we'd already seen. In most cases this
3633 * should be ignored, but it may result in the message being forwarded if it is a duplicate of
3634 * our own channel announcements.
3636 LDKErrorAction_IgnoreDuplicateGossip,
3638 * The peer did something incorrect. Tell them.
3640 LDKErrorAction_SendErrorMessage,
3642 * The peer did something incorrect. Tell them without closing any channels.
3644 LDKErrorAction_SendWarningMessage,
3646 * Must be last for serialization purposes
3648 LDKErrorAction_Sentinel,
3649 } LDKErrorAction_Tag;
3651 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
3653 * An error message which we should make an effort to send before we disconnect.
3655 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3657 struct LDKErrorMessage msg;
3658 } LDKErrorAction_LDKDisconnectPeer_Body;
3660 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
3662 * The message to send.
3664 struct LDKErrorMessage msg;
3665 } LDKErrorAction_LDKSendErrorMessage_Body;
3667 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
3669 * The message to send.
3671 struct LDKWarningMessage msg;
3673 * The peer may have done something harmless that we weren't able to meaningfully process,
3674 * though we should still tell them about it.
3675 * If this event is logged, log it at the given level.
3677 enum LDKLevel log_level;
3678 } LDKErrorAction_LDKSendWarningMessage_Body;
3680 typedef struct MUST_USE_STRUCT LDKErrorAction {
3681 LDKErrorAction_Tag tag;
3683 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
3685 enum LDKLevel ignore_and_log;
3687 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
3688 LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
3695 * A query_channel_range message is used to query a peer for channel
3696 * UTXOs in a range of blocks. The recipient of a query makes a best
3697 * effort to reply to the query using one or more reply_channel_range
3700 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
3702 * A pointer to the opaque Rust object.
3703 * Nearly everywhere, inner must be non-null, however in places where
3704 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3706 LDKnativeQueryChannelRange *inner;
3708 * Indicates that this is the only struct which contains the same pointer.
3709 * Rust functions which take ownership of an object provided via an argument require
3710 * this to be true and invalidate the object pointed to by inner.
3713 } LDKQueryChannelRange;
3718 * A query_short_channel_ids message is used to query a peer for
3719 * routing gossip messages related to one or more short_channel_ids.
3720 * The query recipient will reply with the latest, if available,
3721 * channel_announcement, channel_update and node_announcement messages
3722 * it maintains for the requested short_channel_ids followed by a
3723 * reply_short_channel_ids_end message. The short_channel_ids sent in
3724 * this query are encoded. We only support encoding_type=0 uncompressed
3725 * serialization and do not support encoding_type=1 zlib serialization.
3727 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
3729 * A pointer to the opaque Rust object.
3730 * Nearly everywhere, inner must be non-null, however in places where
3731 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3733 LDKnativeQueryShortChannelIds *inner;
3735 * Indicates that this is the only struct which contains the same pointer.
3736 * Rust functions which take ownership of an object provided via an argument require
3737 * this to be true and invalidate the object pointed to by inner.
3740 } LDKQueryShortChannelIds;
3745 * A reply_channel_range message is a reply to a query_channel_range
3746 * message. Multiple reply_channel_range messages can be sent in reply
3747 * to a single query_channel_range message. The query recipient makes a
3748 * best effort to respond based on their local network view which may
3749 * not be a perfect view of the network. The short_channel_ids in the
3750 * reply are encoded. We only support encoding_type=0 uncompressed
3751 * serialization and do not support encoding_type=1 zlib serialization.
3753 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
3755 * A pointer to the opaque Rust object.
3756 * Nearly everywhere, inner must be non-null, however in places where
3757 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3759 LDKnativeReplyChannelRange *inner;
3761 * Indicates that this is the only struct which contains the same pointer.
3762 * Rust functions which take ownership of an object provided via an argument require
3763 * this to be true and invalidate the object pointed to by inner.
3766 } LDKReplyChannelRange;
3771 * A gossip_timestamp_filter message is used by a node to request
3772 * gossip relay for messages in the requested time range when the
3773 * gossip_queries feature has been negotiated.
3775 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
3777 * A pointer to the opaque Rust object.
3778 * Nearly everywhere, inner must be non-null, however in places where
3779 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3781 LDKnativeGossipTimestampFilter *inner;
3783 * Indicates that this is the only struct which contains the same pointer.
3784 * Rust functions which take ownership of an object provided via an argument require
3785 * this to be true and invalidate the object pointed to by inner.
3788 } LDKGossipTimestampFilter;
3791 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
3792 * broadcast to most peers).
3793 * These events are handled by PeerManager::process_events if you are using a PeerManager.
3795 typedef enum LDKMessageSendEvent_Tag {
3797 * Used to indicate that we've accepted a channel open and should send the accept_channel
3798 * message provided to the given peer.
3800 LDKMessageSendEvent_SendAcceptChannel,
3802 * Used to indicate that we've initiated a channel open and should send the open_channel
3803 * message provided to the given peer.
3805 LDKMessageSendEvent_SendOpenChannel,
3807 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
3809 LDKMessageSendEvent_SendFundingCreated,
3811 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
3813 LDKMessageSendEvent_SendFundingSigned,
3815 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
3817 LDKMessageSendEvent_SendFundingLocked,
3819 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
3821 LDKMessageSendEvent_SendAnnouncementSignatures,
3823 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
3824 * message should be sent to the peer with the given node_id.
3826 LDKMessageSendEvent_UpdateHTLCs,
3828 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
3830 LDKMessageSendEvent_SendRevokeAndACK,
3832 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
3834 LDKMessageSendEvent_SendClosingSigned,
3836 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
3838 LDKMessageSendEvent_SendShutdown,
3840 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
3842 LDKMessageSendEvent_SendChannelReestablish,
3844 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
3845 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
3847 * Note that after doing so, you very likely (unless you did so very recently) want to call
3848 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
3849 * This ensures that any nodes which see our channel_announcement also have a relevant
3850 * node_announcement, including relevant feature flags which may be important for routing
3853 LDKMessageSendEvent_BroadcastChannelAnnouncement,
3855 * Used to indicate that a node_announcement should be broadcast to all peers.
3857 LDKMessageSendEvent_BroadcastNodeAnnouncement,
3859 * Used to indicate that a channel_update should be broadcast to all peers.
3861 LDKMessageSendEvent_BroadcastChannelUpdate,
3863 * Used to indicate that a channel_update should be sent to a single peer.
3864 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
3865 * private channel and we shouldn't be informing all of our peers of channel parameters.
3867 LDKMessageSendEvent_SendChannelUpdate,
3869 * Broadcast an error downstream to be handled
3871 LDKMessageSendEvent_HandleError,
3873 * Query a peer for channels with funding transaction UTXOs in a block range.
3875 LDKMessageSendEvent_SendChannelRangeQuery,
3877 * Request routing gossip messages from a peer for a list of channels identified by
3878 * their short_channel_ids.
3880 LDKMessageSendEvent_SendShortIdsQuery,
3882 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
3883 * emitted during processing of the query.
3885 LDKMessageSendEvent_SendReplyChannelRange,
3887 * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
3888 * enable receiving gossip messages from the peer.
3890 LDKMessageSendEvent_SendGossipTimestampFilter,
3892 * Must be last for serialization purposes
3894 LDKMessageSendEvent_Sentinel,
3895 } LDKMessageSendEvent_Tag;
3897 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
3899 * The node_id of the node which should receive this message
3901 struct LDKPublicKey node_id;
3903 * The message which should be sent.
3905 struct LDKAcceptChannel msg;
3906 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
3908 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
3910 * The node_id of the node which should receive this message
3912 struct LDKPublicKey node_id;
3914 * The message which should be sent.
3916 struct LDKOpenChannel msg;
3917 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
3919 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
3921 * The node_id of the node which should receive this message
3923 struct LDKPublicKey node_id;
3925 * The message which should be sent.
3927 struct LDKFundingCreated msg;
3928 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
3930 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
3932 * The node_id of the node which should receive this message
3934 struct LDKPublicKey node_id;
3936 * The message which should be sent.
3938 struct LDKFundingSigned msg;
3939 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
3941 typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
3943 * The node_id of the node which should receive these message(s)
3945 struct LDKPublicKey node_id;
3947 * The funding_locked message which should be sent.
3949 struct LDKFundingLocked msg;
3950 } LDKMessageSendEvent_LDKSendFundingLocked_Body;
3952 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
3954 * The node_id of the node which should receive these message(s)
3956 struct LDKPublicKey node_id;
3958 * The announcement_signatures message which should be sent.
3960 struct LDKAnnouncementSignatures msg;
3961 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
3963 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
3965 * The node_id of the node which should receive these message(s)
3967 struct LDKPublicKey node_id;
3969 * The update messages which should be sent. ALL messages in the struct should be sent!
3971 struct LDKCommitmentUpdate updates;
3972 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
3974 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
3976 * The node_id of the node which should receive this message
3978 struct LDKPublicKey node_id;
3980 * The message which should be sent.
3982 struct LDKRevokeAndACK msg;
3983 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
3985 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
3987 * The node_id of the node which should receive this message
3989 struct LDKPublicKey node_id;
3991 * The message which should be sent.
3993 struct LDKClosingSigned msg;
3994 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
3996 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
3998 * The node_id of the node which should receive this message
4000 struct LDKPublicKey node_id;
4002 * The message which should be sent.
4004 struct LDKShutdown msg;
4005 } LDKMessageSendEvent_LDKSendShutdown_Body;
4007 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
4009 * The node_id of the node which should receive this message
4011 struct LDKPublicKey node_id;
4013 * The message which should be sent.
4015 struct LDKChannelReestablish msg;
4016 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
4018 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
4020 * The channel_announcement which should be sent.
4022 struct LDKChannelAnnouncement msg;
4024 * The followup channel_update which should be sent.
4026 struct LDKChannelUpdate update_msg;
4027 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
4029 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
4031 * The node_announcement which should be sent.
4033 struct LDKNodeAnnouncement msg;
4034 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
4036 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
4038 * The channel_update which should be sent.
4040 struct LDKChannelUpdate msg;
4041 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
4043 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
4045 * The node_id of the node which should receive this message
4047 struct LDKPublicKey node_id;
4049 * The channel_update which should be sent.
4051 struct LDKChannelUpdate msg;
4052 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
4054 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
4056 * The node_id of the node which should receive this message
4058 struct LDKPublicKey node_id;
4060 * The action which should be taken.
4062 struct LDKErrorAction action;
4063 } LDKMessageSendEvent_LDKHandleError_Body;
4065 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
4067 * The node_id of this message recipient
4069 struct LDKPublicKey node_id;
4071 * The query_channel_range which should be sent.
4073 struct LDKQueryChannelRange msg;
4074 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
4076 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
4078 * The node_id of this message recipient
4080 struct LDKPublicKey node_id;
4082 * The query_short_channel_ids which should be sent.
4084 struct LDKQueryShortChannelIds msg;
4085 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
4087 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
4089 * The node_id of this message recipient
4091 struct LDKPublicKey node_id;
4093 * The reply_channel_range which should be sent.
4095 struct LDKReplyChannelRange msg;
4096 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
4098 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
4100 * The node_id of this message recipient
4102 struct LDKPublicKey node_id;
4104 * The gossip_timestamp_filter which should be sent.
4106 struct LDKGossipTimestampFilter msg;
4107 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
4109 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
4110 LDKMessageSendEvent_Tag tag;
4112 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
4113 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
4114 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
4115 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
4116 LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
4117 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
4118 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
4119 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
4120 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
4121 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
4122 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
4123 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
4124 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
4125 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
4126 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
4127 LDKMessageSendEvent_LDKHandleError_Body handle_error;
4128 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
4129 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
4130 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
4131 LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
4133 } LDKMessageSendEvent;
4136 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
4137 * This corresponds to std::vector in C++
4139 typedef struct LDKCVec_MessageSendEventZ {
4141 * The elements in the array.
4142 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4144 struct LDKMessageSendEvent *data;
4146 * The number of elements pointed to by `data`.
4149 } LDKCVec_MessageSendEventZ;
4154 * [`Score`] implementation that uses a fixed penalty.
4156 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
4158 * A pointer to the opaque Rust object.
4159 * Nearly everywhere, inner must be non-null, however in places where
4160 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4162 LDKnativeFixedPenaltyScorer *inner;
4164 * Indicates that this is the only struct which contains the same pointer.
4165 * Rust functions which take ownership of an object provided via an argument require
4166 * this to be true and invalidate the object pointed to by inner.
4169 } LDKFixedPenaltyScorer;
4172 * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
4174 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
4176 * A pointer to the contents in the success state.
4177 * Reading from this pointer when `result_ok` is not set is undefined.
4179 struct LDKFixedPenaltyScorer *result;
4181 * A pointer to the contents in the error state.
4182 * Reading from this pointer when `result_ok` is set is undefined.
4184 struct LDKDecodeError *err;
4185 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
4188 * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
4189 * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4190 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4192 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
4194 * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
4195 * `err` or `result` depending on the state of `result_ok`.
4197 union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
4199 * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
4202 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
4207 * Parameters for configuring [`Scorer`].
4209 typedef struct MUST_USE_STRUCT LDKScoringParameters {
4211 * A pointer to the opaque Rust object.
4212 * Nearly everywhere, inner must be non-null, however in places where
4213 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4215 LDKnativeScoringParameters *inner;
4217 * Indicates that this is the only struct which contains the same pointer.
4218 * Rust functions which take ownership of an object provided via an argument require
4219 * this to be true and invalidate the object pointed to by inner.
4222 } LDKScoringParameters;
4225 * The contents of CResult_ScoringParametersDecodeErrorZ
4227 typedef union LDKCResult_ScoringParametersDecodeErrorZPtr {
4229 * A pointer to the contents in the success state.
4230 * Reading from this pointer when `result_ok` is not set is undefined.
4232 struct LDKScoringParameters *result;
4234 * A pointer to the contents in the error state.
4235 * Reading from this pointer when `result_ok` is set is undefined.
4237 struct LDKDecodeError *err;
4238 } LDKCResult_ScoringParametersDecodeErrorZPtr;
4241 * A CResult_ScoringParametersDecodeErrorZ represents the result of a fallible operation,
4242 * containing a crate::lightning::routing::scoring::ScoringParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
4243 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4245 typedef struct LDKCResult_ScoringParametersDecodeErrorZ {
4247 * The contents of this CResult_ScoringParametersDecodeErrorZ, accessible via either
4248 * `err` or `result` depending on the state of `result_ok`.
4250 union LDKCResult_ScoringParametersDecodeErrorZPtr contents;
4252 * Whether this CResult_ScoringParametersDecodeErrorZ represents a success state.
4255 } LDKCResult_ScoringParametersDecodeErrorZ;
4260 * [`Score`] implementation that provides reasonable default behavior.
4262 * Used to apply a fixed penalty to each channel, thus avoiding long paths when shorter paths with
4263 * slightly higher fees are available. Will further penalize channels that fail to relay payments.
4265 * See [module-level documentation] for usage and [`ScoringParameters`] for customization.
4269 * Mixing the `no-std` feature between serialization and deserialization results in undefined
4272 * [module-level documentation]: crate::routing::scoring
4274 typedef struct MUST_USE_STRUCT LDKScorer {
4276 * A pointer to the opaque Rust object.
4277 * Nearly everywhere, inner must be non-null, however in places where
4278 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4280 LDKnativeScorer *inner;
4282 * Indicates that this is the only struct which contains the same pointer.
4283 * Rust functions which take ownership of an object provided via an argument require
4284 * this to be true and invalidate the object pointed to by inner.
4290 * The contents of CResult_ScorerDecodeErrorZ
4292 typedef union LDKCResult_ScorerDecodeErrorZPtr {
4294 * A pointer to the contents in the success state.
4295 * Reading from this pointer when `result_ok` is not set is undefined.
4297 struct LDKScorer *result;
4299 * A pointer to the contents in the error state.
4300 * Reading from this pointer when `result_ok` is set is undefined.
4302 struct LDKDecodeError *err;
4303 } LDKCResult_ScorerDecodeErrorZPtr;
4306 * A CResult_ScorerDecodeErrorZ represents the result of a fallible operation,
4307 * containing a crate::lightning::routing::scoring::Scorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4308 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4310 typedef struct LDKCResult_ScorerDecodeErrorZ {
4312 * The contents of this CResult_ScorerDecodeErrorZ, accessible via either
4313 * `err` or `result` depending on the state of `result_ok`.
4315 union LDKCResult_ScorerDecodeErrorZPtr contents;
4317 * Whether this CResult_ScorerDecodeErrorZ represents a success state.
4320 } LDKCResult_ScorerDecodeErrorZ;
4325 * Represents the network as nodes and channels between them
4327 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
4329 * A pointer to the opaque Rust object.
4330 * Nearly everywhere, inner must be non-null, however in places where
4331 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4333 LDKnativeNetworkGraph *inner;
4335 * Indicates that this is the only struct which contains the same pointer.
4336 * Rust functions which take ownership of an object provided via an argument require
4337 * this to be true and invalidate the object pointed to by inner.
4345 * [`Score`] implementation using channel success probability distributions.
4347 * Based on *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
4348 * and Stefan Richter [[1]]. Given the uncertainty of channel liquidity balances, probability
4349 * distributions are defined based on knowledge learned from successful and unsuccessful attempts.
4350 * Then the negative `log10` of the success probability is used to determine the cost of routing a
4351 * specific HTLC amount through a channel.
4353 * Knowledge about channel liquidity balances takes the form of upper and lower bounds on the
4354 * possible liquidity. Certainty of the bounds is decreased over time using a decay function. See
4355 * [`ProbabilisticScoringParameters`] for details.
4357 * Since the scorer aims to learn the current channel liquidity balances, it works best for nodes
4358 * with high payment volume or that actively probe the [`NetworkGraph`]. Nodes with low payment
4359 * volume are more likely to experience failed payment paths, which would need to be retried.
4363 * Mixing the `no-std` feature between serialization and deserialization results in undefined
4366 * [1]: https://arxiv.org/abs/2107.05322
4368 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
4370 * A pointer to the opaque Rust object.
4371 * Nearly everywhere, inner must be non-null, however in places where
4372 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4374 LDKnativeProbabilisticScorer *inner;
4376 * Indicates that this is the only struct which contains the same pointer.
4377 * Rust functions which take ownership of an object provided via an argument require
4378 * this to be true and invalidate the object pointed to by inner.
4381 } LDKProbabilisticScorer;
4384 * The contents of CResult_ProbabilisticScorerDecodeErrorZ
4386 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
4388 * A pointer to the contents in the success state.
4389 * Reading from this pointer when `result_ok` is not set is undefined.
4391 struct LDKProbabilisticScorer *result;
4393 * A pointer to the contents in the error state.
4394 * Reading from this pointer when `result_ok` is set is undefined.
4396 struct LDKDecodeError *err;
4397 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
4400 * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
4401 * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4402 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4404 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
4406 * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
4407 * `err` or `result` depending on the state of `result_ok`.
4409 union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
4411 * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
4414 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
4419 * Features used within an `init` message.
4421 typedef struct MUST_USE_STRUCT LDKInitFeatures {
4423 * A pointer to the opaque Rust object.
4424 * Nearly everywhere, inner must be non-null, however in places where
4425 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4427 LDKnativeInitFeatures *inner;
4429 * Indicates that this is the only struct which contains the same pointer.
4430 * Rust functions which take ownership of an object provided via an argument require
4431 * this to be true and invalidate the object pointed to by inner.
4437 * The contents of CResult_InitFeaturesDecodeErrorZ
4439 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
4441 * A pointer to the contents in the success state.
4442 * Reading from this pointer when `result_ok` is not set is undefined.
4444 struct LDKInitFeatures *result;
4446 * A pointer to the contents in the error state.
4447 * Reading from this pointer when `result_ok` is set is undefined.
4449 struct LDKDecodeError *err;
4450 } LDKCResult_InitFeaturesDecodeErrorZPtr;
4453 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
4454 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4455 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4457 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
4459 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
4460 * `err` or `result` depending on the state of `result_ok`.
4462 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
4464 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
4467 } LDKCResult_InitFeaturesDecodeErrorZ;
4472 * Features used within a `channel_announcement` message.
4474 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
4476 * A pointer to the opaque Rust object.
4477 * Nearly everywhere, inner must be non-null, however in places where
4478 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4480 LDKnativeChannelFeatures *inner;
4482 * Indicates that this is the only struct which contains the same pointer.
4483 * Rust functions which take ownership of an object provided via an argument require
4484 * this to be true and invalidate the object pointed to by inner.
4487 } LDKChannelFeatures;
4490 * The contents of CResult_ChannelFeaturesDecodeErrorZ
4492 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
4494 * A pointer to the contents in the success state.
4495 * Reading from this pointer when `result_ok` is not set is undefined.
4497 struct LDKChannelFeatures *result;
4499 * A pointer to the contents in the error state.
4500 * Reading from this pointer when `result_ok` is set is undefined.
4502 struct LDKDecodeError *err;
4503 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
4506 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
4507 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4508 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4510 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
4512 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
4513 * `err` or `result` depending on the state of `result_ok`.
4515 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
4517 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
4520 } LDKCResult_ChannelFeaturesDecodeErrorZ;
4525 * Features used within a `node_announcement` message.
4527 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
4529 * A pointer to the opaque Rust object.
4530 * Nearly everywhere, inner must be non-null, however in places where
4531 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4533 LDKnativeNodeFeatures *inner;
4535 * Indicates that this is the only struct which contains the same pointer.
4536 * Rust functions which take ownership of an object provided via an argument require
4537 * this to be true and invalidate the object pointed to by inner.
4543 * The contents of CResult_NodeFeaturesDecodeErrorZ
4545 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
4547 * A pointer to the contents in the success state.
4548 * Reading from this pointer when `result_ok` is not set is undefined.
4550 struct LDKNodeFeatures *result;
4552 * A pointer to the contents in the error state.
4553 * Reading from this pointer when `result_ok` is set is undefined.
4555 struct LDKDecodeError *err;
4556 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
4559 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
4560 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4561 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4563 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
4565 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
4566 * `err` or `result` depending on the state of `result_ok`.
4568 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
4570 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
4573 } LDKCResult_NodeFeaturesDecodeErrorZ;
4578 * Features used within an invoice.
4580 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
4582 * A pointer to the opaque Rust object.
4583 * Nearly everywhere, inner must be non-null, however in places where
4584 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4586 LDKnativeInvoiceFeatures *inner;
4588 * Indicates that this is the only struct which contains the same pointer.
4589 * Rust functions which take ownership of an object provided via an argument require
4590 * this to be true and invalidate the object pointed to by inner.
4593 } LDKInvoiceFeatures;
4596 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
4598 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
4600 * A pointer to the contents in the success state.
4601 * Reading from this pointer when `result_ok` is not set is undefined.
4603 struct LDKInvoiceFeatures *result;
4605 * A pointer to the contents in the error state.
4606 * Reading from this pointer when `result_ok` is set is undefined.
4608 struct LDKDecodeError *err;
4609 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
4612 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
4613 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4614 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4616 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
4618 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
4619 * `err` or `result` depending on the state of `result_ok`.
4621 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
4623 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
4626 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
4629 * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
4631 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
4633 * A pointer to the contents in the success state.
4634 * Reading from this pointer when `result_ok` is not set is undefined.
4636 struct LDKChannelTypeFeatures *result;
4638 * A pointer to the contents in the error state.
4639 * Reading from this pointer when `result_ok` is set is undefined.
4641 struct LDKDecodeError *err;
4642 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
4645 * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
4646 * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4647 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4649 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
4651 * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
4652 * `err` or `result` depending on the state of `result_ok`.
4654 union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
4656 * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
4659 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
4662 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
4664 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
4666 * A pointer to the contents in the success state.
4667 * Reading from this pointer when `result_ok` is not set is undefined.
4669 struct LDKDelayedPaymentOutputDescriptor *result;
4671 * A pointer to the contents in the error state.
4672 * Reading from this pointer when `result_ok` is set is undefined.
4674 struct LDKDecodeError *err;
4675 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
4678 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
4679 * containing a crate::lightning::chain::keysinterface::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
4680 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4682 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
4684 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
4685 * `err` or `result` depending on the state of `result_ok`.
4687 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
4689 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
4692 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
4695 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
4697 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
4699 * A pointer to the contents in the success state.
4700 * Reading from this pointer when `result_ok` is not set is undefined.
4702 struct LDKStaticPaymentOutputDescriptor *result;
4704 * A pointer to the contents in the error state.
4705 * Reading from this pointer when `result_ok` is set is undefined.
4707 struct LDKDecodeError *err;
4708 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
4711 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
4712 * containing a crate::lightning::chain::keysinterface::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
4713 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4715 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
4717 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
4718 * `err` or `result` depending on the state of `result_ok`.
4720 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
4722 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
4725 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
4728 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
4730 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
4732 * A pointer to the contents in the success state.
4733 * Reading from this pointer when `result_ok` is not set is undefined.
4735 struct LDKSpendableOutputDescriptor *result;
4737 * A pointer to the contents in the error state.
4738 * Reading from this pointer when `result_ok` is set is undefined.
4740 struct LDKDecodeError *err;
4741 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
4744 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
4745 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
4746 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4748 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
4750 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
4751 * `err` or `result` depending on the state of `result_ok`.
4753 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
4755 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
4758 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
4761 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
4762 * This corresponds to std::vector in C++
4764 typedef struct LDKCVec_PaymentPreimageZ {
4766 * The elements in the array.
4767 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4769 struct LDKThirtyTwoBytes *data;
4771 * The number of elements pointed to by `data`.
4774 } LDKCVec_PaymentPreimageZ;
4777 * A tuple of 2 elements. See the individual fields for the types contained.
4779 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
4781 * The element at position 0
4783 struct LDKSignature a;
4785 * The element at position 1
4787 struct LDKCVec_SignatureZ b;
4788 } LDKC2Tuple_SignatureCVec_SignatureZZ;
4791 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
4793 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
4795 * A pointer to the contents in the success state.
4796 * Reading from this pointer when `result_ok` is not set is undefined.
4798 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
4800 * Note that this value is always NULL, as there are no contents in the Err variant
4803 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
4806 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
4807 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
4808 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4810 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
4812 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
4813 * `err` or `result` depending on the state of `result_ok`.
4815 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
4817 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
4820 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
4823 * The contents of CResult_SignatureNoneZ
4825 typedef union LDKCResult_SignatureNoneZPtr {
4827 * A pointer to the contents in the success state.
4828 * Reading from this pointer when `result_ok` is not set is undefined.
4830 struct LDKSignature *result;
4832 * Note that this value is always NULL, as there are no contents in the Err variant
4835 } LDKCResult_SignatureNoneZPtr;
4838 * A CResult_SignatureNoneZ represents the result of a fallible operation,
4839 * containing a crate::c_types::Signature on success and a () on failure.
4840 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4842 typedef struct LDKCResult_SignatureNoneZ {
4844 * The contents of this CResult_SignatureNoneZ, accessible via either
4845 * `err` or `result` depending on the state of `result_ok`.
4847 union LDKCResult_SignatureNoneZPtr contents;
4849 * Whether this CResult_SignatureNoneZ represents a success state.
4852 } LDKCResult_SignatureNoneZ;
4855 * A tuple of 2 elements. See the individual fields for the types contained.
4857 typedef struct LDKC2Tuple_SignatureSignatureZ {
4859 * The element at position 0
4861 struct LDKSignature a;
4863 * The element at position 1
4865 struct LDKSignature b;
4866 } LDKC2Tuple_SignatureSignatureZ;
4869 * The contents of CResult_C2Tuple_SignatureSignatureZNoneZ
4871 typedef union LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr {
4873 * A pointer to the contents in the success state.
4874 * Reading from this pointer when `result_ok` is not set is undefined.
4876 struct LDKC2Tuple_SignatureSignatureZ *result;
4878 * Note that this value is always NULL, as there are no contents in the Err variant
4881 } LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr;
4884 * A CResult_C2Tuple_SignatureSignatureZNoneZ represents the result of a fallible operation,
4885 * containing a crate::c_types::derived::C2Tuple_SignatureSignatureZ on success and a () on failure.
4886 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4888 typedef struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ {
4890 * The contents of this CResult_C2Tuple_SignatureSignatureZNoneZ, accessible via either
4891 * `err` or `result` depending on the state of `result_ok`.
4893 union LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr contents;
4895 * Whether this CResult_C2Tuple_SignatureSignatureZNoneZ represents a success state.
4898 } LDKCResult_C2Tuple_SignatureSignatureZNoneZ;
4901 * The contents of CResult_SecretKeyNoneZ
4903 typedef union LDKCResult_SecretKeyNoneZPtr {
4905 * A pointer to the contents in the success state.
4906 * Reading from this pointer when `result_ok` is not set is undefined.
4908 struct LDKSecretKey *result;
4910 * Note that this value is always NULL, as there are no contents in the Err variant
4913 } LDKCResult_SecretKeyNoneZPtr;
4916 * A CResult_SecretKeyNoneZ represents the result of a fallible operation,
4917 * containing a crate::c_types::SecretKey on success and a () on failure.
4918 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4920 typedef struct LDKCResult_SecretKeyNoneZ {
4922 * The contents of this CResult_SecretKeyNoneZ, accessible via either
4923 * `err` or `result` depending on the state of `result_ok`.
4925 union LDKCResult_SecretKeyNoneZPtr contents;
4927 * Whether this CResult_SecretKeyNoneZ represents a success state.
4930 } LDKCResult_SecretKeyNoneZ;
4935 * This class tracks the per-transaction information needed to build a closing transaction and will
4936 * actually build it and sign.
4938 * This class can be used inside a signer implementation to generate a signature given the relevant
4941 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
4943 * A pointer to the opaque Rust object.
4944 * Nearly everywhere, inner must be non-null, however in places where
4945 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4947 LDKnativeClosingTransaction *inner;
4949 * Indicates that this is the only struct which contains the same pointer.
4950 * Rust functions which take ownership of an object provided via an argument require
4951 * this to be true and invalidate the object pointed to by inner.
4954 } LDKClosingTransaction;
4959 * The unsigned part of a channel_announcement
4961 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
4963 * A pointer to the opaque Rust object.
4964 * Nearly everywhere, inner must be non-null, however in places where
4965 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4967 LDKnativeUnsignedChannelAnnouncement *inner;
4969 * Indicates that this is the only struct which contains the same pointer.
4970 * Rust functions which take ownership of an object provided via an argument require
4971 * this to be true and invalidate the object pointed to by inner.
4974 } LDKUnsignedChannelAnnouncement;
4977 * A trait to sign lightning channel transactions as described in BOLT 3.
4979 * Signing services could be implemented on a hardware wallet. In this case,
4980 * the current Sign would be a front-end on top of a communication
4981 * channel connected to your secure device and lightning key material wouldn't
4982 * reside on a hot server. Nevertheless, a this deployment would still need
4983 * to trust the ChannelManager to avoid loss of funds as this latest component
4984 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
4986 * A more secure iteration would be to use hashlock (or payment points) to pair
4987 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
4988 * at the price of more state and computation on the hardware wallet side. In the future,
4989 * we are looking forward to design such interface.
4991 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
4992 * to act, as liveness and breach reply correctness are always going to be hard requirements
4993 * of LN security model, orthogonal of key management issues.
4995 typedef struct LDKBaseSign {
4997 * An opaque pointer which is passed to your function implementations as an argument.
4998 * This has no meaning in the LDK, and can be NULL or any other value.
5002 * Gets the per-commitment point for a specific commitment number
5004 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
5006 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
5008 * Gets the commitment secret for a specific commitment number as part of the revocation process
5010 * An external signer implementation should error here if the commitment was already signed
5011 * and should refuse to sign it in the future.
5013 * May be called more than once for the same index.
5015 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
5017 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
5019 * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
5021 * This is required in order for the signer to make sure that releasing a commitment
5022 * secret won't leave us without a broadcastable holder transaction.
5023 * Policy checks should be implemented in this function, including checking the amount
5024 * sent to us and checking the HTLCs.
5026 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
5027 * A validating signer should ensure that an HTLC output is removed only when the matching
5028 * preimage is provided, or when the value to holder is restored.
5030 * NOTE: all the relevant preimages will be provided, but there may also be additional
5031 * irrelevant or duplicate preimages.
5033 struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_PaymentPreimageZ preimages);
5035 * Gets the holder's channel public keys and basepoints
5037 struct LDKChannelPublicKeys pubkeys;
5039 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
5040 * Note that this takes a pointer to this object, not the this_ptr like other methods do
5041 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
5043 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
5045 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
5046 * some SpendableOutputDescriptor types. This should be sufficient to identify this
5047 * Sign object uniquely and lookup or re-derive its keys.
5049 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
5051 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
5053 * Note that if signing fails or is rejected, the channel will be force-closed.
5055 * Policy checks should be implemented in this function, including checking the amount
5056 * sent to us and checking the HTLCs.
5058 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
5059 * A validating signer should ensure that an HTLC output is removed only when the matching
5060 * preimage is provided, or when the value to holder is restored.
5062 * NOTE: all the relevant preimages will be provided, but there may also be additional
5063 * irrelevant or duplicate preimages.
5065 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_PaymentPreimageZ preimages);
5067 * Validate the counterparty's revocation.
5069 * This is required in order for the signer to make sure that the state has moved
5070 * forward and it is safe to sign the next counterparty commitment.
5072 struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
5074 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
5075 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
5076 * latest commitment_tx when we initiate a force-close.
5077 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
5078 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
5080 * This may be called multiple times for the same transaction.
5082 * An external signer implementation should check that the commitment has not been revoked.
5084 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
5086 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
5088 * Create a signature for the given input in a transaction spending an HTLC transaction output
5089 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
5091 * A justice transaction may claim multiple outputs at the same time if timelocks are
5092 * similar, but only a signature for the input at index `input` should be signed for here.
5093 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
5094 * to an upcoming timelock expiration.
5096 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
5098 * per_commitment_key is revocation secret which was provided by our counterparty when they
5099 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
5100 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
5103 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]);
5105 * Create a signature for the given input in a transaction spending a commitment transaction
5106 * HTLC output when our counterparty broadcasts an old state.
5108 * A justice transaction may claim multiple outputs at the same time if timelocks are
5109 * similar, but only a signature for the input at index `input` should be signed for here.
5110 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
5111 * to an upcoming timelock expiration.
5113 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
5115 * per_commitment_key is revocation secret which was provided by our counterparty when they
5116 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
5117 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
5120 * htlc holds HTLC elements (hash, timelock), thus changing the format of the witness script
5121 * (which is committed to in the BIP 143 signatures).
5123 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);
5125 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
5126 * transaction, either offered or received.
5128 * Such a transaction may claim multiples offered outputs at same time if we know the
5129 * preimage for each when we create it, but only the input at index `input` should be
5130 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
5131 * needed with regards to an upcoming timelock expiration.
5133 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
5136 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
5138 * Per_commitment_point is the dynamic point corresponding to the channel state
5139 * detected onchain. It has been generated by our counterparty and is used to derive
5140 * channel state keys, which are then included in the witness script and committed to in the
5141 * BIP 143 signature.
5143 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);
5145 * Create a signature for a (proposed) closing transaction.
5147 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
5148 * chosen to forgo their output as dust.
5150 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
5152 * Signs a channel announcement message with our funding key and our node secret key (aka
5153 * node_id or network_key), proving it comes from one of the channel participants.
5155 * The first returned signature should be from our node secret key, the second from our
5158 * Note that if this fails or is rejected, the channel will not be publicly announced and
5159 * our counterparty may (though likely will not) close the channel on us for violating the
5162 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
5164 * Set the counterparty static channel data, including basepoints,
5165 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
5166 * This is done as soon as the funding outpoint is known. Since these are static channel data,
5167 * they MUST NOT be allowed to change to different values once set.
5169 * channel_parameters.is_populated() MUST be true.
5171 * We bind holder_selected_contest_delay late here for API convenience.
5173 * Will be called before any signatures are applied.
5175 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
5177 * Frees any resources associated with this object given its this_arg pointer.
5178 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5180 void (*free)(void *this_arg);
5184 * A cloneable signer.
5186 * Although we require signers to be cloneable, it may be useful for developers to be able to use
5187 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
5188 * which implies Sized, into this derived trait.
5190 typedef struct LDKSign {
5192 * An opaque pointer which is passed to your function implementations as an argument.
5193 * This has no meaning in the LDK, and can be NULL or any other value.
5197 * Implementation of BaseSign for this object.
5199 struct LDKBaseSign BaseSign;
5201 * Serialize the object into a byte array
5203 struct LDKCVec_u8Z (*write)(const void *this_arg);
5205 * Called, if set, after this Sign has been cloned into a duplicate object.
5206 * The new Sign is provided, and should be mutated as needed to perform a
5207 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
5209 void (*cloned)(struct LDKSign *NONNULL_PTR new_Sign);
5211 * Frees any resources associated with this object given its this_arg pointer.
5212 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5214 void (*free)(void *this_arg);
5218 * The contents of CResult_SignDecodeErrorZ
5220 typedef union LDKCResult_SignDecodeErrorZPtr {
5222 * A pointer to the contents in the success state.
5223 * Reading from this pointer when `result_ok` is not set is undefined.
5225 struct LDKSign *result;
5227 * A pointer to the contents in the error state.
5228 * Reading from this pointer when `result_ok` is set is undefined.
5230 struct LDKDecodeError *err;
5231 } LDKCResult_SignDecodeErrorZPtr;
5234 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
5235 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
5236 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5238 typedef struct LDKCResult_SignDecodeErrorZ {
5240 * The contents of this CResult_SignDecodeErrorZ, accessible via either
5241 * `err` or `result` depending on the state of `result_ok`.
5243 union LDKCResult_SignDecodeErrorZPtr contents;
5245 * Whether this CResult_SignDecodeErrorZ represents a success state.
5248 } LDKCResult_SignDecodeErrorZ;
5251 * Integer in the range `0..32`
5253 typedef struct LDKu5 {
5258 * A dynamically-allocated array of crate::c_types::u5s of arbitrary size.
5259 * This corresponds to std::vector in C++
5261 typedef struct LDKCVec_u5Z {
5263 * The elements in the array.
5264 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5268 * The number of elements pointed to by `data`.
5274 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
5275 * allows recovering the exact public key which created the signature given the message.
5277 typedef struct LDKRecoverableSignature {
5279 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
5282 uint8_t serialized_form[68];
5283 } LDKRecoverableSignature;
5286 * The contents of CResult_RecoverableSignatureNoneZ
5288 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
5290 * A pointer to the contents in the success state.
5291 * Reading from this pointer when `result_ok` is not set is undefined.
5293 struct LDKRecoverableSignature *result;
5295 * Note that this value is always NULL, as there are no contents in the Err variant
5298 } LDKCResult_RecoverableSignatureNoneZPtr;
5301 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
5302 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
5303 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5305 typedef struct LDKCResult_RecoverableSignatureNoneZ {
5307 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
5308 * `err` or `result` depending on the state of `result_ok`.
5310 union LDKCResult_RecoverableSignatureNoneZPtr contents;
5312 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
5315 } LDKCResult_RecoverableSignatureNoneZ;
5318 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
5319 * This corresponds to std::vector in C++
5321 typedef struct LDKCVec_CVec_u8ZZ {
5323 * The elements in the array.
5324 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5326 struct LDKCVec_u8Z *data;
5328 * The number of elements pointed to by `data`.
5331 } LDKCVec_CVec_u8ZZ;
5334 * The contents of CResult_CVec_CVec_u8ZZNoneZ
5336 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
5338 * A pointer to the contents in the success state.
5339 * Reading from this pointer when `result_ok` is not set is undefined.
5341 struct LDKCVec_CVec_u8ZZ *result;
5343 * Note that this value is always NULL, as there are no contents in the Err variant
5346 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
5349 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
5350 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
5351 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5353 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
5355 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
5356 * `err` or `result` depending on the state of `result_ok`.
5358 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
5360 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
5363 } LDKCResult_CVec_CVec_u8ZZNoneZ;
5368 * A simple implementation of Sign that just keeps the private keys in memory.
5370 * This implementation performs no policy checks and is insufficient by itself as
5371 * a secure external signer.
5373 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
5375 * A pointer to the opaque Rust object.
5376 * Nearly everywhere, inner must be non-null, however in places where
5377 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5379 LDKnativeInMemorySigner *inner;
5381 * Indicates that this is the only struct which contains the same pointer.
5382 * Rust functions which take ownership of an object provided via an argument require
5383 * this to be true and invalidate the object pointed to by inner.
5386 } LDKInMemorySigner;
5389 * The contents of CResult_InMemorySignerDecodeErrorZ
5391 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
5393 * A pointer to the contents in the success state.
5394 * Reading from this pointer when `result_ok` is not set is undefined.
5396 struct LDKInMemorySigner *result;
5398 * A pointer to the contents in the error state.
5399 * Reading from this pointer when `result_ok` is set is undefined.
5401 struct LDKDecodeError *err;
5402 } LDKCResult_InMemorySignerDecodeErrorZPtr;
5405 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
5406 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
5407 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5409 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
5411 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
5412 * `err` or `result` depending on the state of `result_ok`.
5414 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
5416 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
5419 } LDKCResult_InMemorySignerDecodeErrorZ;
5422 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
5423 * This corresponds to std::vector in C++
5425 typedef struct LDKCVec_TxOutZ {
5427 * The elements in the array.
5428 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5430 struct LDKTxOut *data;
5432 * The number of elements pointed to by `data`.
5438 * The contents of CResult_TransactionNoneZ
5440 typedef union LDKCResult_TransactionNoneZPtr {
5442 * A pointer to the contents in the success state.
5443 * Reading from this pointer when `result_ok` is not set is undefined.
5445 struct LDKTransaction *result;
5447 * Note that this value is always NULL, as there are no contents in the Err variant
5450 } LDKCResult_TransactionNoneZPtr;
5453 * A CResult_TransactionNoneZ represents the result of a fallible operation,
5454 * containing a crate::c_types::Transaction on success and a () on failure.
5455 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5457 typedef struct LDKCResult_TransactionNoneZ {
5459 * The contents of this CResult_TransactionNoneZ, accessible via either
5460 * `err` or `result` depending on the state of `result_ok`.
5462 union LDKCResult_TransactionNoneZPtr contents;
5464 * Whether this CResult_TransactionNoneZ represents a success state.
5467 } LDKCResult_TransactionNoneZ;
5472 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
5473 * on-chain transactions to ensure no loss of funds occurs.
5475 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
5476 * information and are actively monitoring the chain.
5478 * Pending Events or updated HTLCs which have not yet been read out by
5479 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
5480 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
5481 * gotten are fully handled before re-serializing the new state.
5483 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
5484 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
5485 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
5486 * returned block hash and the the current chain and then reconnecting blocks to get to the
5487 * best chain) upon deserializing the object!
5489 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
5491 * A pointer to the opaque Rust object.
5492 * Nearly everywhere, inner must be non-null, however in places where
5493 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5495 LDKnativeChannelMonitor *inner;
5497 * Indicates that this is the only struct which contains the same pointer.
5498 * Rust functions which take ownership of an object provided via an argument require
5499 * this to be true and invalidate the object pointed to by inner.
5502 } LDKChannelMonitor;
5505 * A tuple of 2 elements. See the individual fields for the types contained.
5507 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
5509 * The element at position 0
5511 struct LDKThirtyTwoBytes a;
5513 * The element at position 1
5515 struct LDKChannelMonitor b;
5516 } LDKC2Tuple_BlockHashChannelMonitorZ;
5519 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
5520 * This corresponds to std::vector in C++
5522 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
5524 * The elements in the array.
5525 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5527 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
5529 * The number of elements pointed to by `data`.
5532 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
5535 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
5537 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
5539 * A pointer to the contents in the success state.
5540 * Reading from this pointer when `result_ok` is not set is undefined.
5542 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
5544 * A pointer to the contents in the error state.
5545 * Reading from this pointer when `result_ok` is set is undefined.
5547 enum LDKIOError *err;
5548 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
5551 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
5552 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
5553 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5555 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
5557 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
5558 * `err` or `result` depending on the state of `result_ok`.
5560 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
5562 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
5565 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
5568 * An enum which can either contain a u16 or not
5570 typedef enum LDKCOption_u16Z_Tag {
5572 * When we're in this state, this COption_u16Z contains a u16
5574 LDKCOption_u16Z_Some,
5576 * When we're in this state, this COption_u16Z contains nothing
5578 LDKCOption_u16Z_None,
5580 * Must be last for serialization purposes
5582 LDKCOption_u16Z_Sentinel,
5583 } LDKCOption_u16Z_Tag;
5585 typedef struct LDKCOption_u16Z {
5586 LDKCOption_u16Z_Tag tag;
5595 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
5598 typedef enum LDKAPIError_Tag {
5600 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
5601 * are documented, but generally indicates some precondition of a function was violated.
5603 LDKAPIError_APIMisuseError,
5605 * Due to a high feerate, we were unable to complete the request.
5606 * For example, this may be returned if the feerate implies we cannot open a channel at the
5607 * requested value, but opening a larger channel would succeed.
5609 LDKAPIError_FeeRateTooHigh,
5611 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
5612 * too-many-hops, etc).
5614 LDKAPIError_RouteError,
5616 * We were unable to complete the request as the Channel required to do so is unable to
5617 * complete the request (or was not found). This can take many forms, including disconnected
5618 * peer, channel at capacity, channel shutting down, etc.
5620 LDKAPIError_ChannelUnavailable,
5622 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
5623 * attempted action to fail.
5625 LDKAPIError_MonitorUpdateFailed,
5627 * [`KeysInterface::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
5628 * with the channel counterparty as negotiated in [`InitFeatures`].
5630 * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
5631 * a channel or cooperatively close one with this peer (and will have to force-close instead).
5633 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
5634 * [`InitFeatures`]: crate::ln::features::InitFeatures
5636 LDKAPIError_IncompatibleShutdownScript,
5638 * Must be last for serialization purposes
5640 LDKAPIError_Sentinel,
5643 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
5645 * A human-readable error message
5648 } LDKAPIError_LDKAPIMisuseError_Body;
5650 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
5652 * A human-readable error message
5656 * The feerate which was too high.
5659 } LDKAPIError_LDKFeeRateTooHigh_Body;
5661 typedef struct LDKAPIError_LDKRouteError_Body {
5663 * A human-readable error message
5666 } LDKAPIError_LDKRouteError_Body;
5668 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
5670 * A human-readable error message
5673 } LDKAPIError_LDKChannelUnavailable_Body;
5675 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
5677 * The incompatible shutdown script.
5679 struct LDKShutdownScript script;
5680 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
5682 typedef struct MUST_USE_STRUCT LDKAPIError {
5683 LDKAPIError_Tag tag;
5685 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
5686 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
5687 LDKAPIError_LDKRouteError_Body route_error;
5688 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
5689 LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
5694 * The contents of CResult_NoneAPIErrorZ
5696 typedef union LDKCResult_NoneAPIErrorZPtr {
5698 * Note that this value is always NULL, as there are no contents in the OK variant
5702 * A pointer to the contents in the error state.
5703 * Reading from this pointer when `result_ok` is set is undefined.
5705 struct LDKAPIError *err;
5706 } LDKCResult_NoneAPIErrorZPtr;
5709 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
5710 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
5711 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5713 typedef struct LDKCResult_NoneAPIErrorZ {
5715 * The contents of this CResult_NoneAPIErrorZ, accessible via either
5716 * `err` or `result` depending on the state of `result_ok`.
5718 union LDKCResult_NoneAPIErrorZPtr contents;
5720 * Whether this CResult_NoneAPIErrorZ represents a success state.
5723 } LDKCResult_NoneAPIErrorZ;
5726 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
5727 * This corresponds to std::vector in C++
5729 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
5731 * The elements in the array.
5732 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5734 struct LDKCResult_NoneAPIErrorZ *data;
5736 * The number of elements pointed to by `data`.
5739 } LDKCVec_CResult_NoneAPIErrorZZ;
5742 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
5743 * This corresponds to std::vector in C++
5745 typedef struct LDKCVec_APIErrorZ {
5747 * The elements in the array.
5748 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5750 struct LDKAPIError *data;
5752 * The number of elements pointed to by `data`.
5755 } LDKCVec_APIErrorZ;
5758 * The contents of CResult__u832APIErrorZ
5760 typedef union LDKCResult__u832APIErrorZPtr {
5762 * A pointer to the contents in the success state.
5763 * Reading from this pointer when `result_ok` is not set is undefined.
5765 struct LDKThirtyTwoBytes *result;
5767 * A pointer to the contents in the error state.
5768 * Reading from this pointer when `result_ok` is set is undefined.
5770 struct LDKAPIError *err;
5771 } LDKCResult__u832APIErrorZPtr;
5774 * A CResult__u832APIErrorZ represents the result of a fallible operation,
5775 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
5776 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5778 typedef struct LDKCResult__u832APIErrorZ {
5780 * The contents of this CResult__u832APIErrorZ, accessible via either
5781 * `err` or `result` depending on the state of `result_ok`.
5783 union LDKCResult__u832APIErrorZPtr contents;
5785 * Whether this CResult__u832APIErrorZ represents a success state.
5788 } LDKCResult__u832APIErrorZ;
5791 * If a payment fails to send, it can be in one of several states. This enum is returned as the
5792 * Err() type describing which state the payment is in, see the description of individual enum
5795 typedef enum LDKPaymentSendFailure_Tag {
5797 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
5798 * send the payment at all. No channel state has been changed or messages sent to peers, and
5799 * once you've changed the parameter at error, you can freely retry the payment in full.
5801 LDKPaymentSendFailure_ParameterError,
5803 * A parameter in a single path which was passed to send_payment was invalid, preventing us
5804 * from attempting to send the payment at all. No channel state has been changed or messages
5805 * sent to peers, and once you've changed the parameter at error, you can freely retry the
5808 * The results here are ordered the same as the paths in the route object which was passed to
5811 LDKPaymentSendFailure_PathParameterError,
5813 * All paths which were attempted failed to send, with no channel state change taking place.
5814 * You can freely retry the payment in full (though you probably want to do so over different
5815 * paths than the ones selected).
5817 LDKPaymentSendFailure_AllFailedRetrySafe,
5819 * Some paths which were attempted failed to send, though possibly not all. At least some
5820 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
5821 * in over-/re-payment.
5823 * The results here are ordered the same as the paths in the route object which was passed to
5824 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
5825 * retried (though there is currently no API with which to do so).
5827 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
5828 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
5829 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
5830 * with the latest update_id.
5832 LDKPaymentSendFailure_PartialFailure,
5834 * Must be last for serialization purposes
5836 LDKPaymentSendFailure_Sentinel,
5837 } LDKPaymentSendFailure_Tag;
5839 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
5841 * The errors themselves, in the same order as the route hops.
5843 struct LDKCVec_CResult_NoneAPIErrorZZ results;
5845 * If some paths failed without irrevocably committing to the new HTLC(s), this will
5846 * contain a [`RouteParameters`] object which can be used to calculate a new route that
5847 * will pay all remaining unpaid balance.
5849 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
5851 struct LDKRouteParameters failed_paths_retry;
5853 * The payment id for the payment, which is now at least partially pending.
5855 struct LDKThirtyTwoBytes payment_id;
5856 } LDKPaymentSendFailure_LDKPartialFailure_Body;
5858 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
5859 LDKPaymentSendFailure_Tag tag;
5862 struct LDKAPIError parameter_error;
5865 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
5868 struct LDKCVec_APIErrorZ all_failed_retry_safe;
5870 LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
5872 } LDKPaymentSendFailure;
5875 * The contents of CResult_PaymentIdPaymentSendFailureZ
5877 typedef union LDKCResult_PaymentIdPaymentSendFailureZPtr {
5879 * A pointer to the contents in the success state.
5880 * Reading from this pointer when `result_ok` is not set is undefined.
5882 struct LDKThirtyTwoBytes *result;
5884 * A pointer to the contents in the error state.
5885 * Reading from this pointer when `result_ok` is set is undefined.
5887 struct LDKPaymentSendFailure *err;
5888 } LDKCResult_PaymentIdPaymentSendFailureZPtr;
5891 * A CResult_PaymentIdPaymentSendFailureZ represents the result of a fallible operation,
5892 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
5893 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5895 typedef struct LDKCResult_PaymentIdPaymentSendFailureZ {
5897 * The contents of this CResult_PaymentIdPaymentSendFailureZ, accessible via either
5898 * `err` or `result` depending on the state of `result_ok`.
5900 union LDKCResult_PaymentIdPaymentSendFailureZPtr contents;
5902 * Whether this CResult_PaymentIdPaymentSendFailureZ represents a success state.
5905 } LDKCResult_PaymentIdPaymentSendFailureZ;
5908 * The contents of CResult_NonePaymentSendFailureZ
5910 typedef union LDKCResult_NonePaymentSendFailureZPtr {
5912 * Note that this value is always NULL, as there are no contents in the OK variant
5916 * A pointer to the contents in the error state.
5917 * Reading from this pointer when `result_ok` is set is undefined.
5919 struct LDKPaymentSendFailure *err;
5920 } LDKCResult_NonePaymentSendFailureZPtr;
5923 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
5924 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
5925 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5927 typedef struct LDKCResult_NonePaymentSendFailureZ {
5929 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
5930 * `err` or `result` depending on the state of `result_ok`.
5932 union LDKCResult_NonePaymentSendFailureZPtr contents;
5934 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
5937 } LDKCResult_NonePaymentSendFailureZ;
5940 * A tuple of 2 elements. See the individual fields for the types contained.
5942 typedef struct LDKC2Tuple_PaymentHashPaymentIdZ {
5944 * The element at position 0
5946 struct LDKThirtyTwoBytes a;
5948 * The element at position 1
5950 struct LDKThirtyTwoBytes b;
5951 } LDKC2Tuple_PaymentHashPaymentIdZ;
5954 * The contents of CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ
5956 typedef union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr {
5958 * A pointer to the contents in the success state.
5959 * Reading from this pointer when `result_ok` is not set is undefined.
5961 struct LDKC2Tuple_PaymentHashPaymentIdZ *result;
5963 * A pointer to the contents in the error state.
5964 * Reading from this pointer when `result_ok` is set is undefined.
5966 struct LDKPaymentSendFailure *err;
5967 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr;
5970 * A CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents the result of a fallible operation,
5971 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentIdZ on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
5972 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5974 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ {
5976 * The contents of this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ, accessible via either
5977 * `err` or `result` depending on the state of `result_ok`.
5979 union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr contents;
5981 * Whether this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents a success state.
5984 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ;
5987 * A 4-byte byte array.
5989 typedef struct LDKFourBytes {
5997 * A 16-byte byte array.
5999 typedef struct LDKSixteenBytes {
6007 * A 12-byte byte array.
6009 typedef struct LDKTwelveBytes {
6017 * An address which can be used to connect to a remote peer
6019 typedef enum LDKNetAddress_Tag {
6021 * An IPv4 address/port on which the peer is listening.
6025 * An IPv6 address/port on which the peer is listening.
6029 * An old-style Tor onion address/port on which the peer is listening.
6031 * This field is deprecated and the Tor network generally no longer supports V2 Onion
6032 * addresses. Thus, the details are not parsed here.
6034 LDKNetAddress_OnionV2,
6036 * A new-style Tor onion address/port on which the peer is listening.
6037 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
6038 * wrap as base32 and append \".onion\".
6040 LDKNetAddress_OnionV3,
6042 * Must be last for serialization purposes
6044 LDKNetAddress_Sentinel,
6045 } LDKNetAddress_Tag;
6047 typedef struct LDKNetAddress_LDKIPv4_Body {
6049 * The 4-byte IPv4 address
6051 struct LDKFourBytes addr;
6053 * The port on which the node is listening
6056 } LDKNetAddress_LDKIPv4_Body;
6058 typedef struct LDKNetAddress_LDKIPv6_Body {
6060 * The 16-byte IPv6 address
6062 struct LDKSixteenBytes addr;
6064 * The port on which the node is listening
6067 } LDKNetAddress_LDKIPv6_Body;
6069 typedef struct LDKNetAddress_LDKOnionV3_Body {
6071 * The ed25519 long-term public key of the peer
6073 struct LDKThirtyTwoBytes ed25519_pubkey;
6075 * The checksum of the pubkey and version, as included in the onion address
6079 * The version byte, as defined by the Tor Onion v3 spec.
6083 * The port on which the node is listening
6086 } LDKNetAddress_LDKOnionV3_Body;
6088 typedef struct MUST_USE_STRUCT LDKNetAddress {
6089 LDKNetAddress_Tag tag;
6091 LDKNetAddress_LDKIPv4_Body i_pv4;
6092 LDKNetAddress_LDKIPv6_Body i_pv6;
6094 struct LDKTwelveBytes onion_v2;
6096 LDKNetAddress_LDKOnionV3_Body onion_v3;
6101 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
6102 * This corresponds to std::vector in C++
6104 typedef struct LDKCVec_NetAddressZ {
6106 * The elements in the array.
6107 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6109 struct LDKNetAddress *data;
6111 * The number of elements pointed to by `data`.
6114 } LDKCVec_NetAddressZ;
6117 * A tuple of 2 elements. See the individual fields for the types contained.
6119 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
6121 * The element at position 0
6123 struct LDKThirtyTwoBytes a;
6125 * The element at position 1
6127 struct LDKThirtyTwoBytes b;
6128 } LDKC2Tuple_PaymentHashPaymentSecretZ;
6131 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ
6133 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
6135 * A pointer to the contents in the success state.
6136 * Reading from this pointer when `result_ok` is not set is undefined.
6138 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
6140 * Note that this value is always NULL, as there are no contents in the Err variant
6143 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr;
6146 * A CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents the result of a fallible operation,
6147 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a () on failure.
6148 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6150 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
6152 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ, accessible via either
6153 * `err` or `result` depending on the state of `result_ok`.
6155 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr contents;
6157 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents a success state.
6160 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ;
6163 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ
6165 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr {
6167 * A pointer to the contents in the success state.
6168 * Reading from this pointer when `result_ok` is not set is undefined.
6170 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
6172 * A pointer to the contents in the error state.
6173 * Reading from this pointer when `result_ok` is set is undefined.
6175 struct LDKAPIError *err;
6176 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr;
6179 * A CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents the result of a fallible operation,
6180 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a crate::lightning::util::errors::APIError on failure.
6181 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6183 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
6185 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ, accessible via either
6186 * `err` or `result` depending on the state of `result_ok`.
6188 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr contents;
6190 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents a success state.
6193 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ;
6196 * The contents of CResult_PaymentSecretNoneZ
6198 typedef union LDKCResult_PaymentSecretNoneZPtr {
6200 * A pointer to the contents in the success state.
6201 * Reading from this pointer when `result_ok` is not set is undefined.
6203 struct LDKThirtyTwoBytes *result;
6205 * Note that this value is always NULL, as there are no contents in the Err variant
6208 } LDKCResult_PaymentSecretNoneZPtr;
6211 * A CResult_PaymentSecretNoneZ represents the result of a fallible operation,
6212 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
6213 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6215 typedef struct LDKCResult_PaymentSecretNoneZ {
6217 * The contents of this CResult_PaymentSecretNoneZ, accessible via either
6218 * `err` or `result` depending on the state of `result_ok`.
6220 union LDKCResult_PaymentSecretNoneZPtr contents;
6222 * Whether this CResult_PaymentSecretNoneZ represents a success state.
6225 } LDKCResult_PaymentSecretNoneZ;
6228 * The contents of CResult_PaymentSecretAPIErrorZ
6230 typedef union LDKCResult_PaymentSecretAPIErrorZPtr {
6232 * A pointer to the contents in the success state.
6233 * Reading from this pointer when `result_ok` is not set is undefined.
6235 struct LDKThirtyTwoBytes *result;
6237 * A pointer to the contents in the error state.
6238 * Reading from this pointer when `result_ok` is set is undefined.
6240 struct LDKAPIError *err;
6241 } LDKCResult_PaymentSecretAPIErrorZPtr;
6244 * A CResult_PaymentSecretAPIErrorZ represents the result of a fallible operation,
6245 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
6246 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6248 typedef struct LDKCResult_PaymentSecretAPIErrorZ {
6250 * The contents of this CResult_PaymentSecretAPIErrorZ, accessible via either
6251 * `err` or `result` depending on the state of `result_ok`.
6253 union LDKCResult_PaymentSecretAPIErrorZPtr contents;
6255 * Whether this CResult_PaymentSecretAPIErrorZ represents a success state.
6258 } LDKCResult_PaymentSecretAPIErrorZ;
6261 * The contents of CResult_PaymentPreimageAPIErrorZ
6263 typedef union LDKCResult_PaymentPreimageAPIErrorZPtr {
6265 * A pointer to the contents in the success state.
6266 * Reading from this pointer when `result_ok` is not set is undefined.
6268 struct LDKThirtyTwoBytes *result;
6270 * A pointer to the contents in the error state.
6271 * Reading from this pointer when `result_ok` is set is undefined.
6273 struct LDKAPIError *err;
6274 } LDKCResult_PaymentPreimageAPIErrorZPtr;
6277 * A CResult_PaymentPreimageAPIErrorZ represents the result of a fallible operation,
6278 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
6279 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6281 typedef struct LDKCResult_PaymentPreimageAPIErrorZ {
6283 * The contents of this CResult_PaymentPreimageAPIErrorZ, accessible via either
6284 * `err` or `result` depending on the state of `result_ok`.
6286 union LDKCResult_PaymentPreimageAPIErrorZPtr contents;
6288 * Whether this CResult_PaymentPreimageAPIErrorZ represents a success state.
6291 } LDKCResult_PaymentPreimageAPIErrorZ;
6296 * Information needed for constructing an invoice route hint for this channel.
6298 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
6300 * A pointer to the opaque Rust object.
6301 * Nearly everywhere, inner must be non-null, however in places where
6302 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6304 LDKnativeCounterpartyForwardingInfo *inner;
6306 * Indicates that this is the only struct which contains the same pointer.
6307 * Rust functions which take ownership of an object provided via an argument require
6308 * this to be true and invalidate the object pointed to by inner.
6311 } LDKCounterpartyForwardingInfo;
6314 * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
6316 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
6318 * A pointer to the contents in the success state.
6319 * Reading from this pointer when `result_ok` is not set is undefined.
6321 struct LDKCounterpartyForwardingInfo *result;
6323 * A pointer to the contents in the error state.
6324 * Reading from this pointer when `result_ok` is set is undefined.
6326 struct LDKDecodeError *err;
6327 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
6330 * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
6331 * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6332 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6334 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
6336 * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
6337 * `err` or `result` depending on the state of `result_ok`.
6339 union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
6341 * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
6344 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
6349 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
6350 * to better separate parameters.
6352 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
6354 * A pointer to the opaque Rust object.
6355 * Nearly everywhere, inner must be non-null, however in places where
6356 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6358 LDKnativeChannelCounterparty *inner;
6360 * Indicates that this is the only struct which contains the same pointer.
6361 * Rust functions which take ownership of an object provided via an argument require
6362 * this to be true and invalidate the object pointed to by inner.
6365 } LDKChannelCounterparty;
6368 * The contents of CResult_ChannelCounterpartyDecodeErrorZ
6370 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
6372 * A pointer to the contents in the success state.
6373 * Reading from this pointer when `result_ok` is not set is undefined.
6375 struct LDKChannelCounterparty *result;
6377 * A pointer to the contents in the error state.
6378 * Reading from this pointer when `result_ok` is set is undefined.
6380 struct LDKDecodeError *err;
6381 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
6384 * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
6385 * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
6386 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6388 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
6390 * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
6391 * `err` or `result` depending on the state of `result_ok`.
6393 union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
6395 * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
6398 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
6401 * The contents of CResult_ChannelDetailsDecodeErrorZ
6403 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
6405 * A pointer to the contents in the success state.
6406 * Reading from this pointer when `result_ok` is not set is undefined.
6408 struct LDKChannelDetails *result;
6410 * A pointer to the contents in the error state.
6411 * Reading from this pointer when `result_ok` is set is undefined.
6413 struct LDKDecodeError *err;
6414 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
6417 * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
6418 * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
6419 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6421 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
6423 * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
6424 * `err` or `result` depending on the state of `result_ok`.
6426 union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
6428 * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
6431 } LDKCResult_ChannelDetailsDecodeErrorZ;
6436 * Route hints used in constructing invoices for [phantom node payents].
6438 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
6440 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
6442 * A pointer to the opaque Rust object.
6443 * Nearly everywhere, inner must be non-null, however in places where
6444 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6446 LDKnativePhantomRouteHints *inner;
6448 * Indicates that this is the only struct which contains the same pointer.
6449 * Rust functions which take ownership of an object provided via an argument require
6450 * this to be true and invalidate the object pointed to by inner.
6453 } LDKPhantomRouteHints;
6456 * The contents of CResult_PhantomRouteHintsDecodeErrorZ
6458 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
6460 * A pointer to the contents in the success state.
6461 * Reading from this pointer when `result_ok` is not set is undefined.
6463 struct LDKPhantomRouteHints *result;
6465 * A pointer to the contents in the error state.
6466 * Reading from this pointer when `result_ok` is set is undefined.
6468 struct LDKDecodeError *err;
6469 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
6472 * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
6473 * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
6474 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6476 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
6478 * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
6479 * `err` or `result` depending on the state of `result_ok`.
6481 union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
6483 * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
6486 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
6489 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
6490 * This corresponds to std::vector in C++
6492 typedef struct LDKCVec_ChannelMonitorZ {
6494 * The elements in the array.
6495 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6497 struct LDKChannelMonitor *data;
6499 * The number of elements pointed to by `data`.
6502 } LDKCVec_ChannelMonitorZ;
6507 * An update generated by the underlying Channel itself which contains some new information the
6508 * ChannelMonitor should be made aware of.
6510 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
6512 * A pointer to the opaque Rust object.
6513 * Nearly everywhere, inner must be non-null, however in places where
6514 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6516 LDKnativeChannelMonitorUpdate *inner;
6518 * Indicates that this is the only struct which contains the same pointer.
6519 * Rust functions which take ownership of an object provided via an argument require
6520 * this to be true and invalidate the object pointed to by inner.
6523 } LDKChannelMonitorUpdate;
6526 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
6527 * blocks are connected and disconnected.
6529 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
6530 * responsible for maintaining a set of monitors such that they can be updated accordingly as
6531 * channel state changes and HTLCs are resolved. See method documentation for specific
6534 * Implementations **must** ensure that updates are successfully applied and persisted upon method
6535 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
6536 * without taking any further action such as persisting the current state.
6538 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
6539 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
6540 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
6541 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
6542 * multiple instances.
6544 * [`PermanentFailure`]: ChannelMonitorUpdateErr::PermanentFailure
6546 typedef struct LDKWatch {
6548 * An opaque pointer which is passed to your function implementations as an argument.
6549 * This has no meaning in the LDK, and can be NULL or any other value.
6553 * Watches a channel identified by `funding_txo` using `monitor`.
6555 * Implementations are responsible for watching the chain for the funding transaction along
6556 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
6557 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
6559 * Note: this interface MUST error with `ChannelMonitorUpdateErr::PermanentFailure` if
6560 * the given `funding_txo` has previously been registered via `watch_channel`.
6562 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
6563 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
6564 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
6566 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
6568 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
6570 * Implementations must call [`update_monitor`] with the given update. See
6571 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
6573 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
6575 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
6577 * Returns any monitor events since the last call. Subsequent calls must only return new
6580 * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
6581 * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
6584 * For details on asynchronous [`ChannelMonitor`] updating and returning
6585 * [`MonitorEvent::UpdateCompleted`] here, see [`ChannelMonitorUpdateErr::TemporaryFailure`].
6587 struct LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
6589 * Frees any resources associated with this object given its this_arg pointer.
6590 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6592 void (*free)(void *this_arg);
6596 * An interface to send a transaction to the Bitcoin network.
6598 typedef struct LDKBroadcasterInterface {
6600 * An opaque pointer which is passed to your function implementations as an argument.
6601 * This has no meaning in the LDK, and can be NULL or any other value.
6605 * Sends a transaction out to (hopefully) be mined.
6607 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
6609 * Frees any resources associated with this object given its this_arg pointer.
6610 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6612 void (*free)(void *this_arg);
6613 } LDKBroadcasterInterface;
6616 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
6617 * own the memory pointed to by data.
6619 typedef struct LDKu8slice {
6621 * A pointer to the byte buffer
6623 const uint8_t *data;
6625 * The number of bytes pointed to by `data`.
6631 * A trait to describe an object which can get user secrets and key material.
6633 typedef struct LDKKeysInterface {
6635 * An opaque pointer which is passed to your function implementations as an argument.
6636 * This has no meaning in the LDK, and can be NULL or any other value.
6640 * Get node secret key (aka node_id or network_key) based on the provided [`Recipient`].
6642 * This method must return the same value each time it is called with a given `Recipient`
6645 struct LDKCResult_SecretKeyNoneZ (*get_node_secret)(const void *this_arg, enum LDKRecipient recipient);
6647 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
6649 * This method should return a different value each time it is called, to avoid linking
6650 * on-chain funds across channels as controlled to the same user.
6652 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
6654 * Get a script pubkey which we will send funds to when closing a channel.
6656 * This method should return a different value each time it is called, to avoid linking
6657 * on-chain funds across channels as controlled to the same user.
6659 struct LDKShutdownScript (*get_shutdown_scriptpubkey)(const void *this_arg);
6661 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
6662 * restarted with some stale data!
6664 * This method must return a different value each time it is called.
6666 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
6668 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
6669 * onion packets and for temporary channel IDs. There is no requirement that these be
6670 * persisted anywhere, though they must be unique across restarts.
6672 * This method must return a different value each time it is called.
6674 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
6676 * Reads a `Signer` for this `KeysInterface` from the given input stream.
6677 * This is only called during deserialization of other objects which contain
6678 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
6679 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
6680 * contain no versioning scheme. You may wish to include your own version prefix and ensure
6681 * you've read all of the provided bytes to ensure no corruption occurred.
6683 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
6686 * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
6687 * this trait to parse the invoice and make sure they're signing what they expect, rather than
6688 * blindly signing the hash.
6689 * The hrp is ascii bytes, while the invoice data is base32.
6691 * The secret key used to sign the invoice is dependent on the [`Recipient`].
6693 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_u5Z invoice_data, enum LDKRecipient receipient);
6695 * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
6697 * If the implementor of this trait supports [phantom node payments], then every node that is
6698 * intended to be included in the phantom invoice route hints must return the same value from
6701 * This method must return the same value each time it is called.
6703 * [phantom node payments]: PhantomKeysManager
6705 struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
6707 * Frees any resources associated with this object given its this_arg pointer.
6708 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6710 void (*free)(void *this_arg);
6714 * A trait which should be implemented to provide feerate information on a number of time
6717 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
6718 * called from inside the library in response to chain events, P2P events, or timer events).
6720 typedef struct LDKFeeEstimator {
6722 * An opaque pointer which is passed to your function implementations as an argument.
6723 * This has no meaning in the LDK, and can be NULL or any other value.
6727 * Gets estimated satoshis of fee required per 1000 Weight-Units.
6729 * Must return a value no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later
6730 * round-downs don't put us below 1 satoshi-per-byte).
6732 * This method can be implemented with the following unit conversions:
6733 * * max(satoshis-per-byte * 250, 253)
6734 * * max(satoshis-per-kbyte / 4, 253)
6736 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
6738 * Frees any resources associated with this object given its this_arg pointer.
6739 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6741 void (*free)(void *this_arg);
6747 * A Record, unit of logging output with Metadata to enable filtering
6748 * Module_path, file, line to inform on log's source
6750 typedef struct MUST_USE_STRUCT LDKRecord {
6752 * A pointer to the opaque Rust object.
6753 * Nearly everywhere, inner must be non-null, however in places where
6754 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6756 LDKnativeRecord *inner;
6758 * Indicates that this is the only struct which contains the same pointer.
6759 * Rust functions which take ownership of an object provided via an argument require
6760 * this to be true and invalidate the object pointed to by inner.
6766 * A trait encapsulating the operations required of a logger
6768 typedef struct LDKLogger {
6770 * An opaque pointer which is passed to your function implementations as an argument.
6771 * This has no meaning in the LDK, and can be NULL or any other value.
6777 void (*log)(const void *this_arg, const struct LDKRecord *NONNULL_PTR record);
6779 * Frees any resources associated with this object given its this_arg pointer.
6780 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6782 void (*free)(void *this_arg);
6788 * Manager which keeps track of a number of channels and sends messages to the appropriate
6789 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
6791 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
6792 * to individual Channels.
6794 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
6795 * all peers during write/read (though does not modify this instance, only the instance being
6796 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
6797 * called funding_transaction_generated for outbound channels).
6799 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
6800 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
6801 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
6802 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
6803 * the serialization process). If the deserialized version is out-of-date compared to the
6804 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
6805 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
6807 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
6808 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
6809 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
6810 * block_connected() to step towards your best block) upon deserialization before using the
6813 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
6814 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
6815 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
6816 * offline for a full minute. In order to track this, you must call
6817 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
6819 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
6820 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
6821 * essentially you should default to using a SimpleRefChannelManager, and use a
6822 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
6823 * you're using lightning-net-tokio.
6825 typedef struct MUST_USE_STRUCT LDKChannelManager {
6827 * A pointer to the opaque Rust object.
6828 * Nearly everywhere, inner must be non-null, however in places where
6829 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6831 LDKnativeChannelManager *inner;
6833 * Indicates that this is the only struct which contains the same pointer.
6834 * Rust functions which take ownership of an object provided via an argument require
6835 * this to be true and invalidate the object pointed to by inner.
6838 } LDKChannelManager;
6841 * A tuple of 2 elements. See the individual fields for the types contained.
6843 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
6845 * The element at position 0
6847 struct LDKThirtyTwoBytes a;
6849 * The element at position 1
6851 struct LDKChannelManager b;
6852 } LDKC2Tuple_BlockHashChannelManagerZ;
6855 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
6857 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
6859 * A pointer to the contents in the success state.
6860 * Reading from this pointer when `result_ok` is not set is undefined.
6862 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
6864 * A pointer to the contents in the error state.
6865 * Reading from this pointer when `result_ok` is set is undefined.
6867 struct LDKDecodeError *err;
6868 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
6871 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
6872 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
6873 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6875 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
6877 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
6878 * `err` or `result` depending on the state of `result_ok`.
6880 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
6882 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
6885 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
6890 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
6891 * with our counterparty.
6893 typedef struct MUST_USE_STRUCT LDKChannelConfig {
6895 * A pointer to the opaque Rust object.
6896 * Nearly everywhere, inner must be non-null, however in places where
6897 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6899 LDKnativeChannelConfig *inner;
6901 * Indicates that this is the only struct which contains the same pointer.
6902 * Rust functions which take ownership of an object provided via an argument require
6903 * this to be true and invalidate the object pointed to by inner.
6909 * The contents of CResult_ChannelConfigDecodeErrorZ
6911 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
6913 * A pointer to the contents in the success state.
6914 * Reading from this pointer when `result_ok` is not set is undefined.
6916 struct LDKChannelConfig *result;
6918 * A pointer to the contents in the error state.
6919 * Reading from this pointer when `result_ok` is set is undefined.
6921 struct LDKDecodeError *err;
6922 } LDKCResult_ChannelConfigDecodeErrorZPtr;
6925 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
6926 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
6927 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6929 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
6931 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
6932 * `err` or `result` depending on the state of `result_ok`.
6934 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
6936 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
6939 } LDKCResult_ChannelConfigDecodeErrorZ;
6942 * The contents of CResult_OutPointDecodeErrorZ
6944 typedef union LDKCResult_OutPointDecodeErrorZPtr {
6946 * A pointer to the contents in the success state.
6947 * Reading from this pointer when `result_ok` is not set is undefined.
6949 struct LDKOutPoint *result;
6951 * A pointer to the contents in the error state.
6952 * Reading from this pointer when `result_ok` is set is undefined.
6954 struct LDKDecodeError *err;
6955 } LDKCResult_OutPointDecodeErrorZPtr;
6958 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
6959 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
6960 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6962 typedef struct LDKCResult_OutPointDecodeErrorZ {
6964 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
6965 * `err` or `result` depending on the state of `result_ok`.
6967 union LDKCResult_OutPointDecodeErrorZPtr contents;
6969 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
6972 } LDKCResult_OutPointDecodeErrorZ;
6975 * Defines a type identifier for sending messages over the wire.
6977 * Messages implementing this trait specify a type and must be [`Writeable`].
6979 typedef struct LDKType {
6981 * An opaque pointer which is passed to your function implementations as an argument.
6982 * This has no meaning in the LDK, and can be NULL or any other value.
6986 * Returns the type identifying the message payload.
6988 uint16_t (*type_id)(const void *this_arg);
6990 * Return a human-readable "debug" string describing this object
6992 struct LDKStr (*debug_str)(const void *this_arg);
6994 * Serialize the object into a byte array
6996 struct LDKCVec_u8Z (*write)(const void *this_arg);
6998 * Frees any resources associated with this object given its this_arg pointer.
6999 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7001 void (*free)(void *this_arg);
7005 * An enum which can either contain a crate::lightning::ln::wire::Type or not
7007 typedef enum LDKCOption_TypeZ_Tag {
7009 * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
7011 LDKCOption_TypeZ_Some,
7013 * When we're in this state, this COption_TypeZ contains nothing
7015 LDKCOption_TypeZ_None,
7017 * Must be last for serialization purposes
7019 LDKCOption_TypeZ_Sentinel,
7020 } LDKCOption_TypeZ_Tag;
7022 typedef struct LDKCOption_TypeZ {
7023 LDKCOption_TypeZ_Tag tag;
7026 struct LDKType some;
7032 * The contents of CResult_COption_TypeZDecodeErrorZ
7034 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
7036 * A pointer to the contents in the success state.
7037 * Reading from this pointer when `result_ok` is not set is undefined.
7039 struct LDKCOption_TypeZ *result;
7041 * A pointer to the contents in the error state.
7042 * Reading from this pointer when `result_ok` is set is undefined.
7044 struct LDKDecodeError *err;
7045 } LDKCResult_COption_TypeZDecodeErrorZPtr;
7048 * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
7049 * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
7050 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7052 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
7054 * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
7055 * `err` or `result` depending on the state of `result_ok`.
7057 union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
7059 * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
7062 } LDKCResult_COption_TypeZDecodeErrorZ;
7065 * An error that may occur when making a payment.
7067 typedef enum LDKPaymentError_Tag {
7069 * An error resulting from the provided [`Invoice`] or payment hash.
7071 LDKPaymentError_Invoice,
7073 * An error occurring when finding a route.
7075 LDKPaymentError_Routing,
7077 * An error occurring when sending a payment.
7079 LDKPaymentError_Sending,
7081 * Must be last for serialization purposes
7083 LDKPaymentError_Sentinel,
7084 } LDKPaymentError_Tag;
7086 typedef struct MUST_USE_STRUCT LDKPaymentError {
7087 LDKPaymentError_Tag tag;
7090 struct LDKStr invoice;
7093 struct LDKLightningError routing;
7096 struct LDKPaymentSendFailure sending;
7102 * The contents of CResult_PaymentIdPaymentErrorZ
7104 typedef union LDKCResult_PaymentIdPaymentErrorZPtr {
7106 * A pointer to the contents in the success state.
7107 * Reading from this pointer when `result_ok` is not set is undefined.
7109 struct LDKThirtyTwoBytes *result;
7111 * A pointer to the contents in the error state.
7112 * Reading from this pointer when `result_ok` is set is undefined.
7114 struct LDKPaymentError *err;
7115 } LDKCResult_PaymentIdPaymentErrorZPtr;
7118 * A CResult_PaymentIdPaymentErrorZ represents the result of a fallible operation,
7119 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning_invoice::payment::PaymentError on failure.
7120 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7122 typedef struct LDKCResult_PaymentIdPaymentErrorZ {
7124 * The contents of this CResult_PaymentIdPaymentErrorZ, accessible via either
7125 * `err` or `result` depending on the state of `result_ok`.
7127 union LDKCResult_PaymentIdPaymentErrorZPtr contents;
7129 * Whether this CResult_PaymentIdPaymentErrorZ represents a success state.
7132 } LDKCResult_PaymentIdPaymentErrorZ;
7135 * Represents an error returned from the bech32 library during validation of some bech32 data
7137 typedef enum LDKBech32Error_Tag {
7139 * String does not contain the separator character
7141 LDKBech32Error_MissingSeparator,
7143 * The checksum does not match the rest of the data
7145 LDKBech32Error_InvalidChecksum,
7147 * The data or human-readable part is too long or too short
7149 LDKBech32Error_InvalidLength,
7151 * Some part of the string contains an invalid character
7153 LDKBech32Error_InvalidChar,
7155 * Some part of the data has an invalid value
7157 LDKBech32Error_InvalidData,
7159 * The bit conversion failed due to a padding issue
7161 LDKBech32Error_InvalidPadding,
7163 * The whole string must be of one case
7165 LDKBech32Error_MixedCase,
7167 * Must be last for serialization purposes
7169 LDKBech32Error_Sentinel,
7170 } LDKBech32Error_Tag;
7172 typedef struct LDKBech32Error {
7173 LDKBech32Error_Tag tag;
7176 uint32_t invalid_char;
7179 uint8_t invalid_data;
7185 * Sub-errors which don't have specific information in them use this type.
7187 typedef struct LDKError {
7189 * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
7195 * Errors that indicate what is wrong with the invoice. They have some granularity for debug
7196 * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
7198 typedef enum LDKParseError_Tag {
7199 LDKParseError_Bech32Error,
7200 LDKParseError_ParseAmountError,
7201 LDKParseError_MalformedSignature,
7202 LDKParseError_BadPrefix,
7203 LDKParseError_UnknownCurrency,
7204 LDKParseError_UnknownSiPrefix,
7205 LDKParseError_MalformedHRP,
7206 LDKParseError_TooShortDataPart,
7207 LDKParseError_UnexpectedEndOfTaggedFields,
7208 LDKParseError_DescriptionDecodeError,
7209 LDKParseError_PaddingError,
7210 LDKParseError_IntegerOverflowError,
7211 LDKParseError_InvalidSegWitProgramLength,
7212 LDKParseError_InvalidPubKeyHashLength,
7213 LDKParseError_InvalidScriptHashLength,
7214 LDKParseError_InvalidRecoveryId,
7215 LDKParseError_InvalidSliceLength,
7217 * Not an error, but used internally to signal that a part of the invoice should be ignored
7218 * according to BOLT11
7222 * Must be last for serialization purposes
7224 LDKParseError_Sentinel,
7225 } LDKParseError_Tag;
7227 typedef struct MUST_USE_STRUCT LDKParseError {
7228 LDKParseError_Tag tag;
7231 struct LDKBech32Error bech32_error;
7234 struct LDKError parse_amount_error;
7237 enum LDKSecp256k1Error malformed_signature;
7240 struct LDKError description_decode_error;
7243 struct LDKStr invalid_slice_length;
7249 * The contents of CResult_SiPrefixParseErrorZ
7251 typedef union LDKCResult_SiPrefixParseErrorZPtr {
7253 * A pointer to the contents in the success state.
7254 * Reading from this pointer when `result_ok` is not set is undefined.
7256 enum LDKSiPrefix *result;
7258 * A pointer to the contents in the error state.
7259 * Reading from this pointer when `result_ok` is set is undefined.
7261 struct LDKParseError *err;
7262 } LDKCResult_SiPrefixParseErrorZPtr;
7265 * A CResult_SiPrefixParseErrorZ represents the result of a fallible operation,
7266 * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::ParseError on failure.
7267 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7269 typedef struct LDKCResult_SiPrefixParseErrorZ {
7271 * The contents of this CResult_SiPrefixParseErrorZ, accessible via either
7272 * `err` or `result` depending on the state of `result_ok`.
7274 union LDKCResult_SiPrefixParseErrorZPtr contents;
7276 * Whether this CResult_SiPrefixParseErrorZ represents a success state.
7279 } LDKCResult_SiPrefixParseErrorZ;
7284 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
7286 * There are three ways to construct an `Invoice`:
7287 * 1. using `InvoiceBuilder`
7288 * 2. using `Invoice::from_signed(SignedRawInvoice)`
7289 * 3. using `str::parse::<Invoice>(&str)`
7291 typedef struct MUST_USE_STRUCT LDKInvoice {
7293 * A pointer to the opaque Rust object.
7294 * Nearly everywhere, inner must be non-null, however in places where
7295 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7297 LDKnativeInvoice *inner;
7299 * Indicates that this is the only struct which contains the same pointer.
7300 * Rust functions which take ownership of an object provided via an argument require
7301 * this to be true and invalidate the object pointed to by inner.
7307 * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
7308 * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
7309 * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
7311 typedef enum LDKParseOrSemanticError_Tag {
7313 * The invoice couldn't be decoded
7315 LDKParseOrSemanticError_ParseError,
7317 * The invoice could be decoded but violates the BOLT11 standard
7319 LDKParseOrSemanticError_SemanticError,
7321 * Must be last for serialization purposes
7323 LDKParseOrSemanticError_Sentinel,
7324 } LDKParseOrSemanticError_Tag;
7326 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
7327 LDKParseOrSemanticError_Tag tag;
7330 struct LDKParseError parse_error;
7333 enum LDKSemanticError semantic_error;
7336 } LDKParseOrSemanticError;
7339 * The contents of CResult_InvoiceParseOrSemanticErrorZ
7341 typedef union LDKCResult_InvoiceParseOrSemanticErrorZPtr {
7343 * A pointer to the contents in the success state.
7344 * Reading from this pointer when `result_ok` is not set is undefined.
7346 struct LDKInvoice *result;
7348 * A pointer to the contents in the error state.
7349 * Reading from this pointer when `result_ok` is set is undefined.
7351 struct LDKParseOrSemanticError *err;
7352 } LDKCResult_InvoiceParseOrSemanticErrorZPtr;
7355 * A CResult_InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
7356 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
7357 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7359 typedef struct LDKCResult_InvoiceParseOrSemanticErrorZ {
7361 * The contents of this CResult_InvoiceParseOrSemanticErrorZ, accessible via either
7362 * `err` or `result` depending on the state of `result_ok`.
7364 union LDKCResult_InvoiceParseOrSemanticErrorZPtr contents;
7366 * Whether this CResult_InvoiceParseOrSemanticErrorZ represents a success state.
7369 } LDKCResult_InvoiceParseOrSemanticErrorZ;
7374 * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be
7378 * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`.
7380 typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
7382 * A pointer to the opaque Rust object.
7383 * Nearly everywhere, inner must be non-null, however in places where
7384 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7386 LDKnativeSignedRawInvoice *inner;
7388 * Indicates that this is the only struct which contains the same pointer.
7389 * Rust functions which take ownership of an object provided via an argument require
7390 * this to be true and invalidate the object pointed to by inner.
7393 } LDKSignedRawInvoice;
7396 * The contents of CResult_SignedRawInvoiceParseErrorZ
7398 typedef union LDKCResult_SignedRawInvoiceParseErrorZPtr {
7400 * A pointer to the contents in the success state.
7401 * Reading from this pointer when `result_ok` is not set is undefined.
7403 struct LDKSignedRawInvoice *result;
7405 * A pointer to the contents in the error state.
7406 * Reading from this pointer when `result_ok` is set is undefined.
7408 struct LDKParseError *err;
7409 } LDKCResult_SignedRawInvoiceParseErrorZPtr;
7412 * A CResult_SignedRawInvoiceParseErrorZ represents the result of a fallible operation,
7413 * containing a crate::lightning_invoice::SignedRawInvoice on success and a crate::lightning_invoice::ParseError on failure.
7414 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7416 typedef struct LDKCResult_SignedRawInvoiceParseErrorZ {
7418 * The contents of this CResult_SignedRawInvoiceParseErrorZ, accessible via either
7419 * `err` or `result` depending on the state of `result_ok`.
7421 union LDKCResult_SignedRawInvoiceParseErrorZPtr contents;
7423 * Whether this CResult_SignedRawInvoiceParseErrorZ represents a success state.
7426 } LDKCResult_SignedRawInvoiceParseErrorZ;
7431 * Represents an syntactically correct Invoice for a payment on the lightning network,
7432 * but without the signature information.
7433 * De- and encoding should not lead to information loss but may lead to different hashes.
7435 * For methods without docs see the corresponding methods in `Invoice`.
7437 typedef struct MUST_USE_STRUCT LDKRawInvoice {
7439 * A pointer to the opaque Rust object.
7440 * Nearly everywhere, inner must be non-null, however in places where
7441 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7443 LDKnativeRawInvoice *inner;
7445 * Indicates that this is the only struct which contains the same pointer.
7446 * Rust functions which take ownership of an object provided via an argument require
7447 * this to be true and invalidate the object pointed to by inner.
7455 * Recoverable signature
7457 typedef struct MUST_USE_STRUCT LDKInvoiceSignature {
7459 * A pointer to the opaque Rust object.
7460 * Nearly everywhere, inner must be non-null, however in places where
7461 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7463 LDKnativeInvoiceSignature *inner;
7465 * Indicates that this is the only struct which contains the same pointer.
7466 * Rust functions which take ownership of an object provided via an argument require
7467 * this to be true and invalidate the object pointed to by inner.
7470 } LDKInvoiceSignature;
7473 * A tuple of 3 elements. See the individual fields for the types contained.
7475 typedef struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ {
7477 * The element at position 0
7479 struct LDKRawInvoice a;
7481 * The element at position 1
7483 struct LDKThirtyTwoBytes b;
7485 * The element at position 2
7487 struct LDKInvoiceSignature c;
7488 } LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ;
7495 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
7497 * A pointer to the opaque Rust object.
7498 * Nearly everywhere, inner must be non-null, however in places where
7499 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7501 LDKnativePayeePubKey *inner;
7503 * Indicates that this is the only struct which contains the same pointer.
7504 * Rust functions which take ownership of an object provided via an argument require
7505 * this to be true and invalidate the object pointed to by inner.
7511 * The contents of CResult_PayeePubKeyErrorZ
7513 typedef union LDKCResult_PayeePubKeyErrorZPtr {
7515 * A pointer to the contents in the success state.
7516 * Reading from this pointer when `result_ok` is not set is undefined.
7518 struct LDKPayeePubKey *result;
7520 * A pointer to the contents in the error state.
7521 * Reading from this pointer when `result_ok` is set is undefined.
7523 enum LDKSecp256k1Error *err;
7524 } LDKCResult_PayeePubKeyErrorZPtr;
7527 * A CResult_PayeePubKeyErrorZ represents the result of a fallible operation,
7528 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
7529 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7531 typedef struct LDKCResult_PayeePubKeyErrorZ {
7533 * The contents of this CResult_PayeePubKeyErrorZ, accessible via either
7534 * `err` or `result` depending on the state of `result_ok`.
7536 union LDKCResult_PayeePubKeyErrorZPtr contents;
7538 * Whether this CResult_PayeePubKeyErrorZ represents a success state.
7541 } LDKCResult_PayeePubKeyErrorZ;
7546 * Private routing information
7549 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
7552 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
7554 * A pointer to the opaque Rust object.
7555 * Nearly everywhere, inner must be non-null, however in places where
7556 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7558 LDKnativePrivateRoute *inner;
7560 * Indicates that this is the only struct which contains the same pointer.
7561 * Rust functions which take ownership of an object provided via an argument require
7562 * this to be true and invalidate the object pointed to by inner.
7568 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
7569 * This corresponds to std::vector in C++
7571 typedef struct LDKCVec_PrivateRouteZ {
7573 * The elements in the array.
7574 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7576 struct LDKPrivateRoute *data;
7578 * The number of elements pointed to by `data`.
7581 } LDKCVec_PrivateRouteZ;
7586 * A timestamp that refers to a date after 1 January 1970.
7590 * The Unix timestamp representing the stored time has to be positive and no greater than
7591 * [`MAX_TIMESTAMP`].
7593 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
7595 * A pointer to the opaque Rust object.
7596 * Nearly everywhere, inner must be non-null, however in places where
7597 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7599 LDKnativePositiveTimestamp *inner;
7601 * Indicates that this is the only struct which contains the same pointer.
7602 * Rust functions which take ownership of an object provided via an argument require
7603 * this to be true and invalidate the object pointed to by inner.
7606 } LDKPositiveTimestamp;
7609 * The contents of CResult_PositiveTimestampCreationErrorZ
7611 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
7613 * A pointer to the contents in the success state.
7614 * Reading from this pointer when `result_ok` is not set is undefined.
7616 struct LDKPositiveTimestamp *result;
7618 * A pointer to the contents in the error state.
7619 * Reading from this pointer when `result_ok` is set is undefined.
7621 enum LDKCreationError *err;
7622 } LDKCResult_PositiveTimestampCreationErrorZPtr;
7625 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
7626 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
7627 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7629 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
7631 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
7632 * `err` or `result` depending on the state of `result_ok`.
7634 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
7636 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
7639 } LDKCResult_PositiveTimestampCreationErrorZ;
7642 * The contents of CResult_NoneSemanticErrorZ
7644 typedef union LDKCResult_NoneSemanticErrorZPtr {
7646 * Note that this value is always NULL, as there are no contents in the OK variant
7650 * A pointer to the contents in the error state.
7651 * Reading from this pointer when `result_ok` is set is undefined.
7653 enum LDKSemanticError *err;
7654 } LDKCResult_NoneSemanticErrorZPtr;
7657 * A CResult_NoneSemanticErrorZ represents the result of a fallible operation,
7658 * containing a () on success and a crate::lightning_invoice::SemanticError on failure.
7659 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7661 typedef struct LDKCResult_NoneSemanticErrorZ {
7663 * The contents of this CResult_NoneSemanticErrorZ, accessible via either
7664 * `err` or `result` depending on the state of `result_ok`.
7666 union LDKCResult_NoneSemanticErrorZPtr contents;
7668 * Whether this CResult_NoneSemanticErrorZ represents a success state.
7671 } LDKCResult_NoneSemanticErrorZ;
7674 * The contents of CResult_InvoiceSemanticErrorZ
7676 typedef union LDKCResult_InvoiceSemanticErrorZPtr {
7678 * A pointer to the contents in the success state.
7679 * Reading from this pointer when `result_ok` is not set is undefined.
7681 struct LDKInvoice *result;
7683 * A pointer to the contents in the error state.
7684 * Reading from this pointer when `result_ok` is set is undefined.
7686 enum LDKSemanticError *err;
7687 } LDKCResult_InvoiceSemanticErrorZPtr;
7690 * A CResult_InvoiceSemanticErrorZ represents the result of a fallible operation,
7691 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SemanticError on failure.
7692 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7694 typedef struct LDKCResult_InvoiceSemanticErrorZ {
7696 * The contents of this CResult_InvoiceSemanticErrorZ, accessible via either
7697 * `err` or `result` depending on the state of `result_ok`.
7699 union LDKCResult_InvoiceSemanticErrorZPtr contents;
7701 * Whether this CResult_InvoiceSemanticErrorZ represents a success state.
7704 } LDKCResult_InvoiceSemanticErrorZ;
7709 * Description string
7712 * The description can be at most 639 __bytes__ long
7714 typedef struct MUST_USE_STRUCT LDKDescription {
7716 * A pointer to the opaque Rust object.
7717 * Nearly everywhere, inner must be non-null, however in places where
7718 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7720 LDKnativeDescription *inner;
7722 * Indicates that this is the only struct which contains the same pointer.
7723 * Rust functions which take ownership of an object provided via an argument require
7724 * this to be true and invalidate the object pointed to by inner.
7730 * The contents of CResult_DescriptionCreationErrorZ
7732 typedef union LDKCResult_DescriptionCreationErrorZPtr {
7734 * A pointer to the contents in the success state.
7735 * Reading from this pointer when `result_ok` is not set is undefined.
7737 struct LDKDescription *result;
7739 * A pointer to the contents in the error state.
7740 * Reading from this pointer when `result_ok` is set is undefined.
7742 enum LDKCreationError *err;
7743 } LDKCResult_DescriptionCreationErrorZPtr;
7746 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
7747 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
7748 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7750 typedef struct LDKCResult_DescriptionCreationErrorZ {
7752 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
7753 * `err` or `result` depending on the state of `result_ok`.
7755 union LDKCResult_DescriptionCreationErrorZPtr contents;
7757 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
7760 } LDKCResult_DescriptionCreationErrorZ;
7763 * The contents of CResult_PrivateRouteCreationErrorZ
7765 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
7767 * A pointer to the contents in the success state.
7768 * Reading from this pointer when `result_ok` is not set is undefined.
7770 struct LDKPrivateRoute *result;
7772 * A pointer to the contents in the error state.
7773 * Reading from this pointer when `result_ok` is set is undefined.
7775 enum LDKCreationError *err;
7776 } LDKCResult_PrivateRouteCreationErrorZPtr;
7779 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
7780 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
7781 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7783 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
7785 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
7786 * `err` or `result` depending on the state of `result_ok`.
7788 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
7790 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
7793 } LDKCResult_PrivateRouteCreationErrorZ;
7796 * The contents of CResult_StringErrorZ
7798 typedef union LDKCResult_StringErrorZPtr {
7800 * A pointer to the contents in the success state.
7801 * Reading from this pointer when `result_ok` is not set is undefined.
7803 struct LDKStr *result;
7805 * A pointer to the contents in the error state.
7806 * Reading from this pointer when `result_ok` is set is undefined.
7808 enum LDKSecp256k1Error *err;
7809 } LDKCResult_StringErrorZPtr;
7812 * A CResult_StringErrorZ represents the result of a fallible operation,
7813 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
7814 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7816 typedef struct LDKCResult_StringErrorZ {
7818 * The contents of this CResult_StringErrorZ, accessible via either
7819 * `err` or `result` depending on the state of `result_ok`.
7821 union LDKCResult_StringErrorZPtr contents;
7823 * Whether this CResult_StringErrorZ represents a success state.
7826 } LDKCResult_StringErrorZ;
7829 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
7831 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
7833 * A pointer to the contents in the success state.
7834 * Reading from this pointer when `result_ok` is not set is undefined.
7836 struct LDKChannelMonitorUpdate *result;
7838 * A pointer to the contents in the error state.
7839 * Reading from this pointer when `result_ok` is set is undefined.
7841 struct LDKDecodeError *err;
7842 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
7845 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
7846 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
7847 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7849 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
7851 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
7852 * `err` or `result` depending on the state of `result_ok`.
7854 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
7856 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
7859 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
7862 * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
7864 typedef enum LDKCOption_MonitorEventZ_Tag {
7866 * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
7868 LDKCOption_MonitorEventZ_Some,
7870 * When we're in this state, this COption_MonitorEventZ contains nothing
7872 LDKCOption_MonitorEventZ_None,
7874 * Must be last for serialization purposes
7876 LDKCOption_MonitorEventZ_Sentinel,
7877 } LDKCOption_MonitorEventZ_Tag;
7879 typedef struct LDKCOption_MonitorEventZ {
7880 LDKCOption_MonitorEventZ_Tag tag;
7883 struct LDKMonitorEvent some;
7886 } LDKCOption_MonitorEventZ;
7889 * The contents of CResult_COption_MonitorEventZDecodeErrorZ
7891 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
7893 * A pointer to the contents in the success state.
7894 * Reading from this pointer when `result_ok` is not set is undefined.
7896 struct LDKCOption_MonitorEventZ *result;
7898 * A pointer to the contents in the error state.
7899 * Reading from this pointer when `result_ok` is set is undefined.
7901 struct LDKDecodeError *err;
7902 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
7905 * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
7906 * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
7907 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7909 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
7911 * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
7912 * `err` or `result` depending on the state of `result_ok`.
7914 union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
7916 * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
7919 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
7922 * The contents of CResult_HTLCUpdateDecodeErrorZ
7924 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
7926 * A pointer to the contents in the success state.
7927 * Reading from this pointer when `result_ok` is not set is undefined.
7929 struct LDKHTLCUpdate *result;
7931 * A pointer to the contents in the error state.
7932 * Reading from this pointer when `result_ok` is set is undefined.
7934 struct LDKDecodeError *err;
7935 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
7938 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
7939 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
7940 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7942 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
7944 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
7945 * `err` or `result` depending on the state of `result_ok`.
7947 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
7949 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
7952 } LDKCResult_HTLCUpdateDecodeErrorZ;
7955 * A tuple of 2 elements. See the individual fields for the types contained.
7957 typedef struct LDKC2Tuple_OutPointScriptZ {
7959 * The element at position 0
7961 struct LDKOutPoint a;
7963 * The element at position 1
7965 struct LDKCVec_u8Z b;
7966 } LDKC2Tuple_OutPointScriptZ;
7969 * A tuple of 2 elements. See the individual fields for the types contained.
7971 typedef struct LDKC2Tuple_u32ScriptZ {
7973 * The element at position 0
7977 * The element at position 1
7979 struct LDKCVec_u8Z b;
7980 } LDKC2Tuple_u32ScriptZ;
7983 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
7984 * This corresponds to std::vector in C++
7986 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
7988 * The elements in the array.
7989 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7991 struct LDKC2Tuple_u32ScriptZ *data;
7993 * The number of elements pointed to by `data`.
7996 } LDKCVec_C2Tuple_u32ScriptZZ;
7999 * A tuple of 2 elements. See the individual fields for the types contained.
8001 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
8003 * The element at position 0
8005 struct LDKThirtyTwoBytes a;
8007 * The element at position 1
8009 struct LDKCVec_C2Tuple_u32ScriptZZ b;
8010 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
8013 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
8014 * This corresponds to std::vector in C++
8016 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
8018 * The elements in the array.
8019 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8021 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
8023 * The number of elements pointed to by `data`.
8026 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
8029 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
8030 * This corresponds to std::vector in C++
8032 typedef struct LDKCVec_EventZ {
8034 * The elements in the array.
8035 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8037 struct LDKEvent *data;
8039 * The number of elements pointed to by `data`.
8045 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
8046 * This corresponds to std::vector in C++
8048 typedef struct LDKCVec_TransactionZ {
8050 * The elements in the array.
8051 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8053 struct LDKTransaction *data;
8055 * The number of elements pointed to by `data`.
8058 } LDKCVec_TransactionZ;
8061 * A tuple of 2 elements. See the individual fields for the types contained.
8063 typedef struct LDKC2Tuple_u32TxOutZ {
8065 * The element at position 0
8069 * The element at position 1
8072 } LDKC2Tuple_u32TxOutZ;
8075 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
8076 * This corresponds to std::vector in C++
8078 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
8080 * The elements in the array.
8081 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8083 struct LDKC2Tuple_u32TxOutZ *data;
8085 * The number of elements pointed to by `data`.
8088 } LDKCVec_C2Tuple_u32TxOutZZ;
8091 * A tuple of 2 elements. See the individual fields for the types contained.
8093 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
8095 * The element at position 0
8097 struct LDKThirtyTwoBytes a;
8099 * The element at position 1
8101 struct LDKCVec_C2Tuple_u32TxOutZZ b;
8102 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
8105 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
8106 * This corresponds to std::vector in C++
8108 typedef struct LDKCVec_TransactionOutputsZ {
8110 * The elements in the array.
8111 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8113 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
8115 * The number of elements pointed to by `data`.
8118 } LDKCVec_TransactionOutputsZ;
8121 * Details about the balance(s) available for spending once the channel appears on chain.
8123 * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
8126 typedef enum LDKBalance_Tag {
8128 * The channel is not yet closed (or the commitment or closing transaction has not yet
8129 * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
8132 LDKBalance_ClaimableOnChannelClose,
8134 * The channel has been closed, and the given balance is ours but awaiting confirmations until
8135 * we consider it spendable.
8137 LDKBalance_ClaimableAwaitingConfirmations,
8139 * The channel has been closed, and the given balance should be ours but awaiting spending
8140 * transaction confirmation. If the spending transaction does not confirm in time, it is
8141 * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
8143 * Once the spending transaction confirms, before it has reached enough confirmations to be
8144 * considered safe from chain reorganizations, the balance will instead be provided via
8145 * [`Balance::ClaimableAwaitingConfirmations`].
8147 LDKBalance_ContentiousClaimable,
8149 * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
8150 * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
8151 * likely to be claimed by our counterparty before we do.
8153 LDKBalance_MaybeClaimableHTLCAwaitingTimeout,
8155 * Must be last for serialization purposes
8157 LDKBalance_Sentinel,
8160 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
8162 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
8163 * required to do so.
8165 uint64_t claimable_amount_satoshis;
8166 } LDKBalance_LDKClaimableOnChannelClose_Body;
8168 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
8170 * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
8171 * were spent in broadcasting the transaction.
8173 uint64_t claimable_amount_satoshis;
8175 * The height at which an [`Event::SpendableOutputs`] event will be generated for this
8178 uint32_t confirmation_height;
8179 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
8181 typedef struct LDKBalance_LDKContentiousClaimable_Body {
8183 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
8184 * required to do so.
8186 uint64_t claimable_amount_satoshis;
8188 * The height at which the counterparty may be able to claim the balance if we have not
8191 uint32_t timeout_height;
8192 } LDKBalance_LDKContentiousClaimable_Body;
8194 typedef struct LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body {
8196 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
8197 * required to do so.
8199 uint64_t claimable_amount_satoshis;
8201 * The height at which we will be able to claim the balance if our counterparty has not
8204 uint32_t claimable_height;
8205 } LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body;
8207 typedef struct MUST_USE_STRUCT LDKBalance {
8210 LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
8211 LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
8212 LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
8213 LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body maybe_claimable_htlc_awaiting_timeout;
8218 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
8219 * This corresponds to std::vector in C++
8221 typedef struct LDKCVec_BalanceZ {
8223 * The elements in the array.
8224 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8226 struct LDKBalance *data;
8228 * The number of elements pointed to by `data`.
8234 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
8236 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
8238 * A pointer to the contents in the success state.
8239 * Reading from this pointer when `result_ok` is not set is undefined.
8241 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
8243 * A pointer to the contents in the error state.
8244 * Reading from this pointer when `result_ok` is set is undefined.
8246 struct LDKDecodeError *err;
8247 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
8250 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
8251 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
8252 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8254 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
8256 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
8257 * `err` or `result` depending on the state of `result_ok`.
8259 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
8261 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
8264 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
8267 * The contents of CResult_NoneLightningErrorZ
8269 typedef union LDKCResult_NoneLightningErrorZPtr {
8271 * Note that this value is always NULL, as there are no contents in the OK variant
8275 * A pointer to the contents in the error state.
8276 * Reading from this pointer when `result_ok` is set is undefined.
8278 struct LDKLightningError *err;
8279 } LDKCResult_NoneLightningErrorZPtr;
8282 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
8283 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
8284 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8286 typedef struct LDKCResult_NoneLightningErrorZ {
8288 * The contents of this CResult_NoneLightningErrorZ, accessible via either
8289 * `err` or `result` depending on the state of `result_ok`.
8291 union LDKCResult_NoneLightningErrorZPtr contents;
8293 * Whether this CResult_NoneLightningErrorZ represents a success state.
8296 } LDKCResult_NoneLightningErrorZ;
8299 * A tuple of 2 elements. See the individual fields for the types contained.
8301 typedef struct LDKC2Tuple_PublicKeyTypeZ {
8303 * The element at position 0
8305 struct LDKPublicKey a;
8307 * The element at position 1
8310 } LDKC2Tuple_PublicKeyTypeZ;
8313 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
8314 * This corresponds to std::vector in C++
8316 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
8318 * The elements in the array.
8319 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8321 struct LDKC2Tuple_PublicKeyTypeZ *data;
8323 * The number of elements pointed to by `data`.
8326 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
8329 * The contents of CResult_boolLightningErrorZ
8331 typedef union LDKCResult_boolLightningErrorZPtr {
8333 * A pointer to the contents in the success state.
8334 * Reading from this pointer when `result_ok` is not set is undefined.
8338 * A pointer to the contents in the error state.
8339 * Reading from this pointer when `result_ok` is set is undefined.
8341 struct LDKLightningError *err;
8342 } LDKCResult_boolLightningErrorZPtr;
8345 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
8346 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
8347 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8349 typedef struct LDKCResult_boolLightningErrorZ {
8351 * The contents of this CResult_boolLightningErrorZ, accessible via either
8352 * `err` or `result` depending on the state of `result_ok`.
8354 union LDKCResult_boolLightningErrorZPtr contents;
8356 * Whether this CResult_boolLightningErrorZ represents a success state.
8359 } LDKCResult_boolLightningErrorZ;
8362 * A tuple of 3 elements. See the individual fields for the types contained.
8364 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
8366 * The element at position 0
8368 struct LDKChannelAnnouncement a;
8370 * The element at position 1
8372 struct LDKChannelUpdate b;
8374 * The element at position 2
8376 struct LDKChannelUpdate c;
8377 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
8380 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
8381 * This corresponds to std::vector in C++
8383 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
8385 * The elements in the array.
8386 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8388 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
8390 * The number of elements pointed to by `data`.
8393 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
8396 * A dynamically-allocated array of crate::lightning::ln::msgs::NodeAnnouncements of arbitrary size.
8397 * This corresponds to std::vector in C++
8399 typedef struct LDKCVec_NodeAnnouncementZ {
8401 * The elements in the array.
8402 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8404 struct LDKNodeAnnouncement *data;
8406 * The number of elements pointed to by `data`.
8409 } LDKCVec_NodeAnnouncementZ;
8412 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
8413 * This corresponds to std::vector in C++
8415 typedef struct LDKCVec_PublicKeyZ {
8417 * The elements in the array.
8418 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8420 struct LDKPublicKey *data;
8422 * The number of elements pointed to by `data`.
8425 } LDKCVec_PublicKeyZ;
8428 * An enum which can either contain a crate::lightning::ln::msgs::NetAddress or not
8430 typedef enum LDKCOption_NetAddressZ_Tag {
8432 * When we're in this state, this COption_NetAddressZ contains a crate::lightning::ln::msgs::NetAddress
8434 LDKCOption_NetAddressZ_Some,
8436 * When we're in this state, this COption_NetAddressZ contains nothing
8438 LDKCOption_NetAddressZ_None,
8440 * Must be last for serialization purposes
8442 LDKCOption_NetAddressZ_Sentinel,
8443 } LDKCOption_NetAddressZ_Tag;
8445 typedef struct LDKCOption_NetAddressZ {
8446 LDKCOption_NetAddressZ_Tag tag;
8449 struct LDKNetAddress some;
8452 } LDKCOption_NetAddressZ;
8457 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
8458 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
8461 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
8463 * A pointer to the opaque Rust object.
8464 * Nearly everywhere, inner must be non-null, however in places where
8465 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8467 LDKnativePeerHandleError *inner;
8469 * Indicates that this is the only struct which contains the same pointer.
8470 * Rust functions which take ownership of an object provided via an argument require
8471 * this to be true and invalidate the object pointed to by inner.
8474 } LDKPeerHandleError;
8477 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
8479 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
8481 * A pointer to the contents in the success state.
8482 * Reading from this pointer when `result_ok` is not set is undefined.
8484 struct LDKCVec_u8Z *result;
8486 * A pointer to the contents in the error state.
8487 * Reading from this pointer when `result_ok` is set is undefined.
8489 struct LDKPeerHandleError *err;
8490 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
8493 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
8494 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
8495 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8497 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
8499 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
8500 * `err` or `result` depending on the state of `result_ok`.
8502 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
8504 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
8507 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
8510 * The contents of CResult_NonePeerHandleErrorZ
8512 typedef union LDKCResult_NonePeerHandleErrorZPtr {
8514 * Note that this value is always NULL, as there are no contents in the OK variant
8518 * A pointer to the contents in the error state.
8519 * Reading from this pointer when `result_ok` is set is undefined.
8521 struct LDKPeerHandleError *err;
8522 } LDKCResult_NonePeerHandleErrorZPtr;
8525 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
8526 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
8527 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8529 typedef struct LDKCResult_NonePeerHandleErrorZ {
8531 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
8532 * `err` or `result` depending on the state of `result_ok`.
8534 union LDKCResult_NonePeerHandleErrorZPtr contents;
8536 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
8539 } LDKCResult_NonePeerHandleErrorZ;
8542 * The contents of CResult_boolPeerHandleErrorZ
8544 typedef union LDKCResult_boolPeerHandleErrorZPtr {
8546 * A pointer to the contents in the success state.
8547 * Reading from this pointer when `result_ok` is not set is undefined.
8551 * A pointer to the contents in the error state.
8552 * Reading from this pointer when `result_ok` is set is undefined.
8554 struct LDKPeerHandleError *err;
8555 } LDKCResult_boolPeerHandleErrorZPtr;
8558 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
8559 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
8560 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8562 typedef struct LDKCResult_boolPeerHandleErrorZ {
8564 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
8565 * `err` or `result` depending on the state of `result_ok`.
8567 union LDKCResult_boolPeerHandleErrorZPtr contents;
8569 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
8572 } LDKCResult_boolPeerHandleErrorZ;
8577 * Represents the compressed public key of a node
8579 typedef struct MUST_USE_STRUCT LDKNodeId {
8581 * A pointer to the opaque Rust object.
8582 * Nearly everywhere, inner must be non-null, however in places where
8583 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8585 LDKnativeNodeId *inner;
8587 * Indicates that this is the only struct which contains the same pointer.
8588 * Rust functions which take ownership of an object provided via an argument require
8589 * this to be true and invalidate the object pointed to by inner.
8595 * The contents of CResult_NodeIdDecodeErrorZ
8597 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
8599 * A pointer to the contents in the success state.
8600 * Reading from this pointer when `result_ok` is not set is undefined.
8602 struct LDKNodeId *result;
8604 * A pointer to the contents in the error state.
8605 * Reading from this pointer when `result_ok` is set is undefined.
8607 struct LDKDecodeError *err;
8608 } LDKCResult_NodeIdDecodeErrorZPtr;
8611 * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
8612 * containing a crate::lightning::routing::network_graph::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
8613 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8615 typedef struct LDKCResult_NodeIdDecodeErrorZ {
8617 * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
8618 * `err` or `result` depending on the state of `result_ok`.
8620 union LDKCResult_NodeIdDecodeErrorZPtr contents;
8622 * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
8625 } LDKCResult_NodeIdDecodeErrorZ;
8628 * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
8630 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
8632 * A pointer to the contents in the success state.
8633 * Reading from this pointer when `result_ok` is not set is undefined.
8635 struct LDKCOption_NetworkUpdateZ *result;
8637 * A pointer to the contents in the error state.
8638 * Reading from this pointer when `result_ok` is set is undefined.
8640 struct LDKDecodeError *err;
8641 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
8644 * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
8645 * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
8646 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8648 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
8650 * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
8651 * `err` or `result` depending on the state of `result_ok`.
8653 union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
8655 * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
8658 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
8661 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
8664 typedef struct LDKAccess {
8666 * An opaque pointer which is passed to your function implementations as an argument.
8667 * This has no meaning in the LDK, and can be NULL or any other value.
8671 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
8672 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
8675 * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
8677 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
8679 * Frees any resources associated with this object given its this_arg pointer.
8680 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8682 void (*free)(void *this_arg);
8686 * An enum which can either contain a crate::lightning::chain::Access or not
8688 typedef enum LDKCOption_AccessZ_Tag {
8690 * When we're in this state, this COption_AccessZ contains a crate::lightning::chain::Access
8692 LDKCOption_AccessZ_Some,
8694 * When we're in this state, this COption_AccessZ contains nothing
8696 LDKCOption_AccessZ_None,
8698 * Must be last for serialization purposes
8700 LDKCOption_AccessZ_Sentinel,
8701 } LDKCOption_AccessZ_Tag;
8703 typedef struct LDKCOption_AccessZ {
8704 LDKCOption_AccessZ_Tag tag;
8707 struct LDKAccess some;
8710 } LDKCOption_AccessZ;
8715 * Details about one direction of a channel as received within a [`ChannelUpdate`].
8717 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
8719 * A pointer to the opaque Rust object.
8720 * Nearly everywhere, inner must be non-null, however in places where
8721 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8723 LDKnativeChannelUpdateInfo *inner;
8725 * Indicates that this is the only struct which contains the same pointer.
8726 * Rust functions which take ownership of an object provided via an argument require
8727 * this to be true and invalidate the object pointed to by inner.
8730 } LDKChannelUpdateInfo;
8733 * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
8735 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
8737 * A pointer to the contents in the success state.
8738 * Reading from this pointer when `result_ok` is not set is undefined.
8740 struct LDKChannelUpdateInfo *result;
8742 * A pointer to the contents in the error state.
8743 * Reading from this pointer when `result_ok` is set is undefined.
8745 struct LDKDecodeError *err;
8746 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
8749 * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
8750 * containing a crate::lightning::routing::network_graph::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8751 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8753 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
8755 * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
8756 * `err` or `result` depending on the state of `result_ok`.
8758 union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
8760 * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
8763 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
8768 * Details about a channel (both directions).
8769 * Received within a channel announcement.
8771 typedef struct MUST_USE_STRUCT LDKChannelInfo {
8773 * A pointer to the opaque Rust object.
8774 * Nearly everywhere, inner must be non-null, however in places where
8775 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8777 LDKnativeChannelInfo *inner;
8779 * Indicates that this is the only struct which contains the same pointer.
8780 * Rust functions which take ownership of an object provided via an argument require
8781 * this to be true and invalidate the object pointed to by inner.
8787 * The contents of CResult_ChannelInfoDecodeErrorZ
8789 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
8791 * A pointer to the contents in the success state.
8792 * Reading from this pointer when `result_ok` is not set is undefined.
8794 struct LDKChannelInfo *result;
8796 * A pointer to the contents in the error state.
8797 * Reading from this pointer when `result_ok` is set is undefined.
8799 struct LDKDecodeError *err;
8800 } LDKCResult_ChannelInfoDecodeErrorZPtr;
8803 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
8804 * containing a crate::lightning::routing::network_graph::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8805 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8807 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
8809 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
8810 * `err` or `result` depending on the state of `result_ok`.
8812 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
8814 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
8817 } LDKCResult_ChannelInfoDecodeErrorZ;
8822 * Fees for routing via a given channel or a node
8824 typedef struct MUST_USE_STRUCT LDKRoutingFees {
8826 * A pointer to the opaque Rust object.
8827 * Nearly everywhere, inner must be non-null, however in places where
8828 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8830 LDKnativeRoutingFees *inner;
8832 * Indicates that this is the only struct which contains the same pointer.
8833 * Rust functions which take ownership of an object provided via an argument require
8834 * this to be true and invalidate the object pointed to by inner.
8840 * The contents of CResult_RoutingFeesDecodeErrorZ
8842 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
8844 * A pointer to the contents in the success state.
8845 * Reading from this pointer when `result_ok` is not set is undefined.
8847 struct LDKRoutingFees *result;
8849 * A pointer to the contents in the error state.
8850 * Reading from this pointer when `result_ok` is set is undefined.
8852 struct LDKDecodeError *err;
8853 } LDKCResult_RoutingFeesDecodeErrorZPtr;
8856 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
8857 * containing a crate::lightning::routing::network_graph::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
8858 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8860 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
8862 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
8863 * `err` or `result` depending on the state of `result_ok`.
8865 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
8867 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
8870 } LDKCResult_RoutingFeesDecodeErrorZ;
8875 * Information received in the latest node_announcement from this node.
8877 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
8879 * A pointer to the opaque Rust object.
8880 * Nearly everywhere, inner must be non-null, however in places where
8881 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8883 LDKnativeNodeAnnouncementInfo *inner;
8885 * Indicates that this is the only struct which contains the same pointer.
8886 * Rust functions which take ownership of an object provided via an argument require
8887 * this to be true and invalidate the object pointed to by inner.
8890 } LDKNodeAnnouncementInfo;
8893 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
8895 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
8897 * A pointer to the contents in the success state.
8898 * Reading from this pointer when `result_ok` is not set is undefined.
8900 struct LDKNodeAnnouncementInfo *result;
8902 * A pointer to the contents in the error state.
8903 * Reading from this pointer when `result_ok` is set is undefined.
8905 struct LDKDecodeError *err;
8906 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
8909 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
8910 * containing a crate::lightning::routing::network_graph::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8911 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8913 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
8915 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
8916 * `err` or `result` depending on the state of `result_ok`.
8918 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
8920 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
8923 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
8926 * A dynamically-allocated array of u64s of arbitrary size.
8927 * This corresponds to std::vector in C++
8929 typedef struct LDKCVec_u64Z {
8931 * The elements in the array.
8932 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8936 * The number of elements pointed to by `data`.
8944 * Details about a node in the network, known from the network announcement.
8946 typedef struct MUST_USE_STRUCT LDKNodeInfo {
8948 * A pointer to the opaque Rust object.
8949 * Nearly everywhere, inner must be non-null, however in places where
8950 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8952 LDKnativeNodeInfo *inner;
8954 * Indicates that this is the only struct which contains the same pointer.
8955 * Rust functions which take ownership of an object provided via an argument require
8956 * this to be true and invalidate the object pointed to by inner.
8962 * The contents of CResult_NodeInfoDecodeErrorZ
8964 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
8966 * A pointer to the contents in the success state.
8967 * Reading from this pointer when `result_ok` is not set is undefined.
8969 struct LDKNodeInfo *result;
8971 * A pointer to the contents in the error state.
8972 * Reading from this pointer when `result_ok` is set is undefined.
8974 struct LDKDecodeError *err;
8975 } LDKCResult_NodeInfoDecodeErrorZPtr;
8978 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
8979 * containing a crate::lightning::routing::network_graph::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8980 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8982 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
8984 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
8985 * `err` or `result` depending on the state of `result_ok`.
8987 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
8989 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
8992 } LDKCResult_NodeInfoDecodeErrorZ;
8995 * The contents of CResult_NetworkGraphDecodeErrorZ
8997 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
8999 * A pointer to the contents in the success state.
9000 * Reading from this pointer when `result_ok` is not set is undefined.
9002 struct LDKNetworkGraph *result;
9004 * A pointer to the contents in the error state.
9005 * Reading from this pointer when `result_ok` is set is undefined.
9007 struct LDKDecodeError *err;
9008 } LDKCResult_NetworkGraphDecodeErrorZPtr;
9011 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
9012 * containing a crate::lightning::routing::network_graph::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
9013 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9015 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
9017 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
9018 * `err` or `result` depending on the state of `result_ok`.
9020 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
9022 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
9025 } LDKCResult_NetworkGraphDecodeErrorZ;
9028 * An enum which can either contain a crate::c_types::derived::CVec_NetAddressZ or not
9030 typedef enum LDKCOption_CVec_NetAddressZZ_Tag {
9032 * When we're in this state, this COption_CVec_NetAddressZZ contains a crate::c_types::derived::CVec_NetAddressZ
9034 LDKCOption_CVec_NetAddressZZ_Some,
9036 * When we're in this state, this COption_CVec_NetAddressZZ contains nothing
9038 LDKCOption_CVec_NetAddressZZ_None,
9040 * Must be last for serialization purposes
9042 LDKCOption_CVec_NetAddressZZ_Sentinel,
9043 } LDKCOption_CVec_NetAddressZZ_Tag;
9045 typedef struct LDKCOption_CVec_NetAddressZZ {
9046 LDKCOption_CVec_NetAddressZZ_Tag tag;
9049 struct LDKCVec_NetAddressZ some;
9052 } LDKCOption_CVec_NetAddressZZ;
9055 * The contents of CResult_NetAddressDecodeErrorZ
9057 typedef union LDKCResult_NetAddressDecodeErrorZPtr {
9059 * A pointer to the contents in the success state.
9060 * Reading from this pointer when `result_ok` is not set is undefined.
9062 struct LDKNetAddress *result;
9064 * A pointer to the contents in the error state.
9065 * Reading from this pointer when `result_ok` is set is undefined.
9067 struct LDKDecodeError *err;
9068 } LDKCResult_NetAddressDecodeErrorZPtr;
9071 * A CResult_NetAddressDecodeErrorZ represents the result of a fallible operation,
9072 * containing a crate::lightning::ln::msgs::NetAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
9073 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9075 typedef struct LDKCResult_NetAddressDecodeErrorZ {
9077 * The contents of this CResult_NetAddressDecodeErrorZ, accessible via either
9078 * `err` or `result` depending on the state of `result_ok`.
9080 union LDKCResult_NetAddressDecodeErrorZPtr contents;
9082 * Whether this CResult_NetAddressDecodeErrorZ represents a success state.
9085 } LDKCResult_NetAddressDecodeErrorZ;
9090 * An update_add_htlc message to be sent or received from a peer
9092 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
9094 * A pointer to the opaque Rust object.
9095 * Nearly everywhere, inner must be non-null, however in places where
9096 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9098 LDKnativeUpdateAddHTLC *inner;
9100 * Indicates that this is the only struct which contains the same pointer.
9101 * Rust functions which take ownership of an object provided via an argument require
9102 * this to be true and invalidate the object pointed to by inner.
9108 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
9109 * This corresponds to std::vector in C++
9111 typedef struct LDKCVec_UpdateAddHTLCZ {
9113 * The elements in the array.
9114 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9116 struct LDKUpdateAddHTLC *data;
9118 * The number of elements pointed to by `data`.
9121 } LDKCVec_UpdateAddHTLCZ;
9126 * An update_fulfill_htlc message to be sent or received from a peer
9128 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
9130 * A pointer to the opaque Rust object.
9131 * Nearly everywhere, inner must be non-null, however in places where
9132 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9134 LDKnativeUpdateFulfillHTLC *inner;
9136 * Indicates that this is the only struct which contains the same pointer.
9137 * Rust functions which take ownership of an object provided via an argument require
9138 * this to be true and invalidate the object pointed to by inner.
9141 } LDKUpdateFulfillHTLC;
9144 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
9145 * This corresponds to std::vector in C++
9147 typedef struct LDKCVec_UpdateFulfillHTLCZ {
9149 * The elements in the array.
9150 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9152 struct LDKUpdateFulfillHTLC *data;
9154 * The number of elements pointed to by `data`.
9157 } LDKCVec_UpdateFulfillHTLCZ;
9162 * An update_fail_htlc message to be sent or received from a peer
9164 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
9166 * A pointer to the opaque Rust object.
9167 * Nearly everywhere, inner must be non-null, however in places where
9168 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9170 LDKnativeUpdateFailHTLC *inner;
9172 * Indicates that this is the only struct which contains the same pointer.
9173 * Rust functions which take ownership of an object provided via an argument require
9174 * this to be true and invalidate the object pointed to by inner.
9177 } LDKUpdateFailHTLC;
9180 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
9181 * This corresponds to std::vector in C++
9183 typedef struct LDKCVec_UpdateFailHTLCZ {
9185 * The elements in the array.
9186 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9188 struct LDKUpdateFailHTLC *data;
9190 * The number of elements pointed to by `data`.
9193 } LDKCVec_UpdateFailHTLCZ;
9198 * An update_fail_malformed_htlc message to be sent or received from a peer
9200 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
9202 * A pointer to the opaque Rust object.
9203 * Nearly everywhere, inner must be non-null, however in places where
9204 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9206 LDKnativeUpdateFailMalformedHTLC *inner;
9208 * Indicates that this is the only struct which contains the same pointer.
9209 * Rust functions which take ownership of an object provided via an argument require
9210 * this to be true and invalidate the object pointed to by inner.
9213 } LDKUpdateFailMalformedHTLC;
9216 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
9217 * This corresponds to std::vector in C++
9219 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
9221 * The elements in the array.
9222 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9224 struct LDKUpdateFailMalformedHTLC *data;
9226 * The number of elements pointed to by `data`.
9229 } LDKCVec_UpdateFailMalformedHTLCZ;
9232 * The contents of CResult_AcceptChannelDecodeErrorZ
9234 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
9236 * A pointer to the contents in the success state.
9237 * Reading from this pointer when `result_ok` is not set is undefined.
9239 struct LDKAcceptChannel *result;
9241 * A pointer to the contents in the error state.
9242 * Reading from this pointer when `result_ok` is set is undefined.
9244 struct LDKDecodeError *err;
9245 } LDKCResult_AcceptChannelDecodeErrorZPtr;
9248 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
9249 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
9250 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9252 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
9254 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
9255 * `err` or `result` depending on the state of `result_ok`.
9257 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
9259 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
9262 } LDKCResult_AcceptChannelDecodeErrorZ;
9265 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
9267 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
9269 * A pointer to the contents in the success state.
9270 * Reading from this pointer when `result_ok` is not set is undefined.
9272 struct LDKAnnouncementSignatures *result;
9274 * A pointer to the contents in the error state.
9275 * Reading from this pointer when `result_ok` is set is undefined.
9277 struct LDKDecodeError *err;
9278 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
9281 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
9282 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
9283 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9285 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
9287 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
9288 * `err` or `result` depending on the state of `result_ok`.
9290 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
9292 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
9295 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
9298 * The contents of CResult_ChannelReestablishDecodeErrorZ
9300 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
9302 * A pointer to the contents in the success state.
9303 * Reading from this pointer when `result_ok` is not set is undefined.
9305 struct LDKChannelReestablish *result;
9307 * A pointer to the contents in the error state.
9308 * Reading from this pointer when `result_ok` is set is undefined.
9310 struct LDKDecodeError *err;
9311 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
9314 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
9315 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
9316 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9318 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
9320 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
9321 * `err` or `result` depending on the state of `result_ok`.
9323 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
9325 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
9328 } LDKCResult_ChannelReestablishDecodeErrorZ;
9331 * The contents of CResult_ClosingSignedDecodeErrorZ
9333 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
9335 * A pointer to the contents in the success state.
9336 * Reading from this pointer when `result_ok` is not set is undefined.
9338 struct LDKClosingSigned *result;
9340 * A pointer to the contents in the error state.
9341 * Reading from this pointer when `result_ok` is set is undefined.
9343 struct LDKDecodeError *err;
9344 } LDKCResult_ClosingSignedDecodeErrorZPtr;
9347 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
9348 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
9349 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9351 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
9353 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
9354 * `err` or `result` depending on the state of `result_ok`.
9356 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
9358 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
9361 } LDKCResult_ClosingSignedDecodeErrorZ;
9366 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
9367 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
9370 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
9372 * A pointer to the opaque Rust object.
9373 * Nearly everywhere, inner must be non-null, however in places where
9374 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9376 LDKnativeClosingSignedFeeRange *inner;
9378 * Indicates that this is the only struct which contains the same pointer.
9379 * Rust functions which take ownership of an object provided via an argument require
9380 * this to be true and invalidate the object pointed to by inner.
9383 } LDKClosingSignedFeeRange;
9386 * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
9388 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
9390 * A pointer to the contents in the success state.
9391 * Reading from this pointer when `result_ok` is not set is undefined.
9393 struct LDKClosingSignedFeeRange *result;
9395 * A pointer to the contents in the error state.
9396 * Reading from this pointer when `result_ok` is set is undefined.
9398 struct LDKDecodeError *err;
9399 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
9402 * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
9403 * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
9404 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9406 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
9408 * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
9409 * `err` or `result` depending on the state of `result_ok`.
9411 union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
9413 * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
9416 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
9421 * A commitment_signed message to be sent or received from a peer
9423 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
9425 * A pointer to the opaque Rust object.
9426 * Nearly everywhere, inner must be non-null, however in places where
9427 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9429 LDKnativeCommitmentSigned *inner;
9431 * Indicates that this is the only struct which contains the same pointer.
9432 * Rust functions which take ownership of an object provided via an argument require
9433 * this to be true and invalidate the object pointed to by inner.
9436 } LDKCommitmentSigned;
9439 * The contents of CResult_CommitmentSignedDecodeErrorZ
9441 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
9443 * A pointer to the contents in the success state.
9444 * Reading from this pointer when `result_ok` is not set is undefined.
9446 struct LDKCommitmentSigned *result;
9448 * A pointer to the contents in the error state.
9449 * Reading from this pointer when `result_ok` is set is undefined.
9451 struct LDKDecodeError *err;
9452 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
9455 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
9456 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
9457 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9459 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
9461 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
9462 * `err` or `result` depending on the state of `result_ok`.
9464 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
9466 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
9469 } LDKCResult_CommitmentSignedDecodeErrorZ;
9472 * The contents of CResult_FundingCreatedDecodeErrorZ
9474 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
9476 * A pointer to the contents in the success state.
9477 * Reading from this pointer when `result_ok` is not set is undefined.
9479 struct LDKFundingCreated *result;
9481 * A pointer to the contents in the error state.
9482 * Reading from this pointer when `result_ok` is set is undefined.
9484 struct LDKDecodeError *err;
9485 } LDKCResult_FundingCreatedDecodeErrorZPtr;
9488 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
9489 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
9490 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9492 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
9494 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
9495 * `err` or `result` depending on the state of `result_ok`.
9497 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
9499 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
9502 } LDKCResult_FundingCreatedDecodeErrorZ;
9505 * The contents of CResult_FundingSignedDecodeErrorZ
9507 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
9509 * A pointer to the contents in the success state.
9510 * Reading from this pointer when `result_ok` is not set is undefined.
9512 struct LDKFundingSigned *result;
9514 * A pointer to the contents in the error state.
9515 * Reading from this pointer when `result_ok` is set is undefined.
9517 struct LDKDecodeError *err;
9518 } LDKCResult_FundingSignedDecodeErrorZPtr;
9521 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
9522 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
9523 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9525 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
9527 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
9528 * `err` or `result` depending on the state of `result_ok`.
9530 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
9532 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
9535 } LDKCResult_FundingSignedDecodeErrorZ;
9538 * The contents of CResult_FundingLockedDecodeErrorZ
9540 typedef union LDKCResult_FundingLockedDecodeErrorZPtr {
9542 * A pointer to the contents in the success state.
9543 * Reading from this pointer when `result_ok` is not set is undefined.
9545 struct LDKFundingLocked *result;
9547 * A pointer to the contents in the error state.
9548 * Reading from this pointer when `result_ok` is set is undefined.
9550 struct LDKDecodeError *err;
9551 } LDKCResult_FundingLockedDecodeErrorZPtr;
9554 * A CResult_FundingLockedDecodeErrorZ represents the result of a fallible operation,
9555 * containing a crate::lightning::ln::msgs::FundingLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
9556 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9558 typedef struct LDKCResult_FundingLockedDecodeErrorZ {
9560 * The contents of this CResult_FundingLockedDecodeErrorZ, accessible via either
9561 * `err` or `result` depending on the state of `result_ok`.
9563 union LDKCResult_FundingLockedDecodeErrorZPtr contents;
9565 * Whether this CResult_FundingLockedDecodeErrorZ represents a success state.
9568 } LDKCResult_FundingLockedDecodeErrorZ;
9573 * An init message to be sent or received from a peer
9575 typedef struct MUST_USE_STRUCT LDKInit {
9577 * A pointer to the opaque Rust object.
9578 * Nearly everywhere, inner must be non-null, however in places where
9579 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9581 LDKnativeInit *inner;
9583 * Indicates that this is the only struct which contains the same pointer.
9584 * Rust functions which take ownership of an object provided via an argument require
9585 * this to be true and invalidate the object pointed to by inner.
9591 * The contents of CResult_InitDecodeErrorZ
9593 typedef union LDKCResult_InitDecodeErrorZPtr {
9595 * A pointer to the contents in the success state.
9596 * Reading from this pointer when `result_ok` is not set is undefined.
9598 struct LDKInit *result;
9600 * A pointer to the contents in the error state.
9601 * Reading from this pointer when `result_ok` is set is undefined.
9603 struct LDKDecodeError *err;
9604 } LDKCResult_InitDecodeErrorZPtr;
9607 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
9608 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
9609 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9611 typedef struct LDKCResult_InitDecodeErrorZ {
9613 * The contents of this CResult_InitDecodeErrorZ, accessible via either
9614 * `err` or `result` depending on the state of `result_ok`.
9616 union LDKCResult_InitDecodeErrorZPtr contents;
9618 * Whether this CResult_InitDecodeErrorZ represents a success state.
9621 } LDKCResult_InitDecodeErrorZ;
9624 * The contents of CResult_OpenChannelDecodeErrorZ
9626 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
9628 * A pointer to the contents in the success state.
9629 * Reading from this pointer when `result_ok` is not set is undefined.
9631 struct LDKOpenChannel *result;
9633 * A pointer to the contents in the error state.
9634 * Reading from this pointer when `result_ok` is set is undefined.
9636 struct LDKDecodeError *err;
9637 } LDKCResult_OpenChannelDecodeErrorZPtr;
9640 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
9641 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
9642 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9644 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
9646 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
9647 * `err` or `result` depending on the state of `result_ok`.
9649 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
9651 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
9654 } LDKCResult_OpenChannelDecodeErrorZ;
9657 * The contents of CResult_RevokeAndACKDecodeErrorZ
9659 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
9661 * A pointer to the contents in the success state.
9662 * Reading from this pointer when `result_ok` is not set is undefined.
9664 struct LDKRevokeAndACK *result;
9666 * A pointer to the contents in the error state.
9667 * Reading from this pointer when `result_ok` is set is undefined.
9669 struct LDKDecodeError *err;
9670 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
9673 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
9674 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
9675 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9677 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
9679 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
9680 * `err` or `result` depending on the state of `result_ok`.
9682 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
9684 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
9687 } LDKCResult_RevokeAndACKDecodeErrorZ;
9690 * The contents of CResult_ShutdownDecodeErrorZ
9692 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
9694 * A pointer to the contents in the success state.
9695 * Reading from this pointer when `result_ok` is not set is undefined.
9697 struct LDKShutdown *result;
9699 * A pointer to the contents in the error state.
9700 * Reading from this pointer when `result_ok` is set is undefined.
9702 struct LDKDecodeError *err;
9703 } LDKCResult_ShutdownDecodeErrorZPtr;
9706 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
9707 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
9708 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9710 typedef struct LDKCResult_ShutdownDecodeErrorZ {
9712 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
9713 * `err` or `result` depending on the state of `result_ok`.
9715 union LDKCResult_ShutdownDecodeErrorZPtr contents;
9717 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
9720 } LDKCResult_ShutdownDecodeErrorZ;
9723 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
9725 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
9727 * A pointer to the contents in the success state.
9728 * Reading from this pointer when `result_ok` is not set is undefined.
9730 struct LDKUpdateFailHTLC *result;
9732 * A pointer to the contents in the error state.
9733 * Reading from this pointer when `result_ok` is set is undefined.
9735 struct LDKDecodeError *err;
9736 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
9739 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
9740 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
9741 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9743 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
9745 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
9746 * `err` or `result` depending on the state of `result_ok`.
9748 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
9750 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
9753 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
9756 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
9758 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
9760 * A pointer to the contents in the success state.
9761 * Reading from this pointer when `result_ok` is not set is undefined.
9763 struct LDKUpdateFailMalformedHTLC *result;
9765 * A pointer to the contents in the error state.
9766 * Reading from this pointer when `result_ok` is set is undefined.
9768 struct LDKDecodeError *err;
9769 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
9772 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
9773 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
9774 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9776 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
9778 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
9779 * `err` or `result` depending on the state of `result_ok`.
9781 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
9783 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
9786 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
9791 * An update_fee message to be sent or received from a peer
9793 typedef struct MUST_USE_STRUCT LDKUpdateFee {
9795 * A pointer to the opaque Rust object.
9796 * Nearly everywhere, inner must be non-null, however in places where
9797 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9799 LDKnativeUpdateFee *inner;
9801 * Indicates that this is the only struct which contains the same pointer.
9802 * Rust functions which take ownership of an object provided via an argument require
9803 * this to be true and invalidate the object pointed to by inner.
9809 * The contents of CResult_UpdateFeeDecodeErrorZ
9811 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
9813 * A pointer to the contents in the success state.
9814 * Reading from this pointer when `result_ok` is not set is undefined.
9816 struct LDKUpdateFee *result;
9818 * A pointer to the contents in the error state.
9819 * Reading from this pointer when `result_ok` is set is undefined.
9821 struct LDKDecodeError *err;
9822 } LDKCResult_UpdateFeeDecodeErrorZPtr;
9825 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
9826 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
9827 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9829 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
9831 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
9832 * `err` or `result` depending on the state of `result_ok`.
9834 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
9836 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
9839 } LDKCResult_UpdateFeeDecodeErrorZ;
9842 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
9844 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
9846 * A pointer to the contents in the success state.
9847 * Reading from this pointer when `result_ok` is not set is undefined.
9849 struct LDKUpdateFulfillHTLC *result;
9851 * A pointer to the contents in the error state.
9852 * Reading from this pointer when `result_ok` is set is undefined.
9854 struct LDKDecodeError *err;
9855 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
9858 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
9859 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
9860 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9862 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
9864 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
9865 * `err` or `result` depending on the state of `result_ok`.
9867 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
9869 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
9872 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
9875 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
9877 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
9879 * A pointer to the contents in the success state.
9880 * Reading from this pointer when `result_ok` is not set is undefined.
9882 struct LDKUpdateAddHTLC *result;
9884 * A pointer to the contents in the error state.
9885 * Reading from this pointer when `result_ok` is set is undefined.
9887 struct LDKDecodeError *err;
9888 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
9891 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
9892 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
9893 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9895 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
9897 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
9898 * `err` or `result` depending on the state of `result_ok`.
9900 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
9902 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
9905 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
9910 * A ping message to be sent or received from a peer
9912 typedef struct MUST_USE_STRUCT LDKPing {
9914 * A pointer to the opaque Rust object.
9915 * Nearly everywhere, inner must be non-null, however in places where
9916 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9918 LDKnativePing *inner;
9920 * Indicates that this is the only struct which contains the same pointer.
9921 * Rust functions which take ownership of an object provided via an argument require
9922 * this to be true and invalidate the object pointed to by inner.
9928 * The contents of CResult_PingDecodeErrorZ
9930 typedef union LDKCResult_PingDecodeErrorZPtr {
9932 * A pointer to the contents in the success state.
9933 * Reading from this pointer when `result_ok` is not set is undefined.
9935 struct LDKPing *result;
9937 * A pointer to the contents in the error state.
9938 * Reading from this pointer when `result_ok` is set is undefined.
9940 struct LDKDecodeError *err;
9941 } LDKCResult_PingDecodeErrorZPtr;
9944 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
9945 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
9946 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9948 typedef struct LDKCResult_PingDecodeErrorZ {
9950 * The contents of this CResult_PingDecodeErrorZ, accessible via either
9951 * `err` or `result` depending on the state of `result_ok`.
9953 union LDKCResult_PingDecodeErrorZPtr contents;
9955 * Whether this CResult_PingDecodeErrorZ represents a success state.
9958 } LDKCResult_PingDecodeErrorZ;
9963 * A pong message to be sent or received from a peer
9965 typedef struct MUST_USE_STRUCT LDKPong {
9967 * A pointer to the opaque Rust object.
9968 * Nearly everywhere, inner must be non-null, however in places where
9969 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9971 LDKnativePong *inner;
9973 * Indicates that this is the only struct which contains the same pointer.
9974 * Rust functions which take ownership of an object provided via an argument require
9975 * this to be true and invalidate the object pointed to by inner.
9981 * The contents of CResult_PongDecodeErrorZ
9983 typedef union LDKCResult_PongDecodeErrorZPtr {
9985 * A pointer to the contents in the success state.
9986 * Reading from this pointer when `result_ok` is not set is undefined.
9988 struct LDKPong *result;
9990 * A pointer to the contents in the error state.
9991 * Reading from this pointer when `result_ok` is set is undefined.
9993 struct LDKDecodeError *err;
9994 } LDKCResult_PongDecodeErrorZPtr;
9997 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
9998 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
9999 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10001 typedef struct LDKCResult_PongDecodeErrorZ {
10003 * The contents of this CResult_PongDecodeErrorZ, accessible via either
10004 * `err` or `result` depending on the state of `result_ok`.
10006 union LDKCResult_PongDecodeErrorZPtr contents;
10008 * Whether this CResult_PongDecodeErrorZ represents a success state.
10011 } LDKCResult_PongDecodeErrorZ;
10014 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
10016 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
10018 * A pointer to the contents in the success state.
10019 * Reading from this pointer when `result_ok` is not set is undefined.
10021 struct LDKUnsignedChannelAnnouncement *result;
10023 * A pointer to the contents in the error state.
10024 * Reading from this pointer when `result_ok` is set is undefined.
10026 struct LDKDecodeError *err;
10027 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
10030 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
10031 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10032 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10034 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
10036 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
10037 * `err` or `result` depending on the state of `result_ok`.
10039 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
10041 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
10044 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
10047 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
10049 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
10051 * A pointer to the contents in the success state.
10052 * Reading from this pointer when `result_ok` is not set is undefined.
10054 struct LDKChannelAnnouncement *result;
10056 * A pointer to the contents in the error state.
10057 * Reading from this pointer when `result_ok` is set is undefined.
10059 struct LDKDecodeError *err;
10060 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
10063 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
10064 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10065 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10067 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
10069 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
10070 * `err` or `result` depending on the state of `result_ok`.
10072 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
10074 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
10077 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
10082 * The unsigned part of a channel_update
10084 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
10086 * A pointer to the opaque Rust object.
10087 * Nearly everywhere, inner must be non-null, however in places where
10088 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10090 LDKnativeUnsignedChannelUpdate *inner;
10092 * Indicates that this is the only struct which contains the same pointer.
10093 * Rust functions which take ownership of an object provided via an argument require
10094 * this to be true and invalidate the object pointed to by inner.
10097 } LDKUnsignedChannelUpdate;
10100 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
10102 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
10104 * A pointer to the contents in the success state.
10105 * Reading from this pointer when `result_ok` is not set is undefined.
10107 struct LDKUnsignedChannelUpdate *result;
10109 * A pointer to the contents in the error state.
10110 * Reading from this pointer when `result_ok` is set is undefined.
10112 struct LDKDecodeError *err;
10113 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
10116 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
10117 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
10118 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10120 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
10122 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
10123 * `err` or `result` depending on the state of `result_ok`.
10125 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
10127 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
10130 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
10133 * The contents of CResult_ChannelUpdateDecodeErrorZ
10135 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
10137 * A pointer to the contents in the success state.
10138 * Reading from this pointer when `result_ok` is not set is undefined.
10140 struct LDKChannelUpdate *result;
10142 * A pointer to the contents in the error state.
10143 * Reading from this pointer when `result_ok` is set is undefined.
10145 struct LDKDecodeError *err;
10146 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
10149 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
10150 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
10151 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10153 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
10155 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
10156 * `err` or `result` depending on the state of `result_ok`.
10158 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
10160 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
10163 } LDKCResult_ChannelUpdateDecodeErrorZ;
10166 * The contents of CResult_ErrorMessageDecodeErrorZ
10168 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
10170 * A pointer to the contents in the success state.
10171 * Reading from this pointer when `result_ok` is not set is undefined.
10173 struct LDKErrorMessage *result;
10175 * A pointer to the contents in the error state.
10176 * Reading from this pointer when `result_ok` is set is undefined.
10178 struct LDKDecodeError *err;
10179 } LDKCResult_ErrorMessageDecodeErrorZPtr;
10182 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
10183 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
10184 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10186 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
10188 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
10189 * `err` or `result` depending on the state of `result_ok`.
10191 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
10193 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
10196 } LDKCResult_ErrorMessageDecodeErrorZ;
10199 * The contents of CResult_WarningMessageDecodeErrorZ
10201 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
10203 * A pointer to the contents in the success state.
10204 * Reading from this pointer when `result_ok` is not set is undefined.
10206 struct LDKWarningMessage *result;
10208 * A pointer to the contents in the error state.
10209 * Reading from this pointer when `result_ok` is set is undefined.
10211 struct LDKDecodeError *err;
10212 } LDKCResult_WarningMessageDecodeErrorZPtr;
10215 * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
10216 * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
10217 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10219 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
10221 * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
10222 * `err` or `result` depending on the state of `result_ok`.
10224 union LDKCResult_WarningMessageDecodeErrorZPtr contents;
10226 * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
10229 } LDKCResult_WarningMessageDecodeErrorZ;
10234 * The unsigned part of a node_announcement
10236 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
10238 * A pointer to the opaque Rust object.
10239 * Nearly everywhere, inner must be non-null, however in places where
10240 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10242 LDKnativeUnsignedNodeAnnouncement *inner;
10244 * Indicates that this is the only struct which contains the same pointer.
10245 * Rust functions which take ownership of an object provided via an argument require
10246 * this to be true and invalidate the object pointed to by inner.
10249 } LDKUnsignedNodeAnnouncement;
10252 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
10254 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
10256 * A pointer to the contents in the success state.
10257 * Reading from this pointer when `result_ok` is not set is undefined.
10259 struct LDKUnsignedNodeAnnouncement *result;
10261 * A pointer to the contents in the error state.
10262 * Reading from this pointer when `result_ok` is set is undefined.
10264 struct LDKDecodeError *err;
10265 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
10268 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
10269 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10270 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10272 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
10274 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
10275 * `err` or `result` depending on the state of `result_ok`.
10277 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
10279 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
10282 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
10285 * The contents of CResult_NodeAnnouncementDecodeErrorZ
10287 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
10289 * A pointer to the contents in the success state.
10290 * Reading from this pointer when `result_ok` is not set is undefined.
10292 struct LDKNodeAnnouncement *result;
10294 * A pointer to the contents in the error state.
10295 * Reading from this pointer when `result_ok` is set is undefined.
10297 struct LDKDecodeError *err;
10298 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
10301 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
10302 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10303 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10305 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
10307 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
10308 * `err` or `result` depending on the state of `result_ok`.
10310 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
10312 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
10315 } LDKCResult_NodeAnnouncementDecodeErrorZ;
10318 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
10320 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
10322 * A pointer to the contents in the success state.
10323 * Reading from this pointer when `result_ok` is not set is undefined.
10325 struct LDKQueryShortChannelIds *result;
10327 * A pointer to the contents in the error state.
10328 * Reading from this pointer when `result_ok` is set is undefined.
10330 struct LDKDecodeError *err;
10331 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
10334 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
10335 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
10336 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10338 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
10340 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
10341 * `err` or `result` depending on the state of `result_ok`.
10343 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
10345 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
10348 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
10353 * A reply_short_channel_ids_end message is sent as a reply to a
10354 * query_short_channel_ids message. The query recipient makes a best
10355 * effort to respond based on their local network view which may not be
10356 * a perfect view of the network.
10358 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
10360 * A pointer to the opaque Rust object.
10361 * Nearly everywhere, inner must be non-null, however in places where
10362 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10364 LDKnativeReplyShortChannelIdsEnd *inner;
10366 * Indicates that this is the only struct which contains the same pointer.
10367 * Rust functions which take ownership of an object provided via an argument require
10368 * this to be true and invalidate the object pointed to by inner.
10371 } LDKReplyShortChannelIdsEnd;
10374 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
10376 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
10378 * A pointer to the contents in the success state.
10379 * Reading from this pointer when `result_ok` is not set is undefined.
10381 struct LDKReplyShortChannelIdsEnd *result;
10383 * A pointer to the contents in the error state.
10384 * Reading from this pointer when `result_ok` is set is undefined.
10386 struct LDKDecodeError *err;
10387 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
10390 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
10391 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
10392 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10394 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
10396 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
10397 * `err` or `result` depending on the state of `result_ok`.
10399 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
10401 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
10404 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
10407 * The contents of CResult_QueryChannelRangeDecodeErrorZ
10409 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
10411 * A pointer to the contents in the success state.
10412 * Reading from this pointer when `result_ok` is not set is undefined.
10414 struct LDKQueryChannelRange *result;
10416 * A pointer to the contents in the error state.
10417 * Reading from this pointer when `result_ok` is set is undefined.
10419 struct LDKDecodeError *err;
10420 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
10423 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
10424 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
10425 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10427 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
10429 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
10430 * `err` or `result` depending on the state of `result_ok`.
10432 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
10434 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
10437 } LDKCResult_QueryChannelRangeDecodeErrorZ;
10440 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
10442 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
10444 * A pointer to the contents in the success state.
10445 * Reading from this pointer when `result_ok` is not set is undefined.
10447 struct LDKReplyChannelRange *result;
10449 * A pointer to the contents in the error state.
10450 * Reading from this pointer when `result_ok` is set is undefined.
10452 struct LDKDecodeError *err;
10453 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
10456 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
10457 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
10458 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10460 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
10462 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
10463 * `err` or `result` depending on the state of `result_ok`.
10465 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
10467 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
10470 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
10473 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
10475 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
10477 * A pointer to the contents in the success state.
10478 * Reading from this pointer when `result_ok` is not set is undefined.
10480 struct LDKGossipTimestampFilter *result;
10482 * A pointer to the contents in the error state.
10483 * Reading from this pointer when `result_ok` is set is undefined.
10485 struct LDKDecodeError *err;
10486 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
10489 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
10490 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
10491 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10493 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
10495 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
10496 * `err` or `result` depending on the state of `result_ok`.
10498 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
10500 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
10503 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
10506 * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
10507 * This corresponds to std::vector in C++
10509 typedef struct LDKCVec_PhantomRouteHintsZ {
10511 * The elements in the array.
10512 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10514 struct LDKPhantomRouteHints *data;
10516 * The number of elements pointed to by `data`.
10519 } LDKCVec_PhantomRouteHintsZ;
10522 * When signing using a fallible method either an user-supplied `SignError` or a `CreationError`
10525 typedef enum LDKSignOrCreationError_Tag {
10527 * An error occurred during signing
10529 LDKSignOrCreationError_SignError,
10531 * An error occurred while building the transaction
10533 LDKSignOrCreationError_CreationError,
10535 * Must be last for serialization purposes
10537 LDKSignOrCreationError_Sentinel,
10538 } LDKSignOrCreationError_Tag;
10540 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
10541 LDKSignOrCreationError_Tag tag;
10544 enum LDKCreationError creation_error;
10547 } LDKSignOrCreationError;
10550 * The contents of CResult_InvoiceSignOrCreationErrorZ
10552 typedef union LDKCResult_InvoiceSignOrCreationErrorZPtr {
10554 * A pointer to the contents in the success state.
10555 * Reading from this pointer when `result_ok` is not set is undefined.
10557 struct LDKInvoice *result;
10559 * A pointer to the contents in the error state.
10560 * Reading from this pointer when `result_ok` is set is undefined.
10562 struct LDKSignOrCreationError *err;
10563 } LDKCResult_InvoiceSignOrCreationErrorZPtr;
10566 * A CResult_InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
10567 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
10568 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10570 typedef struct LDKCResult_InvoiceSignOrCreationErrorZ {
10572 * The contents of this CResult_InvoiceSignOrCreationErrorZ, accessible via either
10573 * `err` or `result` depending on the state of `result_ok`.
10575 union LDKCResult_InvoiceSignOrCreationErrorZPtr contents;
10577 * Whether this CResult_InvoiceSignOrCreationErrorZ represents a success state.
10580 } LDKCResult_InvoiceSignOrCreationErrorZ;
10585 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
10587 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
10588 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
10589 * the return value of [`Filter::register_output`].
10591 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
10592 * may have been spent there. See [`Filter::register_output`] for details.
10594 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
10595 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
10597 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
10599 * A pointer to the opaque Rust object.
10600 * Nearly everywhere, inner must be non-null, however in places where
10601 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10603 LDKnativeWatchedOutput *inner;
10605 * Indicates that this is the only struct which contains the same pointer.
10606 * Rust functions which take ownership of an object provided via an argument require
10607 * this to be true and invalidate the object pointed to by inner.
10610 } LDKWatchedOutput;
10613 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
10616 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
10617 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
10618 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
10619 * receiving full blocks from a chain source, any further filtering is unnecessary.
10621 * After an output has been registered, subsequent block retrievals from the chain source must not
10622 * exclude any transactions matching the new criteria nor any in-block descendants of such
10625 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
10626 * should not block on I/O. Implementations should instead queue the newly monitored data to be
10627 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
10628 * invocation that has called the `Filter` must return [`TemporaryFailure`].
10630 * [`TemporaryFailure`]: ChannelMonitorUpdateErr::TemporaryFailure
10631 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
10632 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
10634 typedef struct LDKFilter {
10636 * An opaque pointer which is passed to your function implementations as an argument.
10637 * This has no meaning in the LDK, and can be NULL or any other value.
10641 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
10642 * a spending condition.
10644 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
10646 * Registers interest in spends of a transaction output.
10648 * Optionally, when `output.block_hash` is set, should return any transaction spending the
10649 * output that is found in the corresponding block along with its index.
10651 * This return value is useful for Electrum clients in order to supply in-block descendant
10652 * transactions which otherwise were not included. This is not necessary for other clients if
10653 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
10656 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
10658 * Frees any resources associated with this object given its this_arg pointer.
10659 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10661 void (*free)(void *this_arg);
10665 * An enum which can either contain a crate::lightning::chain::Filter or not
10667 typedef enum LDKCOption_FilterZ_Tag {
10669 * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
10671 LDKCOption_FilterZ_Some,
10673 * When we're in this state, this COption_FilterZ contains nothing
10675 LDKCOption_FilterZ_None,
10677 * Must be last for serialization purposes
10679 LDKCOption_FilterZ_Sentinel,
10680 } LDKCOption_FilterZ_Tag;
10682 typedef struct LDKCOption_FilterZ {
10683 LDKCOption_FilterZ_Tag tag;
10686 struct LDKFilter some;
10689 } LDKCOption_FilterZ;
10694 * A read-only reference to a current ChannelMonitor.
10696 * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
10699 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
10701 * A pointer to the opaque Rust object.
10702 * Nearly everywhere, inner must be non-null, however in places where
10703 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10705 LDKnativeLockedChannelMonitor *inner;
10707 * Indicates that this is the only struct which contains the same pointer.
10708 * Rust functions which take ownership of an object provided via an argument require
10709 * this to be true and invalidate the object pointed to by inner.
10712 } LDKLockedChannelMonitor;
10715 * The contents of CResult_LockedChannelMonitorNoneZ
10717 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
10719 * A pointer to the contents in the success state.
10720 * Reading from this pointer when `result_ok` is not set is undefined.
10722 struct LDKLockedChannelMonitor *result;
10724 * Note that this value is always NULL, as there are no contents in the Err variant
10727 } LDKCResult_LockedChannelMonitorNoneZPtr;
10730 * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
10731 * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
10732 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10734 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
10736 * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
10737 * `err` or `result` depending on the state of `result_ok`.
10739 union LDKCResult_LockedChannelMonitorNoneZPtr contents;
10741 * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
10744 } LDKCResult_LockedChannelMonitorNoneZ;
10747 * A dynamically-allocated array of crate::lightning::chain::transaction::OutPoints of arbitrary size.
10748 * This corresponds to std::vector in C++
10750 typedef struct LDKCVec_OutPointZ {
10752 * The elements in the array.
10753 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10755 struct LDKOutPoint *data;
10757 * The number of elements pointed to by `data`.
10760 } LDKCVec_OutPointZ;
10763 * A trait indicating an object may generate message send events
10765 typedef struct LDKMessageSendEventsProvider {
10767 * An opaque pointer which is passed to your function implementations as an argument.
10768 * This has no meaning in the LDK, and can be NULL or any other value.
10772 * Gets the list of pending events which were generated by previous actions, clearing the list
10775 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
10777 * Frees any resources associated with this object given its this_arg pointer.
10778 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10780 void (*free)(void *this_arg);
10781 } LDKMessageSendEventsProvider;
10784 * A trait implemented for objects handling events from [`EventsProvider`].
10786 typedef struct LDKEventHandler {
10788 * An opaque pointer which is passed to your function implementations as an argument.
10789 * This has no meaning in the LDK, and can be NULL or any other value.
10793 * Handles the given [`Event`].
10795 * See [`EventsProvider`] for details that must be considered when implementing this method.
10797 void (*handle_event)(const void *this_arg, const struct LDKEvent *NONNULL_PTR event);
10799 * Frees any resources associated with this object given its this_arg pointer.
10800 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10802 void (*free)(void *this_arg);
10806 * A trait indicating an object may generate events.
10808 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
10812 * See [`process_pending_events`] for requirements around event processing.
10814 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
10815 * event since the last invocation. The handler must either act upon the event immediately
10816 * or preserve it for later handling.
10818 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
10819 * consult the provider's documentation on the implication of processing events and how a handler
10820 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
10821 * [`ChainMonitor::process_pending_events`]).
10823 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
10826 * [`process_pending_events`]: Self::process_pending_events
10827 * [`handle_event`]: EventHandler::handle_event
10828 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
10829 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
10831 typedef struct LDKEventsProvider {
10833 * An opaque pointer which is passed to your function implementations as an argument.
10834 * This has no meaning in the LDK, and can be NULL or any other value.
10838 * Processes any events generated since the last call using the given event handler.
10840 * Subsequent calls must only process new events. However, handlers must be capable of handling
10841 * duplicate events across process restarts. This may occur if the provider was recovered from
10842 * an old state (i.e., it hadn't been successfully persisted after processing pending events).
10844 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
10846 * Frees any resources associated with this object given its this_arg pointer.
10847 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10849 void (*free)(void *this_arg);
10850 } LDKEventsProvider;
10855 * Configuration we set when applicable.
10857 * Default::default() provides sane defaults.
10859 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
10861 * A pointer to the opaque Rust object.
10862 * Nearly everywhere, inner must be non-null, however in places where
10863 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10865 LDKnativeChannelHandshakeConfig *inner;
10867 * Indicates that this is the only struct which contains the same pointer.
10868 * Rust functions which take ownership of an object provided via an argument require
10869 * this to be true and invalidate the object pointed to by inner.
10872 } LDKChannelHandshakeConfig;
10877 * Optional channel limits which are applied during channel creation.
10879 * These limits are only applied to our counterparty's limits, not our own.
10881 * Use 0/<type>::max_value() as appropriate to skip checking.
10883 * Provides sane defaults for most configurations.
10885 * Most additional limits are disabled except those with which specify a default in individual
10886 * field documentation. Note that this may result in barely-usable channels, but since they
10887 * are applied mostly only to incoming channels that's not much of a problem.
10889 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
10891 * A pointer to the opaque Rust object.
10892 * Nearly everywhere, inner must be non-null, however in places where
10893 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10895 LDKnativeChannelHandshakeLimits *inner;
10897 * Indicates that this is the only struct which contains the same pointer.
10898 * Rust functions which take ownership of an object provided via an argument require
10899 * this to be true and invalidate the object pointed to by inner.
10902 } LDKChannelHandshakeLimits;
10907 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
10909 * Default::default() provides sane defaults for most configurations
10910 * (but currently with 0 relay fees!)
10912 typedef struct MUST_USE_STRUCT LDKUserConfig {
10914 * A pointer to the opaque Rust object.
10915 * Nearly everywhere, inner must be non-null, however in places where
10916 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10918 LDKnativeUserConfig *inner;
10920 * Indicates that this is the only struct which contains the same pointer.
10921 * Rust functions which take ownership of an object provided via an argument require
10922 * this to be true and invalidate the object pointed to by inner.
10930 * The best known block as identified by its hash and height.
10932 typedef struct MUST_USE_STRUCT LDKBestBlock {
10934 * A pointer to the opaque Rust object.
10935 * Nearly everywhere, inner must be non-null, however in places where
10936 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10938 LDKnativeBestBlock *inner;
10940 * Indicates that this is the only struct which contains the same pointer.
10941 * Rust functions which take ownership of an object provided via an argument require
10942 * this to be true and invalidate the object pointed to by inner.
10948 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
10951 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
10952 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
10953 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
10956 typedef struct LDKListen {
10958 * An opaque pointer which is passed to your function implementations as an argument.
10959 * This has no meaning in the LDK, and can be NULL or any other value.
10963 * Notifies the listener that a block was added at the given height.
10965 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
10967 * Notifies the listener that a block was removed at the given height.
10969 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
10971 * Frees any resources associated with this object given its this_arg pointer.
10972 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10974 void (*free)(void *this_arg);
10978 * The `Confirm` trait is used to notify when transactions have been confirmed on chain or
10979 * unconfirmed during a chain reorganization.
10981 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
10982 * [`Listen`]. For instance, an Electrum client may implement [`Filter`] by subscribing to activity
10983 * related to registered transactions and outputs. Upon notification, it would pass along the
10984 * matching transactions using this interface.
10988 * The intended use is as follows:
10989 * - Call [`transactions_confirmed`] to process any on-chain activity of interest.
10990 * - Call [`transaction_unconfirmed`] to process any transaction returned by [`get_relevant_txids`]
10991 * that has been reorganized out of the chain.
10992 * - Call [`best_block_updated`] whenever a new chain tip becomes available.
10996 * Clients must call these methods in chain order. Specifically:
10997 * - Transactions confirmed in a block must be given before transactions confirmed in a later
10999 * - Dependent transactions within the same block must be given in topological order, possibly in
11001 * - Unconfirmed transactions must be given after the original confirmations and before any
11004 * See individual method documentation for further details.
11006 * [`transactions_confirmed`]: Self::transactions_confirmed
11007 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
11008 * [`best_block_updated`]: Self::best_block_updated
11009 * [`get_relevant_txids`]: Self::get_relevant_txids
11011 typedef struct LDKConfirm {
11013 * An opaque pointer which is passed to your function implementations as an argument.
11014 * This has no meaning in the LDK, and can be NULL or any other value.
11018 * Processes transactions confirmed in a block with a given header and height.
11020 * Should be called for any transactions registered by [`Filter::register_tx`] or any
11021 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
11022 * appearing in the same block do not need to be included in the same call; instead, multiple
11023 * calls with additional transactions may be made so long as they are made in [chain order].
11025 * May be called before or after [`best_block_updated`] for the corresponding block. However,
11026 * in the event of a chain reorganization, it must not be called with a `header` that is no
11027 * longer in the chain as of the last call to [`best_block_updated`].
11029 * [chain order]: Confirm#Order
11030 * [`best_block_updated`]: Self::best_block_updated
11032 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
11034 * Processes a transaction that is no longer confirmed as result of a chain reorganization.
11036 * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
11037 * reorganized out of the best chain. Once called, the given transaction should not be returned
11038 * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`].
11040 * [`get_relevant_txids`]: Self::get_relevant_txids
11041 * [`transactions_confirmed`]: Self::transactions_confirmed
11043 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
11045 * Processes an update to the best header connected at the given height.
11047 * Should be called when a new header is available but may be skipped for intermediary blocks
11048 * if they become available at the same time.
11050 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
11052 * Returns transactions that should be monitored for reorganization out of the chain.
11054 * Should include any transactions passed to [`transactions_confirmed`] that have insufficient
11055 * confirmations to be safe from a chain reorganization. Should not include any transactions
11056 * passed to [`transaction_unconfirmed`] unless later reconfirmed.
11058 * May be called to determine the subset of transactions that must still be monitored for
11059 * reorganization. Will be idempotent between calls but may change as a result of calls to the
11060 * other interface methods. Thus, this is useful to determine which transactions may need to be
11061 * given to [`transaction_unconfirmed`].
11063 * [`transactions_confirmed`]: Self::transactions_confirmed
11064 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
11066 struct LDKCVec_TxidZ (*get_relevant_txids)(const void *this_arg);
11068 * Frees any resources associated with this object given its this_arg pointer.
11069 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11071 void (*free)(void *this_arg);
11077 * An opaque identifier describing a specific [`Persist`] method call.
11079 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
11081 * A pointer to the opaque Rust object.
11082 * Nearly everywhere, inner must be non-null, however in places where
11083 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11085 LDKnativeMonitorUpdateId *inner;
11087 * Indicates that this is the only struct which contains the same pointer.
11088 * Rust functions which take ownership of an object provided via an argument require
11089 * this to be true and invalidate the object pointed to by inner.
11092 } LDKMonitorUpdateId;
11095 * `Persist` defines behavior for persisting channel monitors: this could mean
11096 * writing once to disk, and/or uploading to one or more backup services.
11098 * Each method can return three possible values:
11099 * * If persistence (including any relevant `fsync()` calls) happens immediately, the
11100 * implementation should return `Ok(())`, indicating normal channel operation should continue.
11101 * * If persistence happens asynchronously, implementations should first ensure the
11102 * [`ChannelMonitor`] or [`ChannelMonitorUpdate`] are written durably to disk, and then return
11103 * `Err(ChannelMonitorUpdateErr::TemporaryFailure)` while the update continues in the
11104 * background. Once the update completes, [`ChainMonitor::channel_monitor_updated`] should be
11105 * called with the corresponding [`MonitorUpdateId`].
11107 * Note that unlike the direct [`chain::Watch`] interface,
11108 * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
11110 * * If persistence fails for some reason, implementations should return
11111 * `Err(ChannelMonitorUpdateErr::PermanentFailure)`, in which case the channel will likely be
11112 * closed without broadcasting the latest state. See
11113 * [`ChannelMonitorUpdateErr::PermanentFailure`] for more details.
11115 typedef struct LDKPersist {
11117 * An opaque pointer which is passed to your function implementations as an argument.
11118 * This has no meaning in the LDK, and can be NULL or any other value.
11122 * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
11123 * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
11125 * The data can be stored any way you want, but the identifier provided by LDK is the
11126 * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
11127 * and the stored channel data). Note that you **must** persist every new monitor to disk.
11129 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
11130 * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
11132 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
11133 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
11135 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11136 * [`Writeable::write`]: crate::util::ser::Writeable::write
11138 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
11140 * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
11143 * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
11144 * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
11147 * During blockchain synchronization operations, this may be called with no
11148 * [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
11149 * Note that after the full [`ChannelMonitor`] is persisted any previous
11150 * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
11151 * applied to the persisted [`ChannelMonitor`] as they were already applied.
11153 * If an implementer chooses to persist the updates only, they need to make
11154 * sure that all the updates are applied to the `ChannelMonitors` *before*
11155 * the set of channel monitors is given to the `ChannelManager`
11156 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
11157 * applying a monitor update to a monitor. If full `ChannelMonitors` are
11158 * persisted, then there is no need to persist individual updates.
11160 * Note that there could be a performance tradeoff between persisting complete
11161 * channel monitors on every update vs. persisting only updates and applying
11162 * them in batches. The size of each monitor grows `O(number of state updates)`
11163 * whereas updates are small and `O(1)`.
11165 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
11166 * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
11168 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
11169 * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
11170 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
11172 * [`Writeable::write`]: crate::util::ser::Writeable::write
11174 * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
11176 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);
11178 * Frees any resources associated with this object given its this_arg pointer.
11179 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11181 void (*free)(void *this_arg);
11187 * An implementation of [`chain::Watch`] for monitoring channels.
11189 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
11190 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
11191 * or used independently to monitor channels remotely. See the [module-level documentation] for
11194 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11195 * [module-level documentation]: crate::chain::chainmonitor
11197 typedef struct MUST_USE_STRUCT LDKChainMonitor {
11199 * A pointer to the opaque Rust object.
11200 * Nearly everywhere, inner must be non-null, however in places where
11201 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11203 LDKnativeChainMonitor *inner;
11205 * Indicates that this is the only struct which contains the same pointer.
11206 * Rust functions which take ownership of an object provided via an argument require
11207 * this to be true and invalidate the object pointed to by inner.
11215 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
11216 * and derives keys from that.
11218 * Your node_id is seed/0'
11219 * ChannelMonitor closes may use seed/1'
11220 * Cooperative closes may use seed/2'
11221 * The two close keys may be needed to claim on-chain funds!
11223 * This struct cannot be used for nodes that wish to support receiving phantom payments;
11224 * [`PhantomKeysManager`] must be used instead.
11226 * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
11227 * previously issued invoices and attempts to pay previous invoices will fail.
11229 typedef struct MUST_USE_STRUCT LDKKeysManager {
11231 * A pointer to the opaque Rust object.
11232 * Nearly everywhere, inner must be non-null, however in places where
11233 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11235 LDKnativeKeysManager *inner;
11237 * Indicates that this is the only struct which contains the same pointer.
11238 * Rust functions which take ownership of an object provided via an argument require
11239 * this to be true and invalidate the object pointed to by inner.
11247 * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
11250 * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
11251 * paid to one of multiple nodes. This works because we encode the invoice route hints such that
11252 * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
11253 * itself without ever needing to forward to this fake node.
11255 * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
11256 * provide some fault tolerance, because payers will automatically retry paying other provided
11257 * nodes in the case that one node goes down.
11259 * Note that multi-path payments are not supported in phantom invoices for security reasons.
11260 * Switching between this struct and [`KeysManager`] will invalidate any previously issued
11261 * invoices and attempts to pay previous invoices will fail.
11263 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
11265 * A pointer to the opaque Rust object.
11266 * Nearly everywhere, inner must be non-null, however in places where
11267 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11269 LDKnativePhantomKeysManager *inner;
11271 * Indicates that this is the only struct which contains the same pointer.
11272 * Rust functions which take ownership of an object provided via an argument require
11273 * this to be true and invalidate the object pointed to by inner.
11276 } LDKPhantomKeysManager;
11281 * Chain-related parameters used to construct a new `ChannelManager`.
11283 * Typically, the block-specific parameters are derived from the best block hash for the network,
11284 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
11285 * are not needed when deserializing a previously constructed `ChannelManager`.
11287 typedef struct MUST_USE_STRUCT LDKChainParameters {
11289 * A pointer to the opaque Rust object.
11290 * Nearly everywhere, inner must be non-null, however in places where
11291 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11293 LDKnativeChainParameters *inner;
11295 * Indicates that this is the only struct which contains the same pointer.
11296 * Rust functions which take ownership of an object provided via an argument require
11297 * this to be true and invalidate the object pointed to by inner.
11300 } LDKChainParameters;
11303 * A 3-byte byte array.
11305 typedef struct LDKThreeBytes {
11313 * A trait to describe an object which can receive channel messages.
11315 * Messages MAY be called in parallel when they originate from different their_node_ids, however
11316 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
11318 typedef struct LDKChannelMessageHandler {
11320 * An opaque pointer which is passed to your function implementations as an argument.
11321 * This has no meaning in the LDK, and can be NULL or any other value.
11325 * Handle an incoming open_channel message from the given peer.
11327 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
11329 * Handle an incoming accept_channel message from the given peer.
11331 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
11333 * Handle an incoming funding_created message from the given peer.
11335 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
11337 * Handle an incoming funding_signed message from the given peer.
11339 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
11341 * Handle an incoming funding_locked message from the given peer.
11343 void (*handle_funding_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg);
11345 * Handle an incoming shutdown message from the given peer.
11347 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);
11349 * Handle an incoming closing_signed message from the given peer.
11351 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
11353 * Handle an incoming update_add_htlc message from the given peer.
11355 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
11357 * Handle an incoming update_fulfill_htlc message from the given peer.
11359 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
11361 * Handle an incoming update_fail_htlc message from the given peer.
11363 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
11365 * Handle an incoming update_fail_malformed_htlc message from the given peer.
11367 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
11369 * Handle an incoming commitment_signed message from the given peer.
11371 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
11373 * Handle an incoming revoke_and_ack message from the given peer.
11375 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
11377 * Handle an incoming update_fee message from the given peer.
11379 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
11381 * Handle an incoming announcement_signatures message from the given peer.
11383 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
11385 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
11386 * is believed to be possible in the future (eg they're sending us messages we don't
11387 * understand or indicate they require unknown feature bits), no_connection_possible is set
11388 * and any outstanding channels should be failed.
11390 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
11392 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
11394 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
11396 * Handle an incoming channel_reestablish message from the given peer.
11398 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
11400 * Handle an incoming channel update from the given peer.
11402 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
11404 * Handle an incoming error message from the given peer.
11406 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
11408 * Implementation of MessageSendEventsProvider for this object.
11410 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
11412 * Frees any resources associated with this object given its this_arg pointer.
11413 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11415 void (*free)(void *this_arg);
11416 } LDKChannelMessageHandler;
11421 * Arguments for the creation of a ChannelManager that are not deserialized.
11423 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
11425 * 1) Deserialize all stored [`ChannelMonitor`]s.
11426 * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
11427 * `<(BlockHash, ChannelManager)>::read(reader, args)`
11428 * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
11429 * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
11430 * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
11431 * same way you would handle a [`chain::Filter`] call using
11432 * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
11433 * 4) Reconnect blocks on your [`ChannelMonitor`]s.
11434 * 5) Disconnect/connect blocks on the [`ChannelManager`].
11435 * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
11436 * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
11437 * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
11439 * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
11440 * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
11442 * Note that the ordering of #4-7 is not of importance, however all four must occur before you
11443 * call any other methods on the newly-deserialized [`ChannelManager`].
11445 * Note that because some channels may be closed during deserialization, it is critical that you
11446 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
11447 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
11448 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
11449 * not force-close the same channels but consider them live), you may end up revoking a state for
11450 * which you've already broadcasted the transaction.
11452 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
11454 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
11456 * A pointer to the opaque Rust object.
11457 * Nearly everywhere, inner must be non-null, however in places where
11458 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11460 LDKnativeChannelManagerReadArgs *inner;
11462 * Indicates that this is the only struct which contains the same pointer.
11463 * Rust functions which take ownership of an object provided via an argument require
11464 * this to be true and invalidate the object pointed to by inner.
11467 } LDKChannelManagerReadArgs;
11472 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
11473 * This is used to convince the recipient that the channel is at a certain commitment
11474 * number even if they lost that data due to a local failure. Of course, the peer may lie
11475 * and even later commitments may have been revoked.
11477 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
11479 * A pointer to the opaque Rust object.
11480 * Nearly everywhere, inner must be non-null, however in places where
11481 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11483 LDKnativeDataLossProtect *inner;
11485 * Indicates that this is the only struct which contains the same pointer.
11486 * Rust functions which take ownership of an object provided via an argument require
11487 * this to be true and invalidate the object pointed to by inner.
11490 } LDKDataLossProtect;
11493 * A trait to describe an object which can receive routing messages.
11495 * # Implementor DoS Warnings
11497 * For `gossip_queries` messages there are potential DoS vectors when handling
11498 * inbound queries. Implementors using an on-disk network graph should be aware of
11499 * repeated disk I/O for queries accessing different parts of the network graph.
11501 typedef struct LDKRoutingMessageHandler {
11503 * An opaque pointer which is passed to your function implementations as an argument.
11504 * This has no meaning in the LDK, and can be NULL or any other value.
11508 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
11509 * false or returning an Err otherwise.
11511 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
11513 * Handle a channel_announcement message, returning true if it should be forwarded on, false
11514 * or returning an Err otherwise.
11516 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
11518 * Handle an incoming channel_update message, returning true if it should be forwarded on,
11519 * false or returning an Err otherwise.
11521 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
11523 * Gets a subset of the channel announcements and updates required to dump our routing table
11524 * to a remote node, starting at the short_channel_id indicated by starting_point and
11525 * including the batch_amount entries immediately higher in numerical value than starting_point.
11527 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
11529 * Gets a subset of the node announcements required to dump our routing table to a remote node,
11530 * starting at the node *after* the provided publickey and including batch_amount entries
11531 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
11532 * If None is provided for starting_point, we start at the first node.
11534 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
11536 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
11538 * Called when a connection is established with a peer. This can be used to
11539 * perform routing table synchronization using a strategy defined by the
11542 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
11544 * Handles the reply of a query we initiated to learn about channels
11545 * for a given range of blocks. We can expect to receive one or more
11546 * replies to a single query.
11548 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
11550 * Handles the reply of a query we initiated asking for routing gossip
11551 * messages for a list of channels. We should receive this message when
11552 * a node has completed its best effort to send us the pertaining routing
11555 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
11557 * Handles when a peer asks us to send a list of short_channel_ids
11558 * for the requested range of blocks.
11560 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
11562 * Handles when a peer asks us to send routing gossip messages for a
11563 * list of short_channel_ids.
11565 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
11567 * Implementation of MessageSendEventsProvider for this object.
11569 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
11571 * Frees any resources associated with this object given its this_arg pointer.
11572 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11574 void (*free)(void *this_arg);
11575 } LDKRoutingMessageHandler;
11578 * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
11581 typedef struct LDKCustomMessageReader {
11583 * An opaque pointer which is passed to your function implementations as an argument.
11584 * This has no meaning in the LDK, and can be NULL or any other value.
11588 * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
11589 * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
11590 * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
11591 * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
11593 struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
11595 * Frees any resources associated with this object given its this_arg pointer.
11596 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11598 void (*free)(void *this_arg);
11599 } LDKCustomMessageReader;
11602 * Handler for BOLT1-compliant messages.
11604 typedef struct LDKCustomMessageHandler {
11606 * An opaque pointer which is passed to your function implementations as an argument.
11607 * This has no meaning in the LDK, and can be NULL or any other value.
11611 * Called with the message type that was received and the buffer to be read.
11612 * Can return a `MessageHandlingError` if the message could not be handled.
11614 struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
11616 * Gets the list of pending messages which were generated by the custom message
11617 * handler, clearing the list in the process. The first tuple element must
11618 * correspond to the intended recipients node ids. If no connection to one of the
11619 * specified node does not exist, the message is simply not sent to it.
11621 struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
11623 * Implementation of CustomMessageReader for this object.
11625 struct LDKCustomMessageReader CustomMessageReader;
11627 * Frees any resources associated with this object given its this_arg pointer.
11628 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11630 void (*free)(void *this_arg);
11631 } LDKCustomMessageHandler;
11636 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
11637 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
11639 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
11641 * A pointer to the opaque Rust object.
11642 * Nearly everywhere, inner must be non-null, however in places where
11643 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11645 LDKnativeIgnoringMessageHandler *inner;
11647 * Indicates that this is the only struct which contains the same pointer.
11648 * Rust functions which take ownership of an object provided via an argument require
11649 * this to be true and invalidate the object pointed to by inner.
11652 } LDKIgnoringMessageHandler;
11657 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
11658 * You can provide one of these as the route_handler in a MessageHandler.
11660 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
11662 * A pointer to the opaque Rust object.
11663 * Nearly everywhere, inner must be non-null, however in places where
11664 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11666 LDKnativeErroringMessageHandler *inner;
11668 * Indicates that this is the only struct which contains the same pointer.
11669 * Rust functions which take ownership of an object provided via an argument require
11670 * this to be true and invalidate the object pointed to by inner.
11673 } LDKErroringMessageHandler;
11678 * Provides references to trait impls which handle different types of messages.
11680 typedef struct MUST_USE_STRUCT LDKMessageHandler {
11682 * A pointer to the opaque Rust object.
11683 * Nearly everywhere, inner must be non-null, however in places where
11684 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11686 LDKnativeMessageHandler *inner;
11688 * Indicates that this is the only struct which contains the same pointer.
11689 * Rust functions which take ownership of an object provided via an argument require
11690 * this to be true and invalidate the object pointed to by inner.
11693 } LDKMessageHandler;
11696 * Provides an object which can be used to send data to and which uniquely identifies a connection
11697 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
11698 * implement Hash to meet the PeerManager API.
11700 * For efficiency, Clone should be relatively cheap for this type.
11702 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
11703 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
11704 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
11705 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
11706 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
11707 * to simply use another value which is guaranteed to be globally unique instead.
11709 typedef struct LDKSocketDescriptor {
11711 * An opaque pointer which is passed to your function implementations as an argument.
11712 * This has no meaning in the LDK, and can be NULL or any other value.
11716 * Attempts to send some data from the given slice to the peer.
11718 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
11719 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
11720 * called and further write attempts may occur until that time.
11722 * If the returned size is smaller than `data.len()`, a
11723 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
11724 * written. Additionally, until a `send_data` event completes fully, no further
11725 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
11726 * prevent denial-of-service issues, you should not read or buffer any data from the socket
11729 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
11730 * (indicating that read events should be paused to prevent DoS in the send buffer),
11731 * `resume_read` may be set indicating that read events on this descriptor should resume. A
11732 * `resume_read` of false carries no meaning, and should not cause any action.
11734 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
11736 * Disconnect the socket pointed to by this SocketDescriptor.
11738 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
11739 * call (doing so is a noop).
11741 void (*disconnect_socket)(void *this_arg);
11743 * Checks if two objects are equal given this object's this_arg pointer and another object.
11745 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
11747 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
11748 * This is used, for example, for inclusion of this object in a hash map.
11750 uint64_t (*hash)(const void *this_arg);
11752 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
11753 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
11754 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
11756 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
11758 * Frees any resources associated with this object given its this_arg pointer.
11759 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11761 void (*free)(void *this_arg);
11762 } LDKSocketDescriptor;
11767 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
11768 * socket events into messages which it passes on to its [`MessageHandler`].
11770 * Locks are taken internally, so you must never assume that reentrancy from a
11771 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
11773 * Calls to [`read_event`] will decode relevant messages and pass them to the
11774 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
11775 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
11776 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
11777 * calls only after previous ones have returned.
11779 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
11780 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
11781 * essentially you should default to using a SimpleRefPeerManager, and use a
11782 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
11783 * you're using lightning-net-tokio.
11785 * [`read_event`]: PeerManager::read_event
11787 typedef struct MUST_USE_STRUCT LDKPeerManager {
11789 * A pointer to the opaque Rust object.
11790 * Nearly everywhere, inner must be non-null, however in places where
11791 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11793 LDKnativePeerManager *inner;
11795 * Indicates that this is the only struct which contains the same pointer.
11796 * Rust functions which take ownership of an object provided via an argument require
11797 * this to be true and invalidate the object pointed to by inner.
11805 * Static channel fields used to build transactions given per-commitment fields, organized by
11806 * broadcaster/countersignatory.
11808 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
11809 * as_holder_broadcastable and as_counterparty_broadcastable functions.
11811 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
11813 * A pointer to the opaque Rust object.
11814 * Nearly everywhere, inner must be non-null, however in places where
11815 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11817 LDKnativeDirectedChannelTransactionParameters *inner;
11819 * Indicates that this is the only struct which contains the same pointer.
11820 * Rust functions which take ownership of an object provided via an argument require
11821 * this to be true and invalidate the object pointed to by inner.
11824 } LDKDirectedChannelTransactionParameters;
11829 * A read-only view of [`NetworkGraph`].
11831 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
11833 * A pointer to the opaque Rust object.
11834 * Nearly everywhere, inner must be non-null, however in places where
11835 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11837 LDKnativeReadOnlyNetworkGraph *inner;
11839 * Indicates that this is the only struct which contains the same pointer.
11840 * Rust functions which take ownership of an object provided via an argument require
11841 * this to be true and invalidate the object pointed to by inner.
11844 } LDKReadOnlyNetworkGraph;
11849 * Receives and validates network updates from peers,
11850 * stores authentic and relevant data as a network graph.
11851 * This network graph is then used for routing payments.
11852 * Provides interface to help with initial routing sync by
11853 * serving historical announcements.
11855 * Serves as an [`EventHandler`] for applying updates from [`Event::PaymentPathFailed`] to the
11856 * [`NetworkGraph`].
11858 typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
11860 * A pointer to the opaque Rust object.
11861 * Nearly everywhere, inner must be non-null, however in places where
11862 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11864 LDKnativeNetGraphMsgHandler *inner;
11866 * Indicates that this is the only struct which contains the same pointer.
11867 * Rust functions which take ownership of an object provided via an argument require
11868 * this to be true and invalidate the object pointed to by inner.
11871 } LDKNetGraphMsgHandler;
11876 * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
11877 * source node to a target node.
11879 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
11881 * A pointer to the opaque Rust object.
11882 * Nearly everywhere, inner must be non-null, however in places where
11883 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11885 LDKnativeDirectedChannelInfo *inner;
11887 * Indicates that this is the only struct which contains the same pointer.
11888 * Rust functions which take ownership of an object provided via an argument require
11889 * this to be true and invalidate the object pointed to by inner.
11892 } LDKDirectedChannelInfo;
11895 * The effective capacity of a channel for routing purposes.
11897 * While this may be smaller than the actual channel capacity, amounts greater than
11898 * [`Self::as_msat`] should not be routed through the channel.
11900 typedef enum LDKEffectiveCapacity_Tag {
11902 * The available liquidity in the channel known from being a channel counterparty, and thus a
11905 LDKEffectiveCapacity_ExactLiquidity,
11907 * The maximum HTLC amount in one direction as advertised on the gossip network.
11909 LDKEffectiveCapacity_MaximumHTLC,
11911 * The total capacity of the channel as determined by the funding transaction.
11913 LDKEffectiveCapacity_Total,
11915 * A capacity sufficient to route any payment, typically used for private channels provided by
11918 LDKEffectiveCapacity_Infinite,
11920 * A capacity that is unknown possibly because either the chain state is unavailable to know
11921 * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
11923 LDKEffectiveCapacity_Unknown,
11925 * Must be last for serialization purposes
11927 LDKEffectiveCapacity_Sentinel,
11928 } LDKEffectiveCapacity_Tag;
11930 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
11932 * Either the inbound or outbound liquidity depending on the direction, denominated in
11935 uint64_t liquidity_msat;
11936 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
11938 typedef struct LDKEffectiveCapacity_LDKMaximumHTLC_Body {
11940 * The maximum HTLC amount denominated in millisatoshi.
11942 uint64_t amount_msat;
11943 } LDKEffectiveCapacity_LDKMaximumHTLC_Body;
11945 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
11947 * The funding amount denominated in millisatoshi.
11949 uint64_t capacity_msat;
11950 } LDKEffectiveCapacity_LDKTotal_Body;
11952 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
11953 LDKEffectiveCapacity_Tag tag;
11955 LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
11956 LDKEffectiveCapacity_LDKMaximumHTLC_Body maximum_htlc;
11957 LDKEffectiveCapacity_LDKTotal_Body total;
11959 } LDKEffectiveCapacity;
11962 * An interface used to score payment channels for path finding.
11964 *\tScoring is in terms of fees willing to be paid in order to avoid routing through a channel.
11966 typedef struct LDKScore {
11968 * An opaque pointer which is passed to your function implementations as an argument.
11969 * This has no meaning in the LDK, and can be NULL or any other value.
11973 * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
11974 * given channel in the direction from `source` to `target`.
11976 * The channel's capacity (less any other MPP parts that are also being considered for use in
11977 * the same payment) is given by `capacity_msat`. It may be determined from various sources
11978 * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
11979 * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
11980 * Thus, implementations should be overflow-safe.
11982 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);
11984 * Handles updating channel penalties after failing to route through a channel.
11986 void (*payment_path_failed)(void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
11988 * Handles updating channel penalties after successfully routing along a path.
11990 void (*payment_path_successful)(void *this_arg, struct LDKCVec_RouteHopZ path);
11992 * Serialize the object into a byte array
11994 struct LDKCVec_u8Z (*write)(const void *this_arg);
11996 * Frees any resources associated with this object given its this_arg pointer.
11997 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11999 void (*free)(void *this_arg);
12003 * A scorer that is accessed under a lock.
12005 * Needed so that calls to [`Score::channel_penalty_msat`] in [`find_route`] can be made while
12006 * having shared ownership of a scorer but without requiring internal locking in [`Score`]
12007 * implementations. Internal locking would be detrimental to route finding performance and could
12008 * result in [`Score::channel_penalty_msat`] returning a different value for the same channel.
12010 * [`find_route`]: crate::routing::router::find_route
12012 typedef struct LDKLockableScore {
12014 * An opaque pointer which is passed to your function implementations as an argument.
12015 * This has no meaning in the LDK, and can be NULL or any other value.
12019 * Returns the locked scorer.
12021 struct LDKScore (*lock)(const void *this_arg);
12023 * Frees any resources associated with this object given its this_arg pointer.
12024 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12026 void (*free)(void *this_arg);
12027 } LDKLockableScore;
12032 * A concrete implementation of [`LockableScore`] which supports multi-threading.
12034 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
12036 * A pointer to the opaque Rust object.
12037 * Nearly everywhere, inner must be non-null, however in places where
12038 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12040 LDKnativeMultiThreadedLockableScore *inner;
12042 * Indicates that this is the only struct which contains the same pointer.
12043 * Rust functions which take ownership of an object provided via an argument require
12044 * this to be true and invalidate the object pointed to by inner.
12047 } LDKMultiThreadedLockableScore;
12052 * Parameters for configuring [`ProbabilisticScorer`].
12054 * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
12055 * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
12057 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringParameters {
12059 * A pointer to the opaque Rust object.
12060 * Nearly everywhere, inner must be non-null, however in places where
12061 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12063 LDKnativeProbabilisticScoringParameters *inner;
12065 * Indicates that this is the only struct which contains the same pointer.
12066 * Rust functions which take ownership of an object provided via an argument require
12067 * this to be true and invalidate the object pointed to by inner.
12070 } LDKProbabilisticScoringParameters;
12075 * FilesystemPersister persists channel data on disk, where each channel's
12076 * data is stored in a file named after its funding outpoint.
12078 * Warning: this module does the best it can with calls to persist data, but it
12079 * can only guarantee that the data is passed to the drive. It is up to the
12080 * drive manufacturers to do the actual persistence properly, which they often
12081 * don't (especially on consumer-grade hardware). Therefore, it is up to the
12082 * user to validate their entire storage stack, to ensure the writes are
12084 * Corollary: especially when dealing with larger amounts of money, it is best
12085 * practice to have multiple channel data backups and not rely only on one
12086 * FilesystemPersister.
12088 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
12090 * A pointer to the opaque Rust object.
12091 * Nearly everywhere, inner must be non-null, however in places where
12092 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12094 LDKnativeFilesystemPersister *inner;
12096 * Indicates that this is the only struct which contains the same pointer.
12097 * Rust functions which take ownership of an object provided via an argument require
12098 * this to be true and invalidate the object pointed to by inner.
12101 } LDKFilesystemPersister;
12106 * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
12107 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
12108 * responsibilities are:
12109 * * Processing [`Event`]s with a user-provided [`EventHandler`].
12110 * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
12111 * writing it to disk/backups by invoking the callback given to it at startup.
12112 * [`ChannelManager`] persistence should be done in the background.
12113 * * Calling [`ChannelManager::timer_tick_occurred`] and [`PeerManager::timer_tick_occurred`]
12114 * at the appropriate intervals.
12115 * * Calling [`NetworkGraph::remove_stale_channels`] (if a [`NetGraphMsgHandler`] is provided to
12116 * [`BackgroundProcessor::start`]).
12118 * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
12119 * upon as doing so may result in high latency.
12123 * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
12124 * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
12125 * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
12126 * unilateral chain closure fees are at risk.
12128 * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
12129 * [`Event`]: lightning::util::events::Event
12130 *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
12132 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
12134 * A pointer to the opaque Rust object.
12135 * Nearly everywhere, inner must be non-null, however in places where
12136 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12138 LDKnativeBackgroundProcessor *inner;
12140 * Indicates that this is the only struct which contains the same pointer.
12141 * Rust functions which take ownership of an object provided via an argument require
12142 * this to be true and invalidate the object pointed to by inner.
12145 } LDKBackgroundProcessor;
12148 * Trait that handles persisting a [`ChannelManager`] and [`NetworkGraph`] to disk.
12150 typedef struct LDKPersister {
12152 * An opaque pointer which is passed to your function implementations as an argument.
12153 * This has no meaning in the LDK, and can be NULL or any other value.
12157 * Persist the given [`ChannelManager`] to disk, returning an error if persistence failed
12158 * (which will cause the [`BackgroundProcessor`] which called this method to exit).
12160 struct LDKCResult_NoneErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
12162 * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
12164 struct LDKCResult_NoneErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
12166 * Frees any resources associated with this object given its this_arg pointer.
12167 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12169 void (*free)(void *this_arg);
12175 * Data of the `RawInvoice` that is encoded in the data part
12177 typedef struct MUST_USE_STRUCT LDKRawDataPart {
12179 * A pointer to the opaque Rust object.
12180 * Nearly everywhere, inner must be non-null, however in places where
12181 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12183 LDKnativeRawDataPart *inner;
12185 * Indicates that this is the only struct which contains the same pointer.
12186 * Rust functions which take ownership of an object provided via an argument require
12187 * this to be true and invalidate the object pointed to by inner.
12197 typedef struct MUST_USE_STRUCT LDKSha256 {
12199 * A pointer to the opaque Rust object.
12200 * Nearly everywhere, inner must be non-null, however in places where
12201 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12203 LDKnativeSha256 *inner;
12205 * Indicates that this is the only struct which contains the same pointer.
12206 * Rust functions which take ownership of an object provided via an argument require
12207 * this to be true and invalidate the object pointed to by inner.
12215 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
12218 typedef struct MUST_USE_STRUCT LDKExpiryTime {
12220 * A pointer to the opaque Rust object.
12221 * Nearly everywhere, inner must be non-null, however in places where
12222 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12224 LDKnativeExpiryTime *inner;
12226 * Indicates that this is the only struct which contains the same pointer.
12227 * Rust functions which take ownership of an object provided via an argument require
12228 * this to be true and invalidate the object pointed to by inner.
12236 * `min_final_cltv_expiry` to use for the last HTLC in the route
12238 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiry {
12240 * A pointer to the opaque Rust object.
12241 * Nearly everywhere, inner must be non-null, however in places where
12242 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12244 LDKnativeMinFinalCltvExpiry *inner;
12246 * Indicates that this is the only struct which contains the same pointer.
12247 * Rust functions which take ownership of an object provided via an argument require
12248 * this to be true and invalidate the object pointed to by inner.
12251 } LDKMinFinalCltvExpiry;
12254 * A 20-byte byte array.
12256 typedef struct LDKTwentyBytes {
12264 * Fallback address in case no LN payment is possible
12266 typedef enum LDKFallback_Tag {
12267 LDKFallback_SegWitProgram,
12268 LDKFallback_PubKeyHash,
12269 LDKFallback_ScriptHash,
12271 * Must be last for serialization purposes
12273 LDKFallback_Sentinel,
12276 typedef struct LDKFallback_LDKSegWitProgram_Body {
12277 struct LDKu5 version;
12278 struct LDKCVec_u8Z program;
12279 } LDKFallback_LDKSegWitProgram_Body;
12281 typedef struct MUST_USE_STRUCT LDKFallback {
12282 LDKFallback_Tag tag;
12284 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
12286 struct LDKTwentyBytes pub_key_hash;
12289 struct LDKTwentyBytes script_hash;
12295 * A trait defining behavior of an [`Invoice`] payer.
12297 typedef struct LDKPayer {
12299 * An opaque pointer which is passed to your function implementations as an argument.
12300 * This has no meaning in the LDK, and can be NULL or any other value.
12304 * Returns the payer's node id.
12306 struct LDKPublicKey (*node_id)(const void *this_arg);
12308 * Returns the payer's channels.
12310 struct LDKCVec_ChannelDetailsZ (*first_hops)(const void *this_arg);
12312 * Sends a payment over the Lightning Network using the given [`Route`].
12314 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
12316 struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
12318 * Sends a spontaneous payment over the Lightning Network using the given [`Route`].
12320 struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_spontaneous_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage);
12322 * Retries a failed payment path for the [`PaymentId`] using the given [`Route`].
12324 struct LDKCResult_NonePaymentSendFailureZ (*retry_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id);
12326 * Signals that no further retries for the given payment will occur.
12328 void (*abandon_payment)(const void *this_arg, struct LDKThirtyTwoBytes payment_id);
12330 * Frees any resources associated with this object given its this_arg pointer.
12331 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12333 void (*free)(void *this_arg);
12337 * A trait defining behavior for routing an [`Invoice`] payment.
12339 typedef struct LDKRouter {
12341 * An opaque pointer which is passed to your function implementations as an argument.
12342 * This has no meaning in the LDK, and can be NULL or any other value.
12346 * Finds a [`Route`] between `payer` and `payee` for a payment with the given values.
12348 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
12350 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);
12352 * Frees any resources associated with this object given its this_arg pointer.
12353 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12355 void (*free)(void *this_arg);
12361 * A utility for paying [`Invoice`]s and sending spontaneous payments.
12363 * See [module-level documentation] for details.
12365 * [module-level documentation]: crate::payment
12367 typedef struct MUST_USE_STRUCT LDKInvoicePayer {
12369 * A pointer to the opaque Rust object.
12370 * Nearly everywhere, inner must be non-null, however in places where
12371 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12373 LDKnativeInvoicePayer *inner;
12375 * Indicates that this is the only struct which contains the same pointer.
12376 * Rust functions which take ownership of an object provided via an argument require
12377 * this to be true and invalidate the object pointed to by inner.
12385 * Number of attempts to retry payment path failures for an [`Invoice`].
12387 * Note that this is the number of *path* failures, not full payment retries. For multi-path
12388 * payments, if this is less than the total number of paths, we will never even retry all of the
12391 typedef struct MUST_USE_STRUCT LDKRetryAttempts {
12393 * A pointer to the opaque Rust object.
12394 * Nearly everywhere, inner must be non-null, however in places where
12395 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12397 LDKnativeRetryAttempts *inner;
12399 * Indicates that this is the only struct which contains the same pointer.
12400 * Rust functions which take ownership of an object provided via an argument require
12401 * this to be true and invalidate the object pointed to by inner.
12404 } LDKRetryAttempts;
12409 * A [`Router`] implemented using [`find_route`].
12411 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
12413 * A pointer to the opaque Rust object.
12414 * Nearly everywhere, inner must be non-null, however in places where
12415 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12417 LDKnativeDefaultRouter *inner;
12419 * Indicates that this is the only struct which contains the same pointer.
12420 * Rust functions which take ownership of an object provided via an argument require
12421 * this to be true and invalidate the object pointed to by inner.
12424 } LDKDefaultRouter;
12426 extern const uintptr_t MAX_BUF_SIZE;
12428 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
12430 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
12432 extern const uint32_t ANTI_REORG_DELAY;
12434 extern const uint16_t BREAKDOWN_TIMEOUT;
12436 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
12438 extern const uint32_t MIN_FINAL_CLTV_EXPIRY;
12440 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
12442 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
12444 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
12446 extern const uint64_t MAX_TIMESTAMP;
12448 extern const uint64_t DEFAULT_EXPIRY_TIME;
12450 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY;
12452 extern const uint8_t TAG_PAYMENT_HASH;
12454 extern const uint8_t TAG_DESCRIPTION;
12456 extern const uint8_t TAG_PAYEE_PUB_KEY;
12458 extern const uint8_t TAG_DESCRIPTION_HASH;
12460 extern const uint8_t TAG_EXPIRY_TIME;
12462 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY;
12464 extern const uint8_t TAG_FALLBACK;
12466 extern const uint8_t TAG_PRIVATE_ROUTE;
12468 extern const uint8_t TAG_PAYMENT_SECRET;
12470 extern const uint8_t TAG_FEATURES;
12472 struct LDKStr _ldk_get_compiled_version(void);
12474 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
12477 * Frees the data buffer, if data_is_owned is set and datalen > 0.
12479 void Transaction_free(struct LDKTransaction _res);
12482 * Convenience function for constructing a new TxOut
12484 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
12487 * Frees the data pointed to by script_pubkey.
12489 void TxOut_free(struct LDKTxOut _res);
12492 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
12494 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
12497 * Frees the data buffer, if chars_is_owned is set and len > 0.
12499 void Str_free(struct LDKStr _res);
12501 #if defined(LDK_DEBUG_BUILD)
12503 * This function exists for memory safety testing purposes. It should never be used in production
12506 const void *__unmangle_inner_ptr(const void *ptr);
12510 * Creates a new CResult_NoneNoneZ in the success state.
12512 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
12515 * Creates a new CResult_NoneNoneZ in the error state.
12517 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
12520 * Checks if the given object is currently in the success state
12522 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
12525 * Frees any resources used by the CResult_NoneNoneZ.
12527 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
12530 * Creates a new CResult_NoneNoneZ which has the same data as `orig`
12531 * but with all dynamically-allocated buffers duplicated in new buffers.
12533 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
12536 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
12538 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
12541 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
12543 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
12546 * Checks if the given object is currently in the success state
12548 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
12551 * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
12553 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
12556 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
12557 * but with all dynamically-allocated buffers duplicated in new buffers.
12559 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
12562 * Creates a new CResult_SecretKeyErrorZ in the success state.
12564 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
12567 * Creates a new CResult_SecretKeyErrorZ in the error state.
12569 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
12572 * Checks if the given object is currently in the success state
12574 bool CResult_SecretKeyErrorZ_is_ok(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR o);
12577 * Frees any resources used by the CResult_SecretKeyErrorZ.
12579 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
12582 * Creates a new CResult_SecretKeyErrorZ which has the same data as `orig`
12583 * but with all dynamically-allocated buffers duplicated in new buffers.
12585 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_clone(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR orig);
12588 * Creates a new CResult_PublicKeyErrorZ in the success state.
12590 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
12593 * Creates a new CResult_PublicKeyErrorZ in the error state.
12595 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
12598 * Checks if the given object is currently in the success state
12600 bool CResult_PublicKeyErrorZ_is_ok(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR o);
12603 * Frees any resources used by the CResult_PublicKeyErrorZ.
12605 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
12608 * Creates a new CResult_PublicKeyErrorZ which has the same data as `orig`
12609 * but with all dynamically-allocated buffers duplicated in new buffers.
12611 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig);
12614 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
12616 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
12619 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
12621 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
12624 * Checks if the given object is currently in the success state
12626 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
12629 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
12631 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
12634 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
12635 * but with all dynamically-allocated buffers duplicated in new buffers.
12637 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
12640 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
12642 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
12645 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
12647 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
12650 * Checks if the given object is currently in the success state
12652 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
12655 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
12657 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
12660 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
12661 * but with all dynamically-allocated buffers duplicated in new buffers.
12663 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
12666 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
12668 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
12671 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
12673 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
12676 * Checks if the given object is currently in the success state
12678 bool CResult_TxCreationKeysErrorZ_is_ok(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR o);
12681 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
12683 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
12686 * Creates a new CResult_TxCreationKeysErrorZ which has the same data as `orig`
12687 * but with all dynamically-allocated buffers duplicated in new buffers.
12689 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_clone(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR orig);
12692 * Constructs a new COption_u32Z containing a u32
12694 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
12697 * Constructs a new COption_u32Z containing nothing
12699 struct LDKCOption_u32Z COption_u32Z_none(void);
12702 * Frees any resources associated with the u32, if we are in the Some state
12704 void COption_u32Z_free(struct LDKCOption_u32Z _res);
12707 * Creates a new COption_u32Z which has the same data as `orig`
12708 * but with all dynamically-allocated buffers duplicated in new buffers.
12710 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
12713 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
12715 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
12718 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
12720 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
12723 * Checks if the given object is currently in the success state
12725 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
12728 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
12730 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
12733 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
12734 * but with all dynamically-allocated buffers duplicated in new buffers.
12736 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
12739 * Constructs a new COption_NoneZ containing a
12741 enum LDKCOption_NoneZ COption_NoneZ_some(void);
12744 * Constructs a new COption_NoneZ containing nothing
12746 enum LDKCOption_NoneZ COption_NoneZ_none(void);
12749 * Frees any resources associated with the , if we are in the Some state
12751 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
12754 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
12756 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
12759 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
12761 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
12764 * Checks if the given object is currently in the success state
12766 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
12769 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
12771 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
12774 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
12775 * but with all dynamically-allocated buffers duplicated in new buffers.
12777 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
12780 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
12782 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
12785 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
12787 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
12790 * Checks if the given object is currently in the success state
12792 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
12795 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
12797 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
12800 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
12801 * but with all dynamically-allocated buffers duplicated in new buffers.
12803 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
12806 * Frees the buffer pointed to by `data` if `datalen` is non-0.
12808 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
12811 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
12813 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
12816 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
12818 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
12821 * Checks if the given object is currently in the success state
12823 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
12826 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
12828 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
12831 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
12832 * but with all dynamically-allocated buffers duplicated in new buffers.
12834 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
12837 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
12839 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
12842 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
12844 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
12847 * Checks if the given object is currently in the success state
12849 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
12852 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
12854 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
12857 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
12858 * but with all dynamically-allocated buffers duplicated in new buffers.
12860 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
12863 * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
12865 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
12868 * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
12870 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
12873 * Checks if the given object is currently in the success state
12875 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
12878 * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
12880 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
12883 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
12885 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
12888 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
12890 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
12893 * Checks if the given object is currently in the success state
12895 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
12898 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
12900 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
12903 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
12904 * but with all dynamically-allocated buffers duplicated in new buffers.
12906 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
12909 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
12911 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
12914 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
12916 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
12919 * Checks if the given object is currently in the success state
12921 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
12924 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
12926 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
12929 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
12931 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
12934 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
12936 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
12939 * Checks if the given object is currently in the success state
12941 bool CResult_CVec_SignatureZNoneZ_is_ok(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR o);
12944 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
12946 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
12949 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
12950 * but with all dynamically-allocated buffers duplicated in new buffers.
12952 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
12955 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
12957 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
12960 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
12962 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
12965 * Checks if the given object is currently in the success state
12967 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
12970 * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
12972 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
12975 * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
12976 * but with all dynamically-allocated buffers duplicated in new buffers.
12978 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
12981 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
12983 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
12986 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
12988 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
12991 * Checks if the given object is currently in the success state
12993 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
12996 * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
12998 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
13001 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
13002 * but with all dynamically-allocated buffers duplicated in new buffers.
13004 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
13007 * Creates a new CResult_NoneErrorZ in the success state.
13009 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
13012 * Creates a new CResult_NoneErrorZ in the error state.
13014 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
13017 * Checks if the given object is currently in the success state
13019 bool CResult_NoneErrorZ_is_ok(const struct LDKCResult_NoneErrorZ *NONNULL_PTR o);
13022 * Frees any resources used by the CResult_NoneErrorZ.
13024 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
13027 * Creates a new CResult_NoneErrorZ which has the same data as `orig`
13028 * but with all dynamically-allocated buffers duplicated in new buffers.
13030 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig);
13033 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
13035 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
13038 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
13040 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
13043 * Checks if the given object is currently in the success state
13045 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
13048 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
13050 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
13053 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
13054 * but with all dynamically-allocated buffers duplicated in new buffers.
13056 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
13059 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13061 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
13064 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13066 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
13069 * Creates a new CResult_RouteDecodeErrorZ in the success state.
13071 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
13074 * Creates a new CResult_RouteDecodeErrorZ in the error state.
13076 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
13079 * Checks if the given object is currently in the success state
13081 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
13084 * Frees any resources used by the CResult_RouteDecodeErrorZ.
13086 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
13089 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
13090 * but with all dynamically-allocated buffers duplicated in new buffers.
13092 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
13095 * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
13097 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
13100 * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
13102 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
13105 * Checks if the given object is currently in the success state
13107 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
13110 * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
13112 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
13115 * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
13116 * but with all dynamically-allocated buffers duplicated in new buffers.
13118 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
13121 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13123 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
13126 * Constructs a new COption_u64Z containing a u64
13128 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
13131 * Constructs a new COption_u64Z containing nothing
13133 struct LDKCOption_u64Z COption_u64Z_none(void);
13136 * Frees any resources associated with the u64, if we are in the Some state
13138 void COption_u64Z_free(struct LDKCOption_u64Z _res);
13141 * Creates a new COption_u64Z which has the same data as `orig`
13142 * but with all dynamically-allocated buffers duplicated in new buffers.
13144 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
13147 * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
13149 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
13152 * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
13154 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
13157 * Checks if the given object is currently in the success state
13159 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
13162 * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
13164 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
13167 * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
13168 * but with all dynamically-allocated buffers duplicated in new buffers.
13170 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
13173 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13175 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
13178 * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
13180 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
13183 * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
13185 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
13188 * Checks if the given object is currently in the success state
13190 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
13193 * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
13195 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
13198 * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
13199 * but with all dynamically-allocated buffers duplicated in new buffers.
13201 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
13204 * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
13206 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
13209 * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
13211 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
13214 * Checks if the given object is currently in the success state
13216 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
13219 * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
13221 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
13224 * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
13225 * but with all dynamically-allocated buffers duplicated in new buffers.
13227 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
13230 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13232 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
13235 * Creates a new CResult_RouteLightningErrorZ in the success state.
13237 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
13240 * Creates a new CResult_RouteLightningErrorZ in the error state.
13242 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
13245 * Checks if the given object is currently in the success state
13247 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
13250 * Frees any resources used by the CResult_RouteLightningErrorZ.
13252 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
13255 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
13256 * but with all dynamically-allocated buffers duplicated in new buffers.
13258 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
13261 * Creates a new CResult_TxOutAccessErrorZ in the success state.
13263 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
13266 * Creates a new CResult_TxOutAccessErrorZ in the error state.
13268 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
13271 * Checks if the given object is currently in the success state
13273 bool CResult_TxOutAccessErrorZ_is_ok(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR o);
13276 * Frees any resources used by the CResult_TxOutAccessErrorZ.
13278 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
13281 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
13282 * but with all dynamically-allocated buffers duplicated in new buffers.
13284 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
13287 * Creates a new tuple which has the same data as `orig`
13288 * but with all dynamically-allocated buffers duplicated in new buffers.
13290 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
13293 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
13295 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
13298 * Frees any resources used by the C2Tuple_usizeTransactionZ.
13300 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
13303 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13305 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
13308 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13310 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
13313 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
13315 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
13318 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
13320 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
13323 * Checks if the given object is currently in the success state
13325 bool CResult_NoneChannelMonitorUpdateErrZ_is_ok(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR o);
13328 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
13330 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
13333 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
13334 * but with all dynamically-allocated buffers duplicated in new buffers.
13336 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
13339 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13341 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
13344 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ
13346 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
13349 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing
13351 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
13354 * Frees any resources associated with the crate::c_types::derived::C2Tuple_usizeTransactionZ, if we are in the Some state
13356 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
13359 * Creates a new COption_C2Tuple_usizeTransactionZZ which has the same data as `orig`
13360 * but with all dynamically-allocated buffers duplicated in new buffers.
13362 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_clone(const struct LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR orig);
13365 * Constructs a new COption_ClosureReasonZ containing a crate::lightning::util::events::ClosureReason
13367 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
13370 * Constructs a new COption_ClosureReasonZ containing nothing
13372 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
13375 * Frees any resources associated with the crate::lightning::util::events::ClosureReason, if we are in the Some state
13377 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
13380 * Creates a new COption_ClosureReasonZ which has the same data as `orig`
13381 * but with all dynamically-allocated buffers duplicated in new buffers.
13383 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
13386 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
13388 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
13391 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
13393 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
13396 * Checks if the given object is currently in the success state
13398 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
13401 * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
13403 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
13406 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
13407 * but with all dynamically-allocated buffers duplicated in new buffers.
13409 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
13412 * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::network_graph::NetworkUpdate
13414 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
13417 * Constructs a new COption_NetworkUpdateZ containing nothing
13419 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
13422 * Frees any resources associated with the crate::lightning::routing::network_graph::NetworkUpdate, if we are in the Some state
13424 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
13427 * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
13428 * but with all dynamically-allocated buffers duplicated in new buffers.
13430 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
13433 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13435 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
13438 * Constructs a new COption_EventZ containing a crate::lightning::util::events::Event
13440 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
13443 * Constructs a new COption_EventZ containing nothing
13445 struct LDKCOption_EventZ COption_EventZ_none(void);
13448 * Frees any resources associated with the crate::lightning::util::events::Event, if we are in the Some state
13450 void COption_EventZ_free(struct LDKCOption_EventZ _res);
13453 * Creates a new COption_EventZ which has the same data as `orig`
13454 * but with all dynamically-allocated buffers duplicated in new buffers.
13456 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
13459 * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
13461 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
13464 * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
13466 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
13469 * Checks if the given object is currently in the success state
13471 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
13474 * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
13476 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
13479 * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
13480 * but with all dynamically-allocated buffers duplicated in new buffers.
13482 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
13485 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13487 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
13490 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
13492 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
13495 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
13497 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
13500 * Checks if the given object is currently in the success state
13502 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
13505 * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
13507 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
13510 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
13511 * but with all dynamically-allocated buffers duplicated in new buffers.
13513 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
13516 * Creates a new CResult_ScoringParametersDecodeErrorZ in the success state.
13518 struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_ok(struct LDKScoringParameters o);
13521 * Creates a new CResult_ScoringParametersDecodeErrorZ in the error state.
13523 struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_err(struct LDKDecodeError e);
13526 * Checks if the given object is currently in the success state
13528 bool CResult_ScoringParametersDecodeErrorZ_is_ok(const struct LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR o);
13531 * Frees any resources used by the CResult_ScoringParametersDecodeErrorZ.
13533 void CResult_ScoringParametersDecodeErrorZ_free(struct LDKCResult_ScoringParametersDecodeErrorZ _res);
13536 * Creates a new CResult_ScoringParametersDecodeErrorZ which has the same data as `orig`
13537 * but with all dynamically-allocated buffers duplicated in new buffers.
13539 struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_clone(const struct LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR orig);
13542 * Creates a new CResult_ScorerDecodeErrorZ in the success state.
13544 struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_ok(struct LDKScorer o);
13547 * Creates a new CResult_ScorerDecodeErrorZ in the error state.
13549 struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_err(struct LDKDecodeError e);
13552 * Checks if the given object is currently in the success state
13554 bool CResult_ScorerDecodeErrorZ_is_ok(const struct LDKCResult_ScorerDecodeErrorZ *NONNULL_PTR o);
13557 * Frees any resources used by the CResult_ScorerDecodeErrorZ.
13559 void CResult_ScorerDecodeErrorZ_free(struct LDKCResult_ScorerDecodeErrorZ _res);
13562 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
13564 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
13567 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
13569 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
13572 * Checks if the given object is currently in the success state
13574 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
13577 * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
13579 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
13582 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
13584 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
13587 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
13589 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
13592 * Checks if the given object is currently in the success state
13594 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
13597 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
13599 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
13602 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
13604 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
13607 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
13609 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
13612 * Checks if the given object is currently in the success state
13614 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
13617 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
13619 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
13622 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
13624 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
13627 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
13629 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
13632 * Checks if the given object is currently in the success state
13634 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
13637 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
13639 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
13642 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
13644 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
13647 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
13649 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
13652 * Checks if the given object is currently in the success state
13654 bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
13657 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
13659 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
13662 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
13664 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
13667 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
13669 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
13672 * Checks if the given object is currently in the success state
13674 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
13677 * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
13679 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
13682 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
13684 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
13687 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
13689 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
13692 * Checks if the given object is currently in the success state
13694 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
13697 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
13699 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
13702 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
13703 * but with all dynamically-allocated buffers duplicated in new buffers.
13705 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
13708 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
13710 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
13713 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
13715 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
13718 * Checks if the given object is currently in the success state
13720 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
13723 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
13725 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
13728 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
13729 * but with all dynamically-allocated buffers duplicated in new buffers.
13731 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
13734 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
13736 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
13739 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
13741 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
13744 * Checks if the given object is currently in the success state
13746 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
13749 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
13751 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
13754 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
13755 * but with all dynamically-allocated buffers duplicated in new buffers.
13757 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
13760 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13762 void CVec_PaymentPreimageZ_free(struct LDKCVec_PaymentPreimageZ _res);
13765 * Creates a new tuple which has the same data as `orig`
13766 * but with all dynamically-allocated buffers duplicated in new buffers.
13768 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
13771 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
13773 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
13776 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
13778 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
13781 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
13783 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
13786 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
13788 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
13791 * Checks if the given object is currently in the success state
13793 bool CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR o);
13796 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
13798 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
13801 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
13802 * but with all dynamically-allocated buffers duplicated in new buffers.
13804 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
13807 * Creates a new CResult_SignatureNoneZ in the success state.
13809 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
13812 * Creates a new CResult_SignatureNoneZ in the error state.
13814 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
13817 * Checks if the given object is currently in the success state
13819 bool CResult_SignatureNoneZ_is_ok(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR o);
13822 * Frees any resources used by the CResult_SignatureNoneZ.
13824 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
13827 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
13828 * but with all dynamically-allocated buffers duplicated in new buffers.
13830 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
13833 * Creates a new tuple which has the same data as `orig`
13834 * but with all dynamically-allocated buffers duplicated in new buffers.
13836 struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_clone(const struct LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR orig);
13839 * Creates a new C2Tuple_SignatureSignatureZ from the contained elements.
13841 struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_new(struct LDKSignature a, struct LDKSignature b);
13844 * Frees any resources used by the C2Tuple_SignatureSignatureZ.
13846 void C2Tuple_SignatureSignatureZ_free(struct LDKC2Tuple_SignatureSignatureZ _res);
13849 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the success state.
13851 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_ok(struct LDKC2Tuple_SignatureSignatureZ o);
13854 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the error state.
13856 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_err(void);
13859 * Checks if the given object is currently in the success state
13861 bool CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR o);
13864 * Frees any resources used by the CResult_C2Tuple_SignatureSignatureZNoneZ.
13866 void CResult_C2Tuple_SignatureSignatureZNoneZ_free(struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res);
13869 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ which has the same data as `orig`
13870 * but with all dynamically-allocated buffers duplicated in new buffers.
13872 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR orig);
13875 * Creates a new CResult_SecretKeyNoneZ in the success state.
13877 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_ok(struct LDKSecretKey o);
13880 * Creates a new CResult_SecretKeyNoneZ in the error state.
13882 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_err(void);
13885 * Checks if the given object is currently in the success state
13887 bool CResult_SecretKeyNoneZ_is_ok(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR o);
13890 * Frees any resources used by the CResult_SecretKeyNoneZ.
13892 void CResult_SecretKeyNoneZ_free(struct LDKCResult_SecretKeyNoneZ _res);
13895 * Creates a new CResult_SecretKeyNoneZ which has the same data as `orig`
13896 * but with all dynamically-allocated buffers duplicated in new buffers.
13898 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_clone(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR orig);
13901 * Creates a new CResult_SignDecodeErrorZ in the success state.
13903 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
13906 * Creates a new CResult_SignDecodeErrorZ in the error state.
13908 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
13911 * Checks if the given object is currently in the success state
13913 bool CResult_SignDecodeErrorZ_is_ok(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR o);
13916 * Frees any resources used by the CResult_SignDecodeErrorZ.
13918 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
13921 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
13922 * but with all dynamically-allocated buffers duplicated in new buffers.
13924 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
13927 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13929 void CVec_u5Z_free(struct LDKCVec_u5Z _res);
13932 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
13934 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
13937 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
13939 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
13942 * Checks if the given object is currently in the success state
13944 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
13947 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
13949 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
13952 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
13953 * but with all dynamically-allocated buffers duplicated in new buffers.
13955 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
13958 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13960 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
13963 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13965 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
13968 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
13970 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
13973 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
13975 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
13978 * Checks if the given object is currently in the success state
13980 bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o);
13983 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
13985 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
13988 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
13989 * but with all dynamically-allocated buffers duplicated in new buffers.
13991 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
13994 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
13996 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
13999 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
14001 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
14004 * Checks if the given object is currently in the success state
14006 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
14009 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
14011 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
14014 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
14015 * but with all dynamically-allocated buffers duplicated in new buffers.
14017 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
14020 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14022 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
14025 * Creates a new CResult_TransactionNoneZ in the success state.
14027 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
14030 * Creates a new CResult_TransactionNoneZ in the error state.
14032 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
14035 * Checks if the given object is currently in the success state
14037 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
14040 * Frees any resources used by the CResult_TransactionNoneZ.
14042 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
14045 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
14046 * but with all dynamically-allocated buffers duplicated in new buffers.
14048 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
14051 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
14053 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
14056 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
14058 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
14061 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14063 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
14066 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
14068 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
14071 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
14073 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
14076 * Checks if the given object is currently in the success state
14078 bool CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR o);
14081 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
14083 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
14086 * Constructs a new COption_u16Z containing a u16
14088 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
14091 * Constructs a new COption_u16Z containing nothing
14093 struct LDKCOption_u16Z COption_u16Z_none(void);
14096 * Frees any resources associated with the u16, if we are in the Some state
14098 void COption_u16Z_free(struct LDKCOption_u16Z _res);
14101 * Creates a new COption_u16Z which has the same data as `orig`
14102 * but with all dynamically-allocated buffers duplicated in new buffers.
14104 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
14107 * Creates a new CResult_NoneAPIErrorZ in the success state.
14109 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
14112 * Creates a new CResult_NoneAPIErrorZ in the error state.
14114 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
14117 * Checks if the given object is currently in the success state
14119 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
14122 * Frees any resources used by the CResult_NoneAPIErrorZ.
14124 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
14127 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
14128 * but with all dynamically-allocated buffers duplicated in new buffers.
14130 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
14133 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14135 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
14138 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14140 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
14143 * Creates a new CResult__u832APIErrorZ in the success state.
14145 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_ok(struct LDKThirtyTwoBytes o);
14148 * Creates a new CResult__u832APIErrorZ in the error state.
14150 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_err(struct LDKAPIError e);
14153 * Checks if the given object is currently in the success state
14155 bool CResult__u832APIErrorZ_is_ok(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR o);
14158 * Frees any resources used by the CResult__u832APIErrorZ.
14160 void CResult__u832APIErrorZ_free(struct LDKCResult__u832APIErrorZ _res);
14163 * Creates a new CResult__u832APIErrorZ which has the same data as `orig`
14164 * but with all dynamically-allocated buffers duplicated in new buffers.
14166 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig);
14169 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the success state.
14171 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
14174 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the error state.
14176 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
14179 * Checks if the given object is currently in the success state
14181 bool CResult_PaymentIdPaymentSendFailureZ_is_ok(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR o);
14184 * Frees any resources used by the CResult_PaymentIdPaymentSendFailureZ.
14186 void CResult_PaymentIdPaymentSendFailureZ_free(struct LDKCResult_PaymentIdPaymentSendFailureZ _res);
14189 * Creates a new CResult_PaymentIdPaymentSendFailureZ which has the same data as `orig`
14190 * but with all dynamically-allocated buffers duplicated in new buffers.
14192 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_clone(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR orig);
14195 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
14197 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
14200 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
14202 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
14205 * Checks if the given object is currently in the success state
14207 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
14210 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
14212 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
14215 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
14216 * but with all dynamically-allocated buffers duplicated in new buffers.
14218 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
14221 * Creates a new tuple which has the same data as `orig`
14222 * but with all dynamically-allocated buffers duplicated in new buffers.
14224 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig);
14227 * Creates a new C2Tuple_PaymentHashPaymentIdZ from the contained elements.
14229 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
14232 * Frees any resources used by the C2Tuple_PaymentHashPaymentIdZ.
14234 void C2Tuple_PaymentHashPaymentIdZ_free(struct LDKC2Tuple_PaymentHashPaymentIdZ _res);
14237 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the success state.
14239 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(struct LDKC2Tuple_PaymentHashPaymentIdZ o);
14242 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the error state.
14244 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
14247 * Checks if the given object is currently in the success state
14249 bool CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR o);
14252 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.
14254 void CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res);
14257 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ which has the same data as `orig`
14258 * but with all dynamically-allocated buffers duplicated in new buffers.
14260 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR orig);
14263 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14265 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
14268 * Creates a new tuple which has the same data as `orig`
14269 * but with all dynamically-allocated buffers duplicated in new buffers.
14271 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig);
14274 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
14276 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
14279 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
14281 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
14284 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the success state.
14286 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
14289 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the error state.
14291 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(void);
14294 * Checks if the given object is currently in the success state
14296 bool CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR o);
14299 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ.
14301 void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res);
14304 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ which has the same data as `orig`
14305 * but with all dynamically-allocated buffers duplicated in new buffers.
14307 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR orig);
14310 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the success state.
14312 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
14315 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the error state.
14317 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(struct LDKAPIError e);
14320 * Checks if the given object is currently in the success state
14322 bool CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR o);
14325 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.
14327 void CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res);
14330 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ which has the same data as `orig`
14331 * but with all dynamically-allocated buffers duplicated in new buffers.
14333 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR orig);
14336 * Creates a new CResult_PaymentSecretNoneZ in the success state.
14338 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
14341 * Creates a new CResult_PaymentSecretNoneZ in the error state.
14343 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_err(void);
14346 * Checks if the given object is currently in the success state
14348 bool CResult_PaymentSecretNoneZ_is_ok(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR o);
14351 * Frees any resources used by the CResult_PaymentSecretNoneZ.
14353 void CResult_PaymentSecretNoneZ_free(struct LDKCResult_PaymentSecretNoneZ _res);
14356 * Creates a new CResult_PaymentSecretNoneZ which has the same data as `orig`
14357 * but with all dynamically-allocated buffers duplicated in new buffers.
14359 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_clone(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR orig);
14362 * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
14364 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
14367 * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
14369 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
14372 * Checks if the given object is currently in the success state
14374 bool CResult_PaymentSecretAPIErrorZ_is_ok(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR o);
14377 * Frees any resources used by the CResult_PaymentSecretAPIErrorZ.
14379 void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res);
14382 * Creates a new CResult_PaymentSecretAPIErrorZ which has the same data as `orig`
14383 * but with all dynamically-allocated buffers duplicated in new buffers.
14385 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig);
14388 * Creates a new CResult_PaymentPreimageAPIErrorZ in the success state.
14390 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
14393 * Creates a new CResult_PaymentPreimageAPIErrorZ in the error state.
14395 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_err(struct LDKAPIError e);
14398 * Checks if the given object is currently in the success state
14400 bool CResult_PaymentPreimageAPIErrorZ_is_ok(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR o);
14403 * Frees any resources used by the CResult_PaymentPreimageAPIErrorZ.
14405 void CResult_PaymentPreimageAPIErrorZ_free(struct LDKCResult_PaymentPreimageAPIErrorZ _res);
14408 * Creates a new CResult_PaymentPreimageAPIErrorZ which has the same data as `orig`
14409 * but with all dynamically-allocated buffers duplicated in new buffers.
14411 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_clone(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR orig);
14414 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
14416 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
14419 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
14421 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
14424 * Checks if the given object is currently in the success state
14426 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
14429 * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
14431 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
14434 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
14435 * but with all dynamically-allocated buffers duplicated in new buffers.
14437 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
14440 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
14442 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
14445 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
14447 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
14450 * Checks if the given object is currently in the success state
14452 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
14455 * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
14457 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
14460 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
14461 * but with all dynamically-allocated buffers duplicated in new buffers.
14463 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
14466 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
14468 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
14471 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
14473 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
14476 * Checks if the given object is currently in the success state
14478 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
14481 * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
14483 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
14486 * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
14487 * but with all dynamically-allocated buffers duplicated in new buffers.
14489 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
14492 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
14494 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
14497 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
14499 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
14502 * Checks if the given object is currently in the success state
14504 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
14507 * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
14509 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
14512 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
14513 * but with all dynamically-allocated buffers duplicated in new buffers.
14515 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
14518 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14520 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
14523 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
14525 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
14528 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
14530 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
14533 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
14535 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
14538 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
14540 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
14543 * Checks if the given object is currently in the success state
14545 bool CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR o);
14548 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
14550 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
14553 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
14555 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
14558 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
14560 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
14563 * Checks if the given object is currently in the success state
14565 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
14568 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
14570 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
14573 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
14574 * but with all dynamically-allocated buffers duplicated in new buffers.
14576 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
14579 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
14581 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
14584 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
14586 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
14589 * Checks if the given object is currently in the success state
14591 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
14594 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
14596 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
14599 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
14600 * but with all dynamically-allocated buffers duplicated in new buffers.
14602 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
14605 * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
14607 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
14610 * Constructs a new COption_TypeZ containing nothing
14612 struct LDKCOption_TypeZ COption_TypeZ_none(void);
14615 * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
14617 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
14620 * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
14622 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
14625 * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
14627 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
14630 * Checks if the given object is currently in the success state
14632 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
14635 * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
14637 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
14640 * Creates a new CResult_PaymentIdPaymentErrorZ in the success state.
14642 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o);
14645 * Creates a new CResult_PaymentIdPaymentErrorZ in the error state.
14647 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e);
14650 * Checks if the given object is currently in the success state
14652 bool CResult_PaymentIdPaymentErrorZ_is_ok(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR o);
14655 * Frees any resources used by the CResult_PaymentIdPaymentErrorZ.
14657 void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res);
14660 * Creates a new CResult_PaymentIdPaymentErrorZ which has the same data as `orig`
14661 * but with all dynamically-allocated buffers duplicated in new buffers.
14663 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig);
14666 * Creates a new CResult_SiPrefixParseErrorZ in the success state.
14668 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_ok(enum LDKSiPrefix o);
14671 * Creates a new CResult_SiPrefixParseErrorZ in the error state.
14673 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_err(struct LDKParseError e);
14676 * Checks if the given object is currently in the success state
14678 bool CResult_SiPrefixParseErrorZ_is_ok(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR o);
14681 * Frees any resources used by the CResult_SiPrefixParseErrorZ.
14683 void CResult_SiPrefixParseErrorZ_free(struct LDKCResult_SiPrefixParseErrorZ _res);
14686 * Creates a new CResult_SiPrefixParseErrorZ which has the same data as `orig`
14687 * but with all dynamically-allocated buffers duplicated in new buffers.
14689 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_clone(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR orig);
14692 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the success state.
14694 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_ok(struct LDKInvoice o);
14697 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the error state.
14699 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
14702 * Checks if the given object is currently in the success state
14704 bool CResult_InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
14707 * Frees any resources used by the CResult_InvoiceParseOrSemanticErrorZ.
14709 void CResult_InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_InvoiceParseOrSemanticErrorZ _res);
14712 * Creates a new CResult_InvoiceParseOrSemanticErrorZ which has the same data as `orig`
14713 * but with all dynamically-allocated buffers duplicated in new buffers.
14715 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
14718 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the success state.
14720 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_ok(struct LDKSignedRawInvoice o);
14723 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the error state.
14725 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_err(struct LDKParseError e);
14728 * Checks if the given object is currently in the success state
14730 bool CResult_SignedRawInvoiceParseErrorZ_is_ok(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR o);
14733 * Frees any resources used by the CResult_SignedRawInvoiceParseErrorZ.
14735 void CResult_SignedRawInvoiceParseErrorZ_free(struct LDKCResult_SignedRawInvoiceParseErrorZ _res);
14738 * Creates a new CResult_SignedRawInvoiceParseErrorZ which has the same data as `orig`
14739 * but with all dynamically-allocated buffers duplicated in new buffers.
14741 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_clone(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR orig);
14744 * Creates a new tuple which has the same data as `orig`
14745 * but with all dynamically-allocated buffers duplicated in new buffers.
14747 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig);
14750 * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements.
14752 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c);
14755 * Frees any resources used by the C3Tuple_RawInvoice_u832InvoiceSignatureZ.
14757 void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res);
14760 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
14762 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
14765 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
14767 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
14770 * Checks if the given object is currently in the success state
14772 bool CResult_PayeePubKeyErrorZ_is_ok(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR o);
14775 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
14777 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
14780 * Creates a new CResult_PayeePubKeyErrorZ which has the same data as `orig`
14781 * but with all dynamically-allocated buffers duplicated in new buffers.
14783 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig);
14786 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14788 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
14791 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
14793 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
14796 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
14798 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
14801 * Checks if the given object is currently in the success state
14803 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
14806 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
14808 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
14811 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
14812 * but with all dynamically-allocated buffers duplicated in new buffers.
14814 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
14817 * Creates a new CResult_NoneSemanticErrorZ in the success state.
14819 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void);
14822 * Creates a new CResult_NoneSemanticErrorZ in the error state.
14824 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e);
14827 * Checks if the given object is currently in the success state
14829 bool CResult_NoneSemanticErrorZ_is_ok(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR o);
14832 * Frees any resources used by the CResult_NoneSemanticErrorZ.
14834 void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res);
14837 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
14838 * but with all dynamically-allocated buffers duplicated in new buffers.
14840 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig);
14843 * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
14845 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o);
14848 * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
14850 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e);
14853 * Checks if the given object is currently in the success state
14855 bool CResult_InvoiceSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR o);
14858 * Frees any resources used by the CResult_InvoiceSemanticErrorZ.
14860 void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res);
14863 * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig`
14864 * but with all dynamically-allocated buffers duplicated in new buffers.
14866 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig);
14869 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
14871 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
14874 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
14876 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
14879 * Checks if the given object is currently in the success state
14881 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
14884 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
14886 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
14889 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
14890 * but with all dynamically-allocated buffers duplicated in new buffers.
14892 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
14895 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
14897 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
14900 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
14902 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
14905 * Checks if the given object is currently in the success state
14907 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
14910 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
14912 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
14915 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
14916 * but with all dynamically-allocated buffers duplicated in new buffers.
14918 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
14921 * Creates a new CResult_StringErrorZ in the success state.
14923 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o);
14926 * Creates a new CResult_StringErrorZ in the error state.
14928 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
14931 * Checks if the given object is currently in the success state
14933 bool CResult_StringErrorZ_is_ok(const struct LDKCResult_StringErrorZ *NONNULL_PTR o);
14936 * Frees any resources used by the CResult_StringErrorZ.
14938 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
14941 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
14943 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
14946 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
14948 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
14951 * Checks if the given object is currently in the success state
14953 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
14956 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
14958 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
14961 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
14962 * but with all dynamically-allocated buffers duplicated in new buffers.
14964 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
14967 * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
14969 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
14972 * Constructs a new COption_MonitorEventZ containing nothing
14974 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
14977 * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
14979 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
14982 * Creates a new COption_MonitorEventZ which has the same data as `orig`
14983 * but with all dynamically-allocated buffers duplicated in new buffers.
14985 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
14988 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
14990 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
14993 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
14995 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
14998 * Checks if the given object is currently in the success state
15000 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
15003 * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
15005 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
15008 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
15009 * but with all dynamically-allocated buffers duplicated in new buffers.
15011 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
15014 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
15016 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
15019 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
15021 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
15024 * Checks if the given object is currently in the success state
15026 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
15029 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
15031 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
15034 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
15035 * but with all dynamically-allocated buffers duplicated in new buffers.
15037 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
15040 * Creates a new tuple which has the same data as `orig`
15041 * but with all dynamically-allocated buffers duplicated in new buffers.
15043 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
15046 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
15048 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
15051 * Frees any resources used by the C2Tuple_OutPointScriptZ.
15053 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
15056 * Creates a new tuple which has the same data as `orig`
15057 * but with all dynamically-allocated buffers duplicated in new buffers.
15059 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
15062 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
15064 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
15067 * Frees any resources used by the C2Tuple_u32ScriptZ.
15069 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
15072 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15074 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
15077 * Creates a new tuple which has the same data as `orig`
15078 * but with all dynamically-allocated buffers duplicated in new buffers.
15080 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR orig);
15083 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
15085 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
15088 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
15090 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
15093 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15095 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
15098 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15100 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
15103 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15105 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
15108 * Creates a new tuple which has the same data as `orig`
15109 * but with all dynamically-allocated buffers duplicated in new buffers.
15111 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
15114 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
15116 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
15119 * Frees any resources used by the C2Tuple_u32TxOutZ.
15121 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
15124 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15126 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
15129 * Creates a new tuple which has the same data as `orig`
15130 * but with all dynamically-allocated buffers duplicated in new buffers.
15132 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
15135 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
15137 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
15140 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
15142 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
15145 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15147 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
15150 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15152 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
15155 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
15157 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
15160 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
15162 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
15165 * Checks if the given object is currently in the success state
15167 bool CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
15170 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
15172 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
15175 * Creates a new CResult_NoneLightningErrorZ in the success state.
15177 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
15180 * Creates a new CResult_NoneLightningErrorZ in the error state.
15182 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
15185 * Checks if the given object is currently in the success state
15187 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
15190 * Frees any resources used by the CResult_NoneLightningErrorZ.
15192 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
15195 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
15196 * but with all dynamically-allocated buffers duplicated in new buffers.
15198 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
15201 * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
15203 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
15206 * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
15208 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
15211 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15213 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
15216 * Creates a new CResult_boolLightningErrorZ in the success state.
15218 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
15221 * Creates a new CResult_boolLightningErrorZ in the error state.
15223 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
15226 * Checks if the given object is currently in the success state
15228 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
15231 * Frees any resources used by the CResult_boolLightningErrorZ.
15233 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
15236 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
15237 * but with all dynamically-allocated buffers duplicated in new buffers.
15239 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
15242 * Creates a new tuple which has the same data as `orig`
15243 * but with all dynamically-allocated buffers duplicated in new buffers.
15245 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
15248 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
15250 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
15253 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
15255 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
15258 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15260 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
15263 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15265 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
15268 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15270 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
15273 * Constructs a new COption_NetAddressZ containing a crate::lightning::ln::msgs::NetAddress
15275 struct LDKCOption_NetAddressZ COption_NetAddressZ_some(struct LDKNetAddress o);
15278 * Constructs a new COption_NetAddressZ containing nothing
15280 struct LDKCOption_NetAddressZ COption_NetAddressZ_none(void);
15283 * Frees any resources associated with the crate::lightning::ln::msgs::NetAddress, if we are in the Some state
15285 void COption_NetAddressZ_free(struct LDKCOption_NetAddressZ _res);
15288 * Creates a new COption_NetAddressZ which has the same data as `orig`
15289 * but with all dynamically-allocated buffers duplicated in new buffers.
15291 struct LDKCOption_NetAddressZ COption_NetAddressZ_clone(const struct LDKCOption_NetAddressZ *NONNULL_PTR orig);
15294 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
15296 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
15299 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
15301 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
15304 * Checks if the given object is currently in the success state
15306 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
15309 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
15311 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
15314 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
15315 * but with all dynamically-allocated buffers duplicated in new buffers.
15317 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
15320 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
15322 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
15325 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
15327 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
15330 * Checks if the given object is currently in the success state
15332 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
15335 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
15337 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
15340 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
15341 * but with all dynamically-allocated buffers duplicated in new buffers.
15343 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
15346 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
15348 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
15351 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
15353 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
15356 * Checks if the given object is currently in the success state
15358 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
15361 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
15363 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
15366 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
15367 * but with all dynamically-allocated buffers duplicated in new buffers.
15369 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
15372 * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
15374 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
15377 * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
15379 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
15382 * Checks if the given object is currently in the success state
15384 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
15387 * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
15389 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
15392 * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
15393 * but with all dynamically-allocated buffers duplicated in new buffers.
15395 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
15398 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
15400 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
15403 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
15405 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
15408 * Checks if the given object is currently in the success state
15410 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
15413 * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
15415 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
15418 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
15419 * but with all dynamically-allocated buffers duplicated in new buffers.
15421 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
15424 * Constructs a new COption_AccessZ containing a crate::lightning::chain::Access
15426 struct LDKCOption_AccessZ COption_AccessZ_some(struct LDKAccess o);
15429 * Constructs a new COption_AccessZ containing nothing
15431 struct LDKCOption_AccessZ COption_AccessZ_none(void);
15434 * Frees any resources associated with the crate::lightning::chain::Access, if we are in the Some state
15436 void COption_AccessZ_free(struct LDKCOption_AccessZ _res);
15439 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
15441 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
15444 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
15446 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
15449 * Checks if the given object is currently in the success state
15451 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
15454 * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
15456 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
15459 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
15460 * but with all dynamically-allocated buffers duplicated in new buffers.
15462 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
15465 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
15467 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
15470 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
15472 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
15475 * Checks if the given object is currently in the success state
15477 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
15480 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
15482 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
15485 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
15486 * but with all dynamically-allocated buffers duplicated in new buffers.
15488 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
15491 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
15493 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
15496 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
15498 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
15501 * Checks if the given object is currently in the success state
15503 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
15506 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
15508 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
15511 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
15512 * but with all dynamically-allocated buffers duplicated in new buffers.
15514 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
15517 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
15519 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
15522 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
15524 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
15527 * Checks if the given object is currently in the success state
15529 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
15532 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
15534 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
15537 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
15538 * but with all dynamically-allocated buffers duplicated in new buffers.
15540 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
15543 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15545 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
15548 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
15550 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
15553 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
15555 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
15558 * Checks if the given object is currently in the success state
15560 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
15563 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
15565 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
15568 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
15569 * but with all dynamically-allocated buffers duplicated in new buffers.
15571 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
15574 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
15576 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
15579 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
15581 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
15584 * Checks if the given object is currently in the success state
15586 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
15589 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
15591 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
15594 * Creates a new CResult_NetworkGraphDecodeErrorZ which has the same data as `orig`
15595 * but with all dynamically-allocated buffers duplicated in new buffers.
15597 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
15600 * Constructs a new COption_CVec_NetAddressZZ containing a crate::c_types::derived::CVec_NetAddressZ
15602 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o);
15605 * Constructs a new COption_CVec_NetAddressZZ containing nothing
15607 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_none(void);
15610 * Frees any resources associated with the crate::c_types::derived::CVec_NetAddressZ, if we are in the Some state
15612 void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res);
15615 * Creates a new COption_CVec_NetAddressZZ which has the same data as `orig`
15616 * but with all dynamically-allocated buffers duplicated in new buffers.
15618 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig);
15621 * Creates a new CResult_NetAddressDecodeErrorZ in the success state.
15623 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
15626 * Creates a new CResult_NetAddressDecodeErrorZ in the error state.
15628 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
15631 * Checks if the given object is currently in the success state
15633 bool CResult_NetAddressDecodeErrorZ_is_ok(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR o);
15636 * Frees any resources used by the CResult_NetAddressDecodeErrorZ.
15638 void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
15641 * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig`
15642 * but with all dynamically-allocated buffers duplicated in new buffers.
15644 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
15647 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15649 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
15652 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15654 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
15657 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15659 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
15662 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15664 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
15667 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
15669 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
15672 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
15674 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
15677 * Checks if the given object is currently in the success state
15679 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
15682 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
15684 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
15687 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
15688 * but with all dynamically-allocated buffers duplicated in new buffers.
15690 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
15693 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
15695 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
15698 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
15700 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
15703 * Checks if the given object is currently in the success state
15705 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
15708 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
15710 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
15713 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
15714 * but with all dynamically-allocated buffers duplicated in new buffers.
15716 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
15719 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
15721 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
15724 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
15726 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
15729 * Checks if the given object is currently in the success state
15731 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
15734 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
15736 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
15739 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
15740 * but with all dynamically-allocated buffers duplicated in new buffers.
15742 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
15745 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
15747 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
15750 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
15752 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
15755 * Checks if the given object is currently in the success state
15757 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
15760 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
15762 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
15765 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
15766 * but with all dynamically-allocated buffers duplicated in new buffers.
15768 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
15771 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
15773 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
15776 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
15778 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
15781 * Checks if the given object is currently in the success state
15783 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
15786 * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
15788 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
15791 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
15792 * but with all dynamically-allocated buffers duplicated in new buffers.
15794 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
15797 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
15799 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
15802 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
15804 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
15807 * Checks if the given object is currently in the success state
15809 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
15812 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
15814 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
15817 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
15818 * but with all dynamically-allocated buffers duplicated in new buffers.
15820 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
15823 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
15825 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
15828 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
15830 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
15833 * Checks if the given object is currently in the success state
15835 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
15838 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
15840 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
15843 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
15844 * but with all dynamically-allocated buffers duplicated in new buffers.
15846 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
15849 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
15851 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
15854 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
15856 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
15859 * Checks if the given object is currently in the success state
15861 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
15864 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
15866 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
15869 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
15870 * but with all dynamically-allocated buffers duplicated in new buffers.
15872 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
15875 * Creates a new CResult_FundingLockedDecodeErrorZ in the success state.
15877 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o);
15880 * Creates a new CResult_FundingLockedDecodeErrorZ in the error state.
15882 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e);
15885 * Checks if the given object is currently in the success state
15887 bool CResult_FundingLockedDecodeErrorZ_is_ok(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR o);
15890 * Frees any resources used by the CResult_FundingLockedDecodeErrorZ.
15892 void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res);
15895 * Creates a new CResult_FundingLockedDecodeErrorZ which has the same data as `orig`
15896 * but with all dynamically-allocated buffers duplicated in new buffers.
15898 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig);
15901 * Creates a new CResult_InitDecodeErrorZ in the success state.
15903 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
15906 * Creates a new CResult_InitDecodeErrorZ in the error state.
15908 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
15911 * Checks if the given object is currently in the success state
15913 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
15916 * Frees any resources used by the CResult_InitDecodeErrorZ.
15918 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
15921 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
15922 * but with all dynamically-allocated buffers duplicated in new buffers.
15924 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
15927 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
15929 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
15932 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
15934 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
15937 * Checks if the given object is currently in the success state
15939 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
15942 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
15944 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
15947 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
15948 * but with all dynamically-allocated buffers duplicated in new buffers.
15950 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
15953 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
15955 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
15958 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
15960 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
15963 * Checks if the given object is currently in the success state
15965 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
15968 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
15970 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
15973 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
15974 * but with all dynamically-allocated buffers duplicated in new buffers.
15976 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
15979 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
15981 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
15984 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
15986 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
15989 * Checks if the given object is currently in the success state
15991 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
15994 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
15996 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
15999 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
16000 * but with all dynamically-allocated buffers duplicated in new buffers.
16002 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
16005 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
16007 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
16010 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
16012 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16015 * Checks if the given object is currently in the success state
16017 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
16020 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
16022 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
16025 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
16026 * but with all dynamically-allocated buffers duplicated in new buffers.
16028 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
16031 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
16033 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
16036 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
16038 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16041 * Checks if the given object is currently in the success state
16043 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
16046 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
16048 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
16051 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
16052 * but with all dynamically-allocated buffers duplicated in new buffers.
16054 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
16057 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
16059 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
16062 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
16064 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
16067 * Checks if the given object is currently in the success state
16069 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
16072 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
16074 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
16077 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
16078 * but with all dynamically-allocated buffers duplicated in new buffers.
16080 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
16083 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
16085 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
16088 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
16090 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16093 * Checks if the given object is currently in the success state
16095 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
16098 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
16100 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
16103 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
16104 * but with all dynamically-allocated buffers duplicated in new buffers.
16106 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
16109 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
16111 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
16114 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
16116 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16119 * Checks if the given object is currently in the success state
16121 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
16124 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
16126 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
16129 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
16130 * but with all dynamically-allocated buffers duplicated in new buffers.
16132 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
16135 * Creates a new CResult_PingDecodeErrorZ in the success state.
16137 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
16140 * Creates a new CResult_PingDecodeErrorZ in the error state.
16142 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
16145 * Checks if the given object is currently in the success state
16147 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
16150 * Frees any resources used by the CResult_PingDecodeErrorZ.
16152 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
16155 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
16156 * but with all dynamically-allocated buffers duplicated in new buffers.
16158 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
16161 * Creates a new CResult_PongDecodeErrorZ in the success state.
16163 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
16166 * Creates a new CResult_PongDecodeErrorZ in the error state.
16168 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
16171 * Checks if the given object is currently in the success state
16173 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
16176 * Frees any resources used by the CResult_PongDecodeErrorZ.
16178 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
16181 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
16182 * but with all dynamically-allocated buffers duplicated in new buffers.
16184 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
16187 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
16189 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
16192 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
16194 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
16197 * Checks if the given object is currently in the success state
16199 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
16202 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
16204 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
16207 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
16208 * but with all dynamically-allocated buffers duplicated in new buffers.
16210 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
16213 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
16215 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
16218 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
16220 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
16223 * Checks if the given object is currently in the success state
16225 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
16228 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
16230 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
16233 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
16234 * but with all dynamically-allocated buffers duplicated in new buffers.
16236 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
16239 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
16241 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
16244 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
16246 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
16249 * Checks if the given object is currently in the success state
16251 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
16254 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
16256 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
16259 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
16260 * but with all dynamically-allocated buffers duplicated in new buffers.
16262 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
16265 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
16267 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
16270 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
16272 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
16275 * Checks if the given object is currently in the success state
16277 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
16280 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
16282 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
16285 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
16286 * but with all dynamically-allocated buffers duplicated in new buffers.
16288 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
16291 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
16293 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
16296 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
16298 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
16301 * Checks if the given object is currently in the success state
16303 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
16306 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
16308 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
16311 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
16312 * but with all dynamically-allocated buffers duplicated in new buffers.
16314 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
16317 * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
16319 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
16322 * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
16324 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
16327 * Checks if the given object is currently in the success state
16329 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
16332 * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
16334 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
16337 * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
16338 * but with all dynamically-allocated buffers duplicated in new buffers.
16340 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
16343 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
16345 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
16348 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
16350 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
16353 * Checks if the given object is currently in the success state
16355 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
16358 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
16360 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
16363 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
16364 * but with all dynamically-allocated buffers duplicated in new buffers.
16366 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
16369 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
16371 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
16374 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
16376 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
16379 * Checks if the given object is currently in the success state
16381 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
16384 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
16386 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
16389 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
16390 * but with all dynamically-allocated buffers duplicated in new buffers.
16392 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
16395 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
16397 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
16400 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
16402 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
16405 * Checks if the given object is currently in the success state
16407 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
16410 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
16412 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
16415 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
16416 * but with all dynamically-allocated buffers duplicated in new buffers.
16418 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
16421 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
16423 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
16426 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
16428 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
16431 * Checks if the given object is currently in the success state
16433 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
16436 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
16438 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
16441 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
16442 * but with all dynamically-allocated buffers duplicated in new buffers.
16444 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
16447 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
16449 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
16452 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
16454 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
16457 * Checks if the given object is currently in the success state
16459 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
16462 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
16464 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
16467 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
16468 * but with all dynamically-allocated buffers duplicated in new buffers.
16470 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
16473 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
16475 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
16478 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
16480 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
16483 * Checks if the given object is currently in the success state
16485 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
16488 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
16490 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
16493 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
16494 * but with all dynamically-allocated buffers duplicated in new buffers.
16496 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
16499 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
16501 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
16504 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
16506 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
16509 * Checks if the given object is currently in the success state
16511 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
16514 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
16516 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
16519 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
16520 * but with all dynamically-allocated buffers duplicated in new buffers.
16522 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
16525 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16527 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
16530 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state.
16532 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o);
16535 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state.
16537 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
16540 * Checks if the given object is currently in the success state
16542 bool CResult_InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
16545 * Frees any resources used by the CResult_InvoiceSignOrCreationErrorZ.
16547 void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res);
16550 * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig`
16551 * but with all dynamically-allocated buffers duplicated in new buffers.
16553 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
16556 * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
16558 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
16561 * Constructs a new COption_FilterZ containing nothing
16563 struct LDKCOption_FilterZ COption_FilterZ_none(void);
16566 * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
16568 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
16571 * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
16573 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
16576 * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
16578 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
16581 * Checks if the given object is currently in the success state
16583 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
16586 * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
16588 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
16591 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16593 void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res);
16596 * Frees any resources used by the PaymentPurpose
16598 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
16601 * Creates a copy of the PaymentPurpose
16603 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
16606 * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
16608 struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret);
16611 * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
16613 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
16616 * Frees any resources used by the ClosureReason
16618 void ClosureReason_free(struct LDKClosureReason this_ptr);
16621 * Creates a copy of the ClosureReason
16623 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
16626 * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
16628 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKStr peer_msg);
16631 * Utility method to constructs a new HolderForceClosed-variant ClosureReason
16633 struct LDKClosureReason ClosureReason_holder_force_closed(void);
16636 * Utility method to constructs a new CooperativeClosure-variant ClosureReason
16638 struct LDKClosureReason ClosureReason_cooperative_closure(void);
16641 * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
16643 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
16646 * Utility method to constructs a new FundingTimedOut-variant ClosureReason
16648 struct LDKClosureReason ClosureReason_funding_timed_out(void);
16651 * Utility method to constructs a new ProcessingError-variant ClosureReason
16653 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
16656 * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
16658 struct LDKClosureReason ClosureReason_disconnected_peer(void);
16661 * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
16663 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
16666 * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
16668 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
16671 * Read a ClosureReason from a byte array, created by ClosureReason_write
16673 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
16676 * Frees any resources used by the Event
16678 void Event_free(struct LDKEvent this_ptr);
16681 * Creates a copy of the Event
16683 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
16686 * Utility method to constructs a new FundingGenerationReady-variant Event
16688 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);
16691 * Utility method to constructs a new PaymentReceived-variant Event
16693 struct LDKEvent Event_payment_received(struct LDKThirtyTwoBytes payment_hash, uint64_t amt, struct LDKPaymentPurpose purpose);
16696 * Utility method to constructs a new PaymentSent-variant Event
16698 struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
16701 * Utility method to constructs a new PaymentPathFailed-variant Event
16703 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);
16706 * Utility method to constructs a new PaymentFailed-variant Event
16708 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
16711 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
16713 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
16716 * Utility method to constructs a new SpendableOutputs-variant Event
16718 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs);
16721 * Utility method to constructs a new PaymentForwarded-variant Event
16723 struct LDKEvent Event_payment_forwarded(struct LDKCOption_u64Z fee_earned_msat, bool claim_from_onchain_tx);
16726 * Utility method to constructs a new ChannelClosed-variant Event
16728 struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, uint64_t user_channel_id, struct LDKClosureReason reason);
16731 * Utility method to constructs a new DiscardFunding-variant Event
16733 struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
16736 * Utility method to constructs a new PaymentPathSuccessful-variant Event
16738 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path);
16741 * Utility method to constructs a new OpenChannelRequest-variant Event
16743 struct LDKEvent Event_open_channel_request(struct LDKThirtyTwoBytes temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t funding_satoshis, uint64_t push_msat, struct LDKChannelTypeFeatures channel_type);
16746 * Serialize the Event object into a byte array which can be read by Event_read
16748 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
16751 * Read a Event from a byte array, created by Event_write
16753 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
16756 * Frees any resources used by the MessageSendEvent
16758 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
16761 * Creates a copy of the MessageSendEvent
16763 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
16766 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
16768 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
16771 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
16773 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
16776 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
16778 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
16781 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
16783 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
16786 * Utility method to constructs a new SendFundingLocked-variant MessageSendEvent
16788 struct LDKMessageSendEvent MessageSendEvent_send_funding_locked(struct LDKPublicKey node_id, struct LDKFundingLocked msg);
16791 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
16793 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
16796 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
16798 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
16801 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
16803 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
16806 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
16808 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
16811 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
16813 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
16816 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
16818 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
16821 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
16823 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
16826 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
16828 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
16831 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
16833 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
16836 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
16838 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
16841 * Utility method to constructs a new HandleError-variant MessageSendEvent
16843 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
16846 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
16848 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
16851 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
16853 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
16856 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
16858 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
16861 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
16863 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
16866 * Calls the free function if one is set
16868 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
16871 * Calls the free function if one is set
16873 void EventsProvider_free(struct LDKEventsProvider this_ptr);
16876 * Calls the free function if one is set
16878 void EventHandler_free(struct LDKEventHandler this_ptr);
16881 * Frees any resources used by the APIError
16883 void APIError_free(struct LDKAPIError this_ptr);
16886 * Creates a copy of the APIError
16888 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
16891 * Utility method to constructs a new APIMisuseError-variant APIError
16893 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
16896 * Utility method to constructs a new FeeRateTooHigh-variant APIError
16898 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
16901 * Utility method to constructs a new RouteError-variant APIError
16903 struct LDKAPIError APIError_route_error(struct LDKStr err);
16906 * Utility method to constructs a new ChannelUnavailable-variant APIError
16908 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
16911 * Utility method to constructs a new MonitorUpdateFailed-variant APIError
16913 struct LDKAPIError APIError_monitor_update_failed(void);
16916 * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
16918 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
16921 * Creates a digital signature of a message given a SecretKey, like the node's secret.
16922 * 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.
16923 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
16925 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
16928 * Recovers the PublicKey of the signer of the message given the message and the signature.
16930 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
16933 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
16934 * and the PublicKey.
16936 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
16939 * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
16941 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_u5Z data_without_signature);
16944 * Creates a copy of the Level
16946 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
16949 * Utility method to constructs a new Gossip-variant Level
16951 enum LDKLevel Level_gossip(void);
16954 * Utility method to constructs a new Trace-variant Level
16956 enum LDKLevel Level_trace(void);
16959 * Utility method to constructs a new Debug-variant Level
16961 enum LDKLevel Level_debug(void);
16964 * Utility method to constructs a new Info-variant Level
16966 enum LDKLevel Level_info(void);
16969 * Utility method to constructs a new Warn-variant Level
16971 enum LDKLevel Level_warn(void);
16974 * Utility method to constructs a new Error-variant Level
16976 enum LDKLevel Level_error(void);
16979 * Checks if two Levels contain equal inner contents.
16980 * This ignores pointers and is_owned flags and looks at the values in fields.
16982 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
16985 * Checks if two Levels contain equal inner contents.
16987 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
16990 * Returns the most verbose logging level.
16992 MUST_USE_RES enum LDKLevel Level_max(void);
16995 * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
16997 void Record_free(struct LDKRecord this_obj);
17000 * The verbosity level of the message.
17002 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
17005 * The verbosity level of the message.
17007 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
17010 * The message body.
17012 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
17015 * The message body.
17017 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
17020 * The module path of the message.
17022 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
17025 * The module path of the message.
17027 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
17030 * The source file containing the message.
17032 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
17035 * The source file containing the message.
17037 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
17040 * The line containing the message.
17042 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
17045 * The line containing the message.
17047 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
17050 * Creates a copy of the Record
17052 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
17055 * Calls the free function if one is set
17057 void Logger_free(struct LDKLogger this_ptr);
17060 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
17062 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
17065 * Confirmations we will wait for before considering the channel locked in.
17066 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
17067 * equivalent limit applied to outbound channels).
17069 * Default value: 6.
17071 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
17074 * Confirmations we will wait for before considering the channel locked in.
17075 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
17076 * equivalent limit applied to outbound channels).
17078 * Default value: 6.
17080 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
17083 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
17084 * the number of blocks we have to punish our counterparty if they broadcast a revoked
17087 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
17088 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
17089 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
17090 * possibly with time in between to RBF the spending transaction).
17092 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
17093 * case of an honest unilateral channel close, which implicitly decrease the economic value of
17096 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
17097 * can tweak config to ask for more security, not less.
17099 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
17102 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
17103 * the number of blocks we have to punish our counterparty if they broadcast a revoked
17106 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
17107 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
17108 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
17109 * possibly with time in between to RBF the spending transaction).
17111 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
17112 * case of an honest unilateral channel close, which implicitly decrease the economic value of
17115 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
17116 * can tweak config to ask for more security, not less.
17118 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
17121 * Set to the smallest value HTLC we will accept to process.
17123 * This value is sent to our counterparty on channel-open and we close the channel any time
17124 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
17126 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
17129 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
17132 * Set to the smallest value HTLC we will accept to process.
17134 * This value is sent to our counterparty on channel-open and we close the channel any time
17135 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
17137 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
17140 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
17143 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
17144 * BOLTs) option for outbound private channels. This provides better privacy by not including
17145 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
17146 * relay HTLCs to us using the channel's SCID alias.
17148 * If this option is set, channels may be created that will not be readable by LDK versions
17149 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
17150 * [`DecodeError:InvalidValue`].
17152 * Note that setting this to true does *not* prevent us from opening channels with
17153 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
17154 * private channel without that option.
17156 * Ignored if the channel is negotiated to be announced, see
17157 * [`ChannelConfig::announced_channel`] and
17158 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
17160 * Default value: false. This value is likely to change to true in the future.
17162 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17163 * [`DecodeError:InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
17165 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
17168 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
17169 * BOLTs) option for outbound private channels. This provides better privacy by not including
17170 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
17171 * relay HTLCs to us using the channel's SCID alias.
17173 * If this option is set, channels may be created that will not be readable by LDK versions
17174 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
17175 * [`DecodeError:InvalidValue`].
17177 * Note that setting this to true does *not* prevent us from opening channels with
17178 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
17179 * private channel without that option.
17181 * Ignored if the channel is negotiated to be announced, see
17182 * [`ChannelConfig::announced_channel`] and
17183 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
17185 * Default value: false. This value is likely to change to true in the future.
17187 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17188 * [`DecodeError:InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
17190 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
17193 * Constructs a new ChannelHandshakeConfig given each field
17195 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, bool negotiate_scid_privacy_arg);
17198 * Creates a copy of the ChannelHandshakeConfig
17200 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
17203 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
17205 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
17208 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
17210 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
17213 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
17214 * only applies to inbound channels.
17216 * Default value: 0.
17218 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17221 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
17222 * only applies to inbound channels.
17224 * Default value: 0.
17226 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17229 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
17230 * you to limit the maximum minimum-size they can require.
17232 * Default value: u64::max_value.
17234 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17237 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
17238 * you to limit the maximum minimum-size they can require.
17240 * Default value: u64::max_value.
17242 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17245 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
17246 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
17248 * Default value: 0.
17250 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17253 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
17254 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
17256 * Default value: 0.
17258 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17261 * The remote node will require we keep a certain amount in direct payment to ourselves at all
17262 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
17263 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
17265 * Default value: u64::max_value.
17267 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17270 * The remote node will require we keep a certain amount in direct payment to ourselves at all
17271 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
17272 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
17274 * Default value: u64::max_value.
17276 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
17279 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
17280 * time. This allows you to set a minimum such value.
17282 * Default value: 0.
17284 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17287 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
17288 * time. This allows you to set a minimum such value.
17290 * Default value: 0.
17292 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
17295 * Before a channel is usable the funding transaction will need to be confirmed by at least a
17296 * certain number of blocks, specified by the node which is not the funder (as the funder can
17297 * assume they aren't going to double-spend themselves).
17298 * This config allows you to set a limit on the maximum amount of time to wait.
17300 * Default value: 144, or roughly one day and only applies to outbound channels.
17302 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17305 * Before a channel is usable the funding transaction will need to be confirmed by at least a
17306 * certain number of blocks, specified by the node which is not the funder (as the funder can
17307 * assume they aren't going to double-spend themselves).
17308 * This config allows you to set a limit on the maximum amount of time to wait.
17310 * Default value: 144, or roughly one day and only applies to outbound channels.
17312 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
17315 * Set to force an incoming channel to match our announced channel preference in
17316 * [`ChannelConfig::announced_channel`].
17318 * For a node which is not online reliably, this should be set to true and
17319 * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public)
17320 * channels will ever be opened.
17322 * Default value: true.
17324 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17327 * Set to force an incoming channel to match our announced channel preference in
17328 * [`ChannelConfig::announced_channel`].
17330 * For a node which is not online reliably, this should be set to true and
17331 * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public)
17332 * channels will ever be opened.
17334 * Default value: true.
17336 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
17339 * Set to the amount of time we're willing to wait to claim money back to us.
17341 * Not checking this value would be a security issue, as our peer would be able to set it to
17342 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
17344 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
17345 * reduce the loss of having useless locked funds (if your peer accepts)
17347 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
17350 * Set to the amount of time we're willing to wait to claim money back to us.
17352 * Not checking this value would be a security issue, as our peer would be able to set it to
17353 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
17355 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
17356 * reduce the loss of having useless locked funds (if your peer accepts)
17358 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
17361 * Constructs a new ChannelHandshakeLimits given each field
17363 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);
17366 * Creates a copy of the ChannelHandshakeLimits
17368 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
17371 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
17373 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
17376 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
17378 void ChannelConfig_free(struct LDKChannelConfig this_obj);
17381 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
17382 * over the channel.
17383 * This may be allowed to change at runtime in a later update, however doing so must result in
17384 * update messages sent to notify all nodes of our updated relay fee.
17386 * Default value: 0.
17388 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
17391 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
17392 * over the channel.
17393 * This may be allowed to change at runtime in a later update, however doing so must result in
17394 * update messages sent to notify all nodes of our updated relay fee.
17396 * Default value: 0.
17398 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
17401 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
17402 * excess of [`forwarding_fee_proportional_millionths`].
17403 * This may be allowed to change at runtime in a later update, however doing so must result in
17404 * update messages sent to notify all nodes of our updated relay fee.
17406 * The default value of a single satoshi roughly matches the market rate on many routing nodes
17407 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
17410 * Default value: 1000.
17412 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
17414 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
17417 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
17418 * excess of [`forwarding_fee_proportional_millionths`].
17419 * This may be allowed to change at runtime in a later update, however doing so must result in
17420 * update messages sent to notify all nodes of our updated relay fee.
17422 * The default value of a single satoshi roughly matches the market rate on many routing nodes
17423 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
17426 * Default value: 1000.
17428 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
17430 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
17433 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
17434 * the channel this config applies to.
17436 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
17437 * HTLC balance when a channel appears on-chain whereas
17438 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
17439 * (non-HTLC-encumbered) balance.
17441 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
17442 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
17443 * commitment transaction at least once per this many blocks (minus some margin to allow us
17444 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
17445 * the spending transaction).
17447 * Default value: 72 (12 hours at an average of 6 blocks/hour).
17448 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
17449 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
17451 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
17453 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
17456 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
17457 * the channel this config applies to.
17459 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
17460 * HTLC balance when a channel appears on-chain whereas
17461 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
17462 * (non-HTLC-encumbered) balance.
17464 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
17465 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
17466 * commitment transaction at least once per this many blocks (minus some margin to allow us
17467 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
17468 * the spending transaction).
17470 * Default value: 72 (12 hours at an average of 6 blocks/hour).
17471 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
17472 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
17474 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
17476 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
17479 * Set to announce the channel publicly and notify all nodes that they can route via this
17482 * This should only be set to true for nodes which expect to be online reliably.
17484 * As the node which funds a channel picks this value this will only apply for new outbound
17485 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
17487 * This cannot be changed after the initial channel handshake.
17489 * Default value: false.
17491 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
17494 * Set to announce the channel publicly and notify all nodes that they can route via this
17497 * This should only be set to true for nodes which expect to be online reliably.
17499 * As the node which funds a channel picks this value this will only apply for new outbound
17500 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
17502 * This cannot be changed after the initial channel handshake.
17504 * Default value: false.
17506 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
17509 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
17510 * supports it, they will then enforce the mutual-close output to us matches what we provided
17511 * at intialization, preventing us from closing to an alternate pubkey.
17513 * This is set to true by default to provide a slight increase in security, though ultimately
17514 * any attacker who is able to take control of a channel can just as easily send the funds via
17515 * lightning payments, so we never require that our counterparties support this option.
17517 * This cannot be changed after a channel has been initialized.
17519 * Default value: true.
17521 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
17524 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
17525 * supports it, they will then enforce the mutual-close output to us matches what we provided
17526 * at intialization, preventing us from closing to an alternate pubkey.
17528 * This is set to true by default to provide a slight increase in security, though ultimately
17529 * any attacker who is able to take control of a channel can just as easily send the funds via
17530 * lightning payments, so we never require that our counterparties support this option.
17532 * This cannot be changed after a channel has been initialized.
17534 * Default value: true.
17536 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
17539 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
17540 * small to claim on-chain.
17542 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
17543 * not be claimable on-chain, instead being turned into additional miner fees if either
17544 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
17545 * to such payments may be sustantial if there are many dust HTLCs present when the
17546 * channel is force-closed.
17548 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
17549 * exposure across all three types per-channel. Setting this too low may prevent the
17550 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
17551 * important to prevent stealing of dust HTLCs by miners.
17553 * Default value: 5_000_000 msat.
17555 uint64_t ChannelConfig_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
17558 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
17559 * small to claim on-chain.
17561 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
17562 * not be claimable on-chain, instead being turned into additional miner fees if either
17563 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
17564 * to such payments may be sustantial if there are many dust HTLCs present when the
17565 * channel is force-closed.
17567 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
17568 * exposure across all three types per-channel. Setting this too low may prevent the
17569 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
17570 * important to prevent stealing of dust HTLCs by miners.
17572 * Default value: 5_000_000 msat.
17574 void ChannelConfig_set_max_dust_htlc_exposure_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
17577 * The additional fee we're willing to pay to avoid waiting for the counterparty's
17578 * `to_self_delay` to reclaim funds.
17580 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
17581 * closing transaction which both sides find acceptable, ultimately paid by the channel
17582 * funder/initiator.
17584 * When we are the funder, because we have to pay the channel closing fee, we bound the
17585 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
17586 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
17587 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
17588 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
17591 * When we are not the funder, we require the closing transaction fee pay at least our
17592 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
17593 * Thus, this value is ignored when we are not the funder.
17595 * Default value: 1000 satoshis.
17597 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
17598 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
17600 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
17603 * The additional fee we're willing to pay to avoid waiting for the counterparty's
17604 * `to_self_delay` to reclaim funds.
17606 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
17607 * closing transaction which both sides find acceptable, ultimately paid by the channel
17608 * funder/initiator.
17610 * When we are the funder, because we have to pay the channel closing fee, we bound the
17611 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
17612 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
17613 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
17614 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
17617 * When we are not the funder, we require the closing transaction fee pay at least our
17618 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
17619 * Thus, this value is ignored when we are not the funder.
17621 * Default value: 1000 satoshis.
17623 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
17624 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
17626 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
17629 * Constructs a new ChannelConfig given each field
17631 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);
17634 * Creates a copy of the ChannelConfig
17636 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
17639 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
17641 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
17644 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
17646 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
17649 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
17651 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
17654 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
17656 void UserConfig_free(struct LDKUserConfig this_obj);
17659 * Channel config that we propose to our counterparty.
17661 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
17664 * Channel config that we propose to our counterparty.
17666 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
17669 * Limits applied to our counterparty's proposed channel config settings.
17671 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
17674 * Limits applied to our counterparty's proposed channel config settings.
17676 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
17679 * Channel config which affects behavior during channel lifetime.
17681 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
17684 * Channel config which affects behavior during channel lifetime.
17686 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
17689 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
17690 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
17691 * node which is not online reliably.
17693 * For nodes which are not online reliably, you should set all channels to *not* be announced
17694 * (using [`ChannelConfig::announced_channel`] and
17695 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
17696 * ensure you are not exposed to any forwarding risk.
17698 * Note that because you cannot change a channel's announced state after creation, there is no
17699 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
17700 * from a publicly-announced forwarding node to a private non-forwarding node you must close
17701 * all your channels and open new ones. For privacy, you should also change your node_id
17702 * (swapping all private and public key material for new ones) at that time.
17704 * Default value: false.
17706 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
17709 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
17710 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
17711 * node which is not online reliably.
17713 * For nodes which are not online reliably, you should set all channels to *not* be announced
17714 * (using [`ChannelConfig::announced_channel`] and
17715 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
17716 * ensure you are not exposed to any forwarding risk.
17718 * Note that because you cannot change a channel's announced state after creation, there is no
17719 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
17720 * from a publicly-announced forwarding node to a private non-forwarding node you must close
17721 * all your channels and open new ones. For privacy, you should also change your node_id
17722 * (swapping all private and public key material for new ones) at that time.
17724 * Default value: false.
17726 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
17729 * If this is set to false, we do not accept inbound requests to open a new channel.
17730 * Default value: true.
17732 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
17735 * If this is set to false, we do not accept inbound requests to open a new channel.
17736 * Default value: true.
17738 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
17741 * If this is set to true, the user needs to manually accept inbound requests to open a new
17744 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
17745 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
17746 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
17747 * user explicitly chooses to accept the request.
17749 * Default value: false.
17751 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
17752 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
17753 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
17755 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
17758 * If this is set to true, the user needs to manually accept inbound requests to open a new
17761 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
17762 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
17763 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
17764 * user explicitly chooses to accept the request.
17766 * Default value: false.
17768 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
17769 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
17770 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
17772 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
17775 * Constructs a new UserConfig given each field
17777 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);
17780 * Creates a copy of the UserConfig
17782 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
17785 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
17787 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
17790 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
17792 void BestBlock_free(struct LDKBestBlock this_obj);
17795 * Creates a copy of the BestBlock
17797 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
17800 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
17803 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
17806 * Returns a `BestBlock` as identified by the given block hash and height.
17808 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
17811 * Returns the best block hash.
17813 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
17816 * Returns the best block height.
17818 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
17821 * Creates a copy of the AccessError
17823 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
17826 * Utility method to constructs a new UnknownChain-variant AccessError
17828 enum LDKAccessError AccessError_unknown_chain(void);
17831 * Utility method to constructs a new UnknownTx-variant AccessError
17833 enum LDKAccessError AccessError_unknown_tx(void);
17836 * Calls the free function if one is set
17838 void Access_free(struct LDKAccess this_ptr);
17841 * Calls the free function if one is set
17843 void Listen_free(struct LDKListen this_ptr);
17846 * Calls the free function if one is set
17848 void Confirm_free(struct LDKConfirm this_ptr);
17851 * Creates a copy of the ChannelMonitorUpdateErr
17853 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
17856 * Utility method to constructs a new TemporaryFailure-variant ChannelMonitorUpdateErr
17858 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_temporary_failure(void);
17861 * Utility method to constructs a new PermanentFailure-variant ChannelMonitorUpdateErr
17863 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_permanent_failure(void);
17866 * Calls the free function if one is set
17868 void Watch_free(struct LDKWatch this_ptr);
17871 * Calls the free function if one is set
17873 void Filter_free(struct LDKFilter this_ptr);
17876 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
17878 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
17881 * First block where the transaction output may have been spent.
17883 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
17885 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
17888 * First block where the transaction output may have been spent.
17890 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
17892 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
17895 * Outpoint identifying the transaction output.
17897 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
17900 * Outpoint identifying the transaction output.
17902 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
17905 * Spending condition of the transaction output.
17907 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
17910 * Spending condition of the transaction output.
17912 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
17915 * Constructs a new WatchedOutput given each field
17917 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
17920 * Creates a copy of the WatchedOutput
17922 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
17925 * Checks if two WatchedOutputs contain equal inner contents.
17927 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
17930 * Calls the free function if one is set
17932 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
17935 * Creates a copy of the ConfirmationTarget
17937 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
17940 * Utility method to constructs a new Background-variant ConfirmationTarget
17942 enum LDKConfirmationTarget ConfirmationTarget_background(void);
17945 * Utility method to constructs a new Normal-variant ConfirmationTarget
17947 enum LDKConfirmationTarget ConfirmationTarget_normal(void);
17950 * Utility method to constructs a new HighPriority-variant ConfirmationTarget
17952 enum LDKConfirmationTarget ConfirmationTarget_high_priority(void);
17955 * Checks if two ConfirmationTargets contain equal inner contents.
17956 * This ignores pointers and is_owned flags and looks at the values in fields.
17958 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
17961 * Calls the free function if one is set
17963 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
17966 * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
17968 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
17971 * Creates a copy of the MonitorUpdateId
17973 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
17976 * Checks if two MonitorUpdateIds contain equal inner contents.
17978 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
17981 * Checks if two MonitorUpdateIds contain equal inner contents.
17982 * This ignores pointers and is_owned flags and looks at the values in fields.
17983 * Two objects with NULL inner values will be considered "equal" here.
17985 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
17988 * Calls the free function if one is set
17990 void Persist_free(struct LDKPersist this_ptr);
17993 * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
17995 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
17998 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
18000 void ChainMonitor_free(struct LDKChainMonitor this_obj);
18003 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
18005 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
18006 * will call back to it indicating transactions and outputs of interest. This allows clients to
18007 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
18008 * always need to fetch full blocks absent another means for determining which blocks contain
18009 * transactions relevant to the watched channels.
18011 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
18014 * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
18015 * claims which are awaiting confirmation.
18017 * Includes the balances from each [`ChannelMonitor`] *except* those included in
18018 * `ignored_channels`, allowing you to filter out balances from channels which are still open
18019 * (and whose balance should likely be pulled from the [`ChannelDetails`]).
18021 * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
18022 * inclusion in the return value.
18024 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
18027 * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
18028 * such [`ChannelMonitor`] is currently being monitored for.
18030 * Note that the result holds a mutex over our monitor set, and should not be held
18033 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
18036 * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
18038 * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
18039 * monitoring for on-chain state resolutions.
18041 MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
18044 * Indicates the persistence of a [`ChannelMonitor`] has completed after
18045 * [`ChannelMonitorUpdateErr::TemporaryFailure`] was returned from an update operation.
18047 * Thus, the anticipated use is, at a high level:
18048 * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
18049 * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
18050 * returning [`ChannelMonitorUpdateErr::TemporaryFailure`],
18051 * 2) once all remote copies are updated, you call this function with the
18052 * `completed_update_id` that completed, and once all pending updates have completed the
18053 * channel will be re-enabled.
18055 * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
18056 * registered [`ChannelMonitor`]s.
18058 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);
18061 * Constructs a new Listen which calls the relevant methods on this_arg.
18062 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
18064 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
18067 * Constructs a new Confirm which calls the relevant methods on this_arg.
18068 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
18070 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
18073 * Constructs a new Watch which calls the relevant methods on this_arg.
18074 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
18076 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
18079 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
18080 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
18082 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
18085 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
18087 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
18090 * The sequence number of this update. Updates *must* be replayed in-order according to this
18091 * sequence number (and updates may panic if they are not). The update_id values are strictly
18092 * increasing and increase by one for each new update, with one exception specified below.
18094 * This sequence number is also used to track up to which points updates which returned
18095 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
18096 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
18098 * The only instance where update_id values are not strictly increasing is the case where we
18099 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
18100 * its docs for more details.
18102 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
18105 * The sequence number of this update. Updates *must* be replayed in-order according to this
18106 * sequence number (and updates may panic if they are not). The update_id values are strictly
18107 * increasing and increase by one for each new update, with one exception specified below.
18109 * This sequence number is also used to track up to which points updates which returned
18110 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
18111 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
18113 * The only instance where update_id values are not strictly increasing is the case where we
18114 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
18115 * its docs for more details.
18117 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
18120 * Creates a copy of the ChannelMonitorUpdate
18122 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
18125 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
18127 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
18130 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
18132 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
18135 * Frees any resources used by the MonitorEvent
18137 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
18140 * Creates a copy of the MonitorEvent
18142 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
18145 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
18147 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
18150 * Utility method to constructs a new CommitmentTxConfirmed-variant MonitorEvent
18152 struct LDKMonitorEvent MonitorEvent_commitment_tx_confirmed(struct LDKOutPoint a);
18155 * Utility method to constructs a new UpdateCompleted-variant MonitorEvent
18157 struct LDKMonitorEvent MonitorEvent_update_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
18160 * Utility method to constructs a new UpdateFailed-variant MonitorEvent
18162 struct LDKMonitorEvent MonitorEvent_update_failed(struct LDKOutPoint a);
18165 * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
18167 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
18170 * Read a MonitorEvent from a byte array, created by MonitorEvent_write
18172 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
18175 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
18177 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
18180 * Creates a copy of the HTLCUpdate
18182 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
18185 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
18187 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
18190 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
18192 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
18195 * Frees any resources used by the Balance
18197 void Balance_free(struct LDKBalance this_ptr);
18200 * Creates a copy of the Balance
18202 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
18205 * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
18207 struct LDKBalance Balance_claimable_on_channel_close(uint64_t claimable_amount_satoshis);
18210 * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
18212 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t claimable_amount_satoshis, uint32_t confirmation_height);
18215 * Utility method to constructs a new ContentiousClaimable-variant Balance
18217 struct LDKBalance Balance_contentious_claimable(uint64_t claimable_amount_satoshis, uint32_t timeout_height);
18220 * Utility method to constructs a new MaybeClaimableHTLCAwaitingTimeout-variant Balance
18222 struct LDKBalance Balance_maybe_claimable_htlcawaiting_timeout(uint64_t claimable_amount_satoshis, uint32_t claimable_height);
18225 * Checks if two Balances contain equal inner contents.
18226 * This ignores pointers and is_owned flags and looks at the values in fields.
18228 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
18231 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
18233 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
18236 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
18238 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
18241 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
18244 * panics if the given update is not the next update by update_id.
18246 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);
18249 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
18252 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18255 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
18257 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18260 * Gets a list of txids, with their output scripts (in the order they appear in the
18261 * transaction), which we must learn about spends of via block_connected().
18263 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18266 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
18267 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
18268 * have been registered.
18270 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
18273 * Get the list of HTLCs who's status has been updated on chain. This should be called by
18274 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
18276 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18279 * Gets the list of pending events which were generated by previous actions, clearing the list
18282 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
18283 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
18284 * no internal locking in ChannelMonitors.
18286 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18289 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
18290 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
18291 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
18292 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
18293 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
18294 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
18295 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
18296 * out-of-band the other node operator to coordinate with him if option is available to you.
18297 * In any-case, choice is up to the user.
18299 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);
18302 * Processes transactions in a newly connected block, which may result in any of the following:
18303 * - update the monitor's state against resolved HTLCs
18304 * - punish the counterparty in the case of seeing a revoked commitment transaction
18305 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
18306 * - detect settled outputs for later spending
18307 * - schedule and bump any in-flight claims
18309 * Returns any new outputs to watch from `txdata`; after called, these are also included in
18310 * [`get_outputs_to_watch`].
18312 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
18314 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);
18317 * Determines if the disconnected block contained any transactions of interest and updates
18320 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);
18323 * Processes transactions confirmed in a block with the given header and height, returning new
18324 * outputs to watch. See [`block_connected`] for details.
18326 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
18327 * blocks. See [`chain::Confirm`] for calling expectations.
18329 * [`block_connected`]: Self::block_connected
18331 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);
18334 * Processes a transaction that was reorganized out of the chain.
18336 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
18337 * than blocks. See [`chain::Confirm`] for calling expectations.
18339 * [`block_disconnected`]: Self::block_disconnected
18341 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);
18344 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
18345 * [`block_connected`] for details.
18347 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
18348 * blocks. See [`chain::Confirm`] for calling expectations.
18350 * [`block_connected`]: Self::block_connected
18352 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);
18355 * Returns the set of txids that should be monitored for re-organization out of the chain.
18357 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18360 * Gets the latest best block which was connected either via the [`chain::Listen`] or
18361 * [`chain::Confirm`] interfaces.
18363 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18366 * Gets the balances in this channel which are either claimable by us if we were to
18367 * force-close the channel now or which are claimable on-chain (possibly awaiting
18370 * Any balances in the channel which are available on-chain (excluding on-chain fees) are
18371 * included here until an [`Event::SpendableOutputs`] event has been generated for the
18372 * balance, or until our counterparty has claimed the balance and accrued several
18373 * confirmations on the claim transaction.
18375 * Note that the balances available when you or your counterparty have broadcasted revoked
18376 * state(s) may not be fully captured here.
18378 * See [`Balance`] for additional details on the types of claimable balances which
18379 * may be returned here and their meanings.
18381 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
18384 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
18386 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
18389 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
18391 void OutPoint_free(struct LDKOutPoint this_obj);
18394 * The referenced transaction's txid.
18396 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
18399 * The referenced transaction's txid.
18401 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18404 * The index of the referenced output in its transaction's vout.
18406 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
18409 * The index of the referenced output in its transaction's vout.
18411 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
18414 * Constructs a new OutPoint given each field
18416 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
18419 * Creates a copy of the OutPoint
18421 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
18424 * Checks if two OutPoints contain equal inner contents.
18425 * This ignores pointers and is_owned flags and looks at the values in fields.
18426 * Two objects with NULL inner values will be considered "equal" here.
18428 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
18431 * Checks if two OutPoints contain equal inner contents.
18433 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
18436 * Convert an `OutPoint` to a lightning channel id.
18438 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
18441 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
18443 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
18446 * Read a OutPoint from a byte array, created by OutPoint_write
18448 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
18451 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
18453 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
18456 * The outpoint which is spendable
18458 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
18461 * The outpoint which is spendable
18463 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
18466 * Per commitment point to derive delayed_payment_key by key holder
18468 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
18471 * Per commitment point to derive delayed_payment_key by key holder
18473 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
18476 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
18477 * the witness_script.
18479 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
18482 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
18483 * the witness_script.
18485 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
18488 * The output which is referenced by the given outpoint
18490 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
18493 * The revocation point specific to the commitment transaction which was broadcast. Used to
18494 * derive the witnessScript for this output.
18496 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
18499 * The revocation point specific to the commitment transaction which was broadcast. Used to
18500 * derive the witnessScript for this output.
18502 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
18505 * Arbitrary identification information returned by a call to
18506 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
18507 * the channel to spend the output.
18509 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
18512 * Arbitrary identification information returned by a call to
18513 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
18514 * the channel to spend the output.
18516 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18519 * The value of the channel which this output originated from, possibly indirectly.
18521 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
18524 * The value of the channel which this output originated from, possibly indirectly.
18526 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
18529 * Constructs a new DelayedPaymentOutputDescriptor given each field
18531 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);
18534 * Creates a copy of the DelayedPaymentOutputDescriptor
18536 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
18539 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
18541 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
18544 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
18546 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
18549 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
18551 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
18554 * The outpoint which is spendable
18556 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
18559 * The outpoint which is spendable
18561 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
18564 * The output which is referenced by the given outpoint
18566 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
18569 * Arbitrary identification information returned by a call to
18570 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
18571 * the channel to spend the output.
18573 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
18576 * Arbitrary identification information returned by a call to
18577 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
18578 * the channel to spend the output.
18580 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18583 * The value of the channel which this transactions spends.
18585 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
18588 * The value of the channel which this transactions spends.
18590 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
18593 * Constructs a new StaticPaymentOutputDescriptor given each field
18595 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);
18598 * Creates a copy of the StaticPaymentOutputDescriptor
18600 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
18603 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
18605 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
18608 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
18610 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
18613 * Frees any resources used by the SpendableOutputDescriptor
18615 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
18618 * Creates a copy of the SpendableOutputDescriptor
18620 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
18623 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
18625 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
18628 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
18630 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
18633 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
18635 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
18638 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
18640 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
18643 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
18645 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
18648 * Calls the free function if one is set
18650 void BaseSign_free(struct LDKBaseSign this_ptr);
18653 * Creates a copy of a Sign
18655 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
18658 * Calls the free function if one is set
18660 void Sign_free(struct LDKSign this_ptr);
18663 * Creates a copy of the Recipient
18665 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
18668 * Utility method to constructs a new Node-variant Recipient
18670 enum LDKRecipient Recipient_node(void);
18673 * Utility method to constructs a new PhantomNode-variant Recipient
18675 enum LDKRecipient Recipient_phantom_node(void);
18678 * Calls the free function if one is set
18680 void KeysInterface_free(struct LDKKeysInterface this_ptr);
18683 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
18685 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
18688 * Private key of anchor tx
18690 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
18693 * Private key of anchor tx
18695 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
18698 * Holder secret key for blinded revocation pubkey
18700 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
18703 * Holder secret key for blinded revocation pubkey
18705 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
18708 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
18710 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
18713 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
18715 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
18718 * Holder secret key used in HTLC tx
18720 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
18723 * Holder secret key used in HTLC tx
18725 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
18728 * Holder htlc secret key used in commitment tx htlc outputs
18730 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
18733 * Holder htlc secret key used in commitment tx htlc outputs
18735 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
18740 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
18745 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18748 * Creates a copy of the InMemorySigner
18750 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
18753 * Create a new InMemorySigner
18755 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);
18758 * Counterparty pubkeys.
18759 * Will panic if ready_channel wasn't called.
18761 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
18764 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
18765 * transactions, ie the amount of time that we have to wait to recover our funds if we
18766 * broadcast a transaction.
18767 * Will panic if ready_channel wasn't called.
18769 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
18772 * The contest_delay value specified by us and applied on transactions broadcastable
18773 * by our counterparty, ie the amount of time that they have to wait to recover their funds
18774 * if they broadcast a transaction.
18775 * Will panic if ready_channel wasn't called.
18777 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
18780 * Whether the holder is the initiator
18781 * Will panic if ready_channel wasn't called.
18783 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
18787 * Will panic if ready_channel wasn't called.
18789 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
18792 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
18793 * building transactions.
18795 * Will panic if ready_channel wasn't called.
18797 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
18800 * Whether anchors should be used.
18801 * Will panic if ready_channel wasn't called.
18803 MUST_USE_RES bool InMemorySigner_opt_anchors(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
18806 * Sign the single input of spend_tx at index `input_idx` which spends the output
18807 * described by descriptor, returning the witness stack for the input.
18809 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
18810 * is not spending the outpoint described by `descriptor.outpoint`,
18811 * or if an output descriptor script_pubkey does not match the one we can spend.
18813 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);
18816 * Sign the single input of spend_tx at index `input_idx` which spends the output
18817 * described by descriptor, returning the witness stack for the input.
18819 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
18820 * is not spending the outpoint described by `descriptor.outpoint`, does not have a
18821 * sequence set to `descriptor.to_self_delay`, or if an output descriptor
18822 * script_pubkey does not match the one we can spend.
18824 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);
18827 * Constructs a new BaseSign which calls the relevant methods on this_arg.
18828 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
18830 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
18833 * Constructs a new Sign which calls the relevant methods on this_arg.
18834 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
18836 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
18839 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
18841 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
18844 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
18846 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKSecretKey arg);
18849 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
18851 void KeysManager_free(struct LDKKeysManager this_obj);
18854 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
18855 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
18856 * starting_time isn't strictly required to actually be a time, but it must absolutely,
18857 * without a doubt, be unique to this instance. ie if you start multiple times with the same
18858 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
18859 * simply use the current time (with very high precision).
18861 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
18862 * obviously, starting_time should be unique every time you reload the library - it is only
18863 * used to generate new ephemeral key data (which will be stored by the individual channel if
18866 * Note that the seed is required to recover certain on-chain funds independent of
18867 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
18868 * channel, and some on-chain during-closing funds.
18870 * Note that until the 0.1 release there is no guarantee of backward compatibility between
18871 * versions. Once the library is more fully supported, the docs will be updated to include a
18872 * detailed description of the guarantee.
18874 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
18877 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
18879 * Key derivation parameters are accessible through a per-channel secrets
18880 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
18881 * onchain output detection for which a corresponding delayed_payment_key must be derived.
18883 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]);
18886 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
18887 * output to the given change destination (if sufficient change value remains). The
18888 * transaction will have a feerate, at least, of the given value.
18890 * Returns `Err(())` if the output value is greater than the input value minus required fee,
18891 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
18892 * does not match the one we can spend.
18894 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
18896 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
18897 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
18899 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);
18902 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
18903 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
18905 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
18908 * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
18910 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
18913 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
18914 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
18916 struct LDKKeysInterface PhantomKeysManager_as_KeysInterface(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
18919 * Constructs a `PhantomKeysManager` given a 32-byte seed and an additional `cross_node_seed`
18920 * that is shared across all nodes that intend to participate in [phantom node payments] together.
18922 * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
18923 * `starting_time_nanos`.
18925 * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
18926 * same across restarts, or else inbound payments may fail.
18928 * [phantom node payments]: PhantomKeysManager
18930 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]);
18933 * See [`KeysManager::spend_spendable_outputs`] for documentation on this method.
18935 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);
18938 * See [`KeysManager::derive_channel_keys`] for documentation on this method.
18940 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]);
18943 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
18945 void ChannelManager_free(struct LDKChannelManager this_obj);
18948 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
18950 void ChainParameters_free(struct LDKChainParameters this_obj);
18953 * The network for determining the `chain_hash` in Lightning messages.
18955 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
18958 * The network for determining the `chain_hash` in Lightning messages.
18960 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
18963 * The hash and height of the latest block successfully connected.
18965 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
18967 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
18970 * The hash and height of the latest block successfully connected.
18972 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
18974 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
18977 * Constructs a new ChainParameters given each field
18979 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
18982 * Creates a copy of the ChainParameters
18984 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
18987 * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
18989 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
18992 * Base routing fee in millisatoshis.
18994 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
18997 * Base routing fee in millisatoshis.
18999 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
19002 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
19004 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
19007 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
19009 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
19012 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
19013 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
19014 * `cltv_expiry_delta` for more details.
19016 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
19019 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
19020 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
19021 * `cltv_expiry_delta` for more details.
19023 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
19026 * Constructs a new CounterpartyForwardingInfo given each field
19028 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);
19031 * Creates a copy of the CounterpartyForwardingInfo
19033 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
19036 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
19038 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
19041 * The node_id of our counterparty
19043 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19046 * The node_id of our counterparty
19048 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19051 * The Features the channel counterparty provided upon last connection.
19052 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
19053 * many routing-relevant features are present in the init context.
19055 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19058 * The Features the channel counterparty provided upon last connection.
19059 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
19060 * many routing-relevant features are present in the init context.
19062 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
19065 * The value, in satoshis, that must always be held in the channel for our counterparty. This
19066 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
19067 * claiming at least this value on chain.
19069 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
19071 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
19073 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19076 * The value, in satoshis, that must always be held in the channel for our counterparty. This
19077 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
19078 * claiming at least this value on chain.
19080 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
19082 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
19084 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
19087 * Information on the fees and requirements that the counterparty requires when forwarding
19088 * payments to us through this channel.
19090 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19092 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
19095 * Information on the fees and requirements that the counterparty requires when forwarding
19096 * payments to us through this channel.
19098 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
19100 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
19103 * Constructs a new ChannelCounterparty given each field
19105 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);
19108 * Creates a copy of the ChannelCounterparty
19110 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
19113 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
19115 void ChannelDetails_free(struct LDKChannelDetails this_obj);
19118 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
19119 * thereafter this is the txid of the funding transaction xor the funding transaction output).
19120 * Note that this means this value is *not* persistent - it can change once during the
19121 * lifetime of the channel.
19123 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
19126 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
19127 * thereafter this is the txid of the funding transaction xor the funding transaction output).
19128 * Note that this means this value is *not* persistent - it can change once during the
19129 * lifetime of the channel.
19131 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19134 * Parameters which apply to our counterparty. See individual fields for more information.
19136 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19139 * Parameters which apply to our counterparty. See individual fields for more information.
19141 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
19144 * The Channel's funding transaction output, if we've negotiated the funding transaction with
19145 * our counterparty already.
19147 * Note that, if this has been set, `channel_id` will be equivalent to
19148 * `funding_txo.unwrap().to_channel_id()`.
19150 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19152 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19155 * The Channel's funding transaction output, if we've negotiated the funding transaction with
19156 * our counterparty already.
19158 * Note that, if this has been set, `channel_id` will be equivalent to
19159 * `funding_txo.unwrap().to_channel_id()`.
19161 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
19163 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
19166 * The features which this channel operates with. See individual features for more info.
19168 * `None` until negotiation completes and the channel type is finalized.
19170 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19172 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19175 * The features which this channel operates with. See individual features for more info.
19177 * `None` until negotiation completes and the channel type is finalized.
19179 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
19181 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
19184 * The position of the funding transaction in the chain. None if the funding transaction has
19185 * not yet been confirmed and the channel fully opened.
19187 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
19188 * payments instead of this. See [`get_inbound_payment_scid`].
19190 * [`inbound_scid_alias`]: Self::inbound_scid_alias
19191 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
19193 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19196 * The position of the funding transaction in the chain. None if the funding transaction has
19197 * not yet been confirmed and the channel fully opened.
19199 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
19200 * payments instead of this. See [`get_inbound_payment_scid`].
19202 * [`inbound_scid_alias`]: Self::inbound_scid_alias
19203 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
19205 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
19208 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
19209 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
19210 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
19211 * when they see a payment to be routed to us.
19213 * Our counterparty may choose to rotate this value at any time, though will always recognize
19214 * previous values for inbound payment forwarding.
19216 * [`short_channel_id`]: Self::short_channel_id
19218 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19221 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
19222 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
19223 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
19224 * when they see a payment to be routed to us.
19226 * Our counterparty may choose to rotate this value at any time, though will always recognize
19227 * previous values for inbound payment forwarding.
19229 * [`short_channel_id`]: Self::short_channel_id
19231 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
19234 * The value, in satoshis, of this channel as appears in the funding output
19236 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19239 * The value, in satoshis, of this channel as appears in the funding output
19241 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19244 * The value, in satoshis, that must always be held in the channel for us. This value ensures
19245 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
19246 * this value on chain.
19248 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
19250 * This value will be `None` for outbound channels until the counterparty accepts the channel.
19252 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
19254 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19257 * The value, in satoshis, that must always be held in the channel for us. This value ensures
19258 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
19259 * this value on chain.
19261 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
19263 * This value will be `None` for outbound channels until the counterparty accepts the channel.
19265 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
19267 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
19270 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
19272 uint64_t ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19275 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
19277 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19280 * Our total balance. This is the amount we would get if we close the channel.
19281 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
19282 * amount is not likely to be recoverable on close.
19284 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
19285 * balance is not available for inclusion in new outbound HTLCs). This further does not include
19286 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
19287 * This does not consider any on-chain fees.
19289 * See also [`ChannelDetails::outbound_capacity_msat`]
19291 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19294 * Our total balance. This is the amount we would get if we close the channel.
19295 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
19296 * amount is not likely to be recoverable on close.
19298 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
19299 * balance is not available for inclusion in new outbound HTLCs). This further does not include
19300 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
19301 * This does not consider any on-chain fees.
19303 * See also [`ChannelDetails::outbound_capacity_msat`]
19305 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19308 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
19309 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
19310 * available for inclusion in new outbound HTLCs). This further does not include any pending
19311 * outgoing HTLCs which are awaiting some other resolution to be sent.
19313 * See also [`ChannelDetails::balance_msat`]
19315 * This value is not exact. Due to various in-flight changes, feerate changes, and our
19316 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
19317 * should be able to spend nearly this amount.
19319 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19322 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
19323 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
19324 * available for inclusion in new outbound HTLCs). This further does not include any pending
19325 * outgoing HTLCs which are awaiting some other resolution to be sent.
19327 * See also [`ChannelDetails::balance_msat`]
19329 * This value is not exact. Due to various in-flight changes, feerate changes, and our
19330 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
19331 * should be able to spend nearly this amount.
19333 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19336 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
19337 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
19338 * available for inclusion in new inbound HTLCs).
19339 * Note that there are some corner cases not fully handled here, so the actual available
19340 * inbound capacity may be slightly higher than this.
19342 * This value is not exact. Due to various in-flight changes, feerate changes, and our
19343 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
19344 * However, our counterparty should be able to spend nearly this amount.
19346 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19349 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
19350 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
19351 * available for inclusion in new inbound HTLCs).
19352 * Note that there are some corner cases not fully handled here, so the actual available
19353 * inbound capacity may be slightly higher than this.
19355 * This value is not exact. Due to various in-flight changes, feerate changes, and our
19356 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
19357 * However, our counterparty should be able to spend nearly this amount.
19359 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
19362 * The number of required confirmations on the funding transaction before the funding will be
19363 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
19364 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
19365 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
19366 * [`ChannelHandshakeLimits::max_minimum_depth`].
19368 * This value will be `None` for outbound channels until the counterparty accepts the channel.
19370 * [`is_outbound`]: ChannelDetails::is_outbound
19371 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
19372 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
19374 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19377 * The number of required confirmations on the funding transaction before the funding will be
19378 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
19379 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
19380 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
19381 * [`ChannelHandshakeLimits::max_minimum_depth`].
19383 * This value will be `None` for outbound channels until the counterparty accepts the channel.
19385 * [`is_outbound`]: ChannelDetails::is_outbound
19386 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
19387 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
19389 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
19392 * The number of blocks (after our commitment transaction confirms) that we will need to wait
19393 * until we can claim our funds after we force-close the channel. During this time our
19394 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
19395 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
19396 * time to claim our non-HTLC-encumbered funds.
19398 * This value will be `None` for outbound channels until the counterparty accepts the channel.
19400 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19403 * The number of blocks (after our commitment transaction confirms) that we will need to wait
19404 * until we can claim our funds after we force-close the channel. During this time our
19405 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
19406 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
19407 * time to claim our non-HTLC-encumbered funds.
19409 * This value will be `None` for outbound channels until the counterparty accepts the channel.
19411 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
19414 * True if the channel was initiated (and thus funded) by us.
19416 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19419 * True if the channel was initiated (and thus funded) by us.
19421 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
19424 * True if the channel is confirmed, funding_locked messages have been exchanged, and the
19425 * channel is not currently being shut down. `funding_locked` message exchange implies the
19426 * required confirmation count has been reached (and we were connected to the peer at some
19427 * point after the funding transaction received enough confirmations). The required
19428 * confirmation count is provided in [`confirmations_required`].
19430 * [`confirmations_required`]: ChannelDetails::confirmations_required
19432 bool ChannelDetails_get_is_funding_locked(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19435 * True if the channel is confirmed, funding_locked messages have been exchanged, and the
19436 * channel is not currently being shut down. `funding_locked` message exchange implies the
19437 * required confirmation count has been reached (and we were connected to the peer at some
19438 * point after the funding transaction received enough confirmations). The required
19439 * confirmation count is provided in [`confirmations_required`].
19441 * [`confirmations_required`]: ChannelDetails::confirmations_required
19443 void ChannelDetails_set_is_funding_locked(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
19446 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
19447 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
19449 * This is a strict superset of `is_funding_locked`.
19451 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19454 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
19455 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
19457 * This is a strict superset of `is_funding_locked`.
19459 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
19462 * True if this channel is (or will be) publicly-announced.
19464 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
19467 * True if this channel is (or will be) publicly-announced.
19469 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
19472 * Constructs a new ChannelDetails given each field
19474 MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKChannelTypeFeatures channel_type_arg, struct LDKCOption_u64Z short_channel_id_arg, struct LDKCOption_u64Z inbound_scid_alias_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, uint64_t user_channel_id_arg, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t 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);
19477 * Creates a copy of the ChannelDetails
19479 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
19482 * Gets the current SCID which should be used to identify this channel for inbound payments.
19483 * This should be used for providing invoice hints or in any other context where our
19484 * counterparty will forward a payment to us.
19486 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
19487 * [`ChannelDetails::short_channel_id`]. See those for more information.
19489 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
19492 * Frees any resources used by the PaymentSendFailure
19494 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
19497 * Creates a copy of the PaymentSendFailure
19499 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
19502 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
19504 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
19507 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
19509 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
19512 * Utility method to constructs a new AllFailedRetrySafe-variant PaymentSendFailure
19514 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_retry_safe(struct LDKCVec_APIErrorZ a);
19517 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
19519 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
19522 * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
19524 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
19527 * The list of channels to be included in the invoice route hints.
19529 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
19532 * The list of channels to be included in the invoice route hints.
19534 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
19537 * A fake scid used for representing the phantom node's fake channel in generating the invoice
19540 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
19543 * A fake scid used for representing the phantom node's fake channel in generating the invoice
19546 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
19549 * The pubkey of the real backing node that would ultimately receive the payment.
19551 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
19554 * The pubkey of the real backing node that would ultimately receive the payment.
19556 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19559 * Constructs a new PhantomRouteHints given each field
19561 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
19564 * Creates a copy of the PhantomRouteHints
19566 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
19569 * Constructs a new ChannelManager to hold several channels and route between them.
19571 * This is the main \"logic hub\" for all channel-related actions, and implements
19572 * ChannelMessageHandler.
19574 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
19576 * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
19578 * Users need to notify the new ChannelManager when a new block is connected or
19579 * disconnected using its `block_connected` and `block_disconnected` methods, starting
19580 * from after `params.latest_hash`.
19582 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);
19585 * Gets the current configuration applied to all new channels, as
19587 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
19590 * Creates a new outbound channel to the given remote node and with the given value.
19592 * `user_channel_id` will be provided back as in
19593 * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
19594 * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to 0
19595 * for inbound channels, so you may wish to avoid using 0 for `user_channel_id` here.
19596 * `user_channel_id` has no meaning inside of LDK, it is simply copied to events and otherwise
19599 * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
19600 * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
19602 * Note that we do not check if you are currently connected to the given peer. If no
19603 * connection is available, the outbound `open_channel` message may fail to send, resulting in
19604 * the channel eventually being silently forgotten (dropped on reload).
19606 * Returns the new Channel's temporary `channel_id`. This ID will appear as
19607 * [`Event::FundingGenerationReady::temporary_channel_id`] and in
19608 * [`ChannelDetails::channel_id`] until after
19609 * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
19610 * one derived from the funding transaction's TXID. If the counterparty rejects the channel
19611 * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
19613 * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
19614 * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
19615 * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
19617 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
19619 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);
19622 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
19623 * more information.
19625 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
19628 * Gets the list of usable channels, in random order. Useful as an argument to
19629 * get_route to ensure non-announced channels are used.
19631 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
19632 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
19635 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
19638 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
19639 * will be accepted on the given channel, and after additional timeout/the closing of all
19640 * pending HTLCs, the channel will be closed on chain.
19642 * * If we are the channel initiator, we will pay between our [`Background`] and
19643 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
19645 * * If our counterparty is the channel initiator, we will require a channel closing
19646 * transaction feerate of at least our [`Background`] feerate or the feerate which
19647 * would appear on a force-closure transaction, whichever is lower. We will allow our
19648 * counterparty to pay as much fee as they'd like, however.
19650 * May generate a SendShutdown message event on success, which should be relayed.
19652 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
19653 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
19654 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
19656 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
19659 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
19660 * will be accepted on the given channel, and after additional timeout/the closing of all
19661 * pending HTLCs, the channel will be closed on chain.
19663 * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
19664 * the channel being closed or not:
19665 * * If we are the channel initiator, we will pay at least this feerate on the closing
19666 * transaction. The upper-bound is set by
19667 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
19668 * estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
19669 * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
19670 * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
19671 * will appear on a force-closure transaction, whichever is lower).
19673 * May generate a SendShutdown message event on success, which should be relayed.
19675 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
19676 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
19677 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
19679 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);
19682 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
19683 * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
19685 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
19688 * Force close all channels, immediately broadcasting the latest local commitment transaction
19689 * for each to the chain and rejecting new HTLCs on each.
19691 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
19694 * Sends a payment along a given route.
19696 * Value parameters are provided via the last hop in route, see documentation for RouteHop
19697 * fields for more info.
19699 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
19700 * payment), we don't do anything to stop you! We always try to ensure that if the provided
19701 * next hop knows the preimage to payment_hash they can claim an additional amount as
19702 * specified in the last hop in the route! Thus, you should probably do your own
19703 * payment_preimage tracking (which you should already be doing as they represent \"proof of
19704 * payment\") and prevent double-sends yourself.
19706 * May generate SendHTLCs message(s) event on success, which should be relayed.
19708 * Each path may have a different return value, and PaymentSendValue may return a Vec with
19709 * each entry matching the corresponding-index entry in the route paths, see
19710 * PaymentSendFailure for more info.
19712 * In general, a path may raise:
19713 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
19714 * node public key) is specified.
19715 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
19716 * (including due to previous monitor update failure or new permanent monitor update
19718 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
19719 * relevant updates.
19721 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
19722 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
19723 * different route unless you intend to pay twice!
19725 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
19726 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
19727 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
19728 * must not contain multiple paths as multi-path payments require a recipient-provided
19730 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
19731 * bit set (either as required or as available). If multiple paths are present in the Route,
19732 * we assume the invoice had the basic_mpp feature set.
19734 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
19736 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);
19739 * Retries a payment along the given [`Route`].
19741 * Errors returned are a superset of those returned from [`send_payment`], so see
19742 * [`send_payment`] documentation for more details on errors. This method will also error if the
19743 * retry amount puts the payment more than 10% over the payment's total amount, if the payment
19744 * for the given `payment_id` cannot be found (likely due to timeout or success), or if
19745 * further retries have been disabled with [`abandon_payment`].
19747 * [`send_payment`]: [`ChannelManager::send_payment`]
19748 * [`abandon_payment`]: [`ChannelManager::abandon_payment`]
19750 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);
19753 * Signals that no further retries for the given payment will occur.
19755 * After this method returns, any future calls to [`retry_payment`] for the given `payment_id`
19756 * will fail with [`PaymentSendFailure::ParameterError`]. If no such event has been generated,
19757 * an [`Event::PaymentFailed`] event will be generated as soon as there are no remaining
19758 * pending HTLCs for this payment.
19760 * Note that calling this method does *not* prevent a payment from succeeding. You must still
19761 * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
19762 * determine the ultimate status of a payment.
19764 * [`retry_payment`]: Self::retry_payment
19765 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
19766 * [`Event::PaymentSent`]: events::Event::PaymentSent
19768 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
19771 * Send a spontaneous payment, which is a payment that does not require the recipient to have
19772 * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
19773 * the preimage, it must be a cryptographically secure random value that no intermediate node
19774 * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
19775 * never reach the recipient.
19777 * See [`send_payment`] documentation for more details on the return value of this function.
19779 * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
19780 * [`send_payment`] for more information about the risks of duplicate preimage usage.
19782 * Note that `route` must have exactly one path.
19784 * [`send_payment`]: Self::send_payment
19786 * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
19788 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);
19791 * Call this upon creation of a funding transaction for the given channel.
19793 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
19794 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
19796 * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
19797 * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
19799 * May panic if the output found in the funding transaction is duplicative with some other
19800 * channel (note that this should be trivially prevented by using unique funding transaction
19801 * keys per-channel).
19803 * Do NOT broadcast the funding transaction yourself. When we have safely received our
19804 * counterparty's signature the funding transaction will automatically be broadcast via the
19805 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
19807 * Note that this includes RBF or similar transaction replacement strategies - lightning does
19808 * not currently support replacing a funding transaction on an existing channel. Instead,
19809 * create a new channel with a conflicting funding transaction.
19811 * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
19812 * [`Event::ChannelClosed`]: crate::util::events::Event::ChannelClosed
19814 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);
19817 * Regenerates channel_announcements and generates a signed node_announcement from the given
19818 * arguments, providing them in corresponding events via
19819 * [`get_and_clear_pending_msg_events`], if at least one public channel has been confirmed
19820 * on-chain. This effectively re-broadcasts all channel announcements and sends our node
19821 * announcement to ensure that the lightning P2P network is aware of the channels we have and
19822 * our network addresses.
19824 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
19825 * node to humans. They carry no in-protocol meaning.
19827 * `addresses` represent the set (possibly empty) of socket addresses on which this node
19828 * accepts incoming connections. These will be included in the node_announcement, publicly
19829 * tying these addresses together and to this node. If you wish to preserve user privacy,
19830 * addresses should likely contain only Tor Onion addresses.
19832 * Panics if `addresses` is absurdly large (more than 500).
19834 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
19836 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
19839 * Processes HTLCs which are pending waiting on random forward delay.
19841 * Should only really ever be called in response to a PendingHTLCsForwardable event.
19842 * Will likely generate further events.
19844 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
19847 * Performs actions which should happen on startup and roughly once per minute thereafter.
19849 * This currently includes:
19850 * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
19851 * * Broadcasting `ChannelUpdate` messages if we've been disconnected from our peer for more
19852 * than a minute, informing the network that they should no longer attempt to route over
19855 * Note that this may cause reentrancy through `chain::Watch::update_channel` calls or feerate
19856 * estimate fetches.
19858 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
19861 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
19862 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
19863 * along the path (including in our own channel on which we received it).
19864 * Returns false if no payment was found to fail backwards, true if the process of failing the
19865 * HTLC backwards has been started.
19867 MUST_USE_RES bool ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
19870 * Provides a payment preimage in response to [`Event::PaymentReceived`], generating any
19871 * [`MessageSendEvent`]s needed to claim the payment.
19873 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
19874 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
19875 * event matches your expectation. If you fail to do so and call this method, you may provide
19876 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
19878 * Returns whether any HTLCs were claimed, and thus if any new [`MessageSendEvent`]s are now
19879 * pending for processing via [`get_and_clear_pending_msg_events`].
19881 * [`Event::PaymentReceived`]: crate::util::events::Event::PaymentReceived
19882 * [`create_inbound_payment`]: Self::create_inbound_payment
19883 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
19884 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
19886 MUST_USE_RES bool ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
19889 * Gets the node_id held by this ChannelManager
19891 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
19894 * Called to accept a request to open a channel after [`Event::OpenChannelRequest`] has been
19897 * The `temporary_channel_id` parameter indicates which inbound channel should be accepted.
19899 * For inbound channels, the `user_channel_id` parameter will be provided back in
19900 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
19901 * with which `accept_inbound_channel` call.
19903 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
19904 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
19906 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], uint64_t user_channel_id);
19909 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
19912 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
19913 * [`PaymentHash`] and [`PaymentPreimage`] for you.
19915 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
19916 * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
19917 * passed directly to [`claim_funds`].
19919 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
19921 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
19922 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
19926 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
19927 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
19929 * Errors if `min_value_msat` is greater than total bitcoin supply.
19931 * [`claim_funds`]: Self::claim_funds
19932 * [`PaymentReceived`]: events::Event::PaymentReceived
19933 * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
19934 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
19936 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);
19939 * Legacy version of [`create_inbound_payment`]. Use this method if you wish to share
19940 * serialized state with LDK node(s) running 0.0.103 and earlier.
19942 * May panic if `invoice_expiry_delta_secs` is greater than one year.
19945 * This method is deprecated and will be removed soon.
19947 * [`create_inbound_payment`]: Self::create_inbound_payment
19949 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);
19952 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
19953 * stored external to LDK.
19955 * A [`PaymentReceived`] event will only be generated if the [`PaymentSecret`] matches a
19956 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
19957 * the `min_value_msat` provided here, if one is provided.
19959 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
19960 * note that LDK will not stop you from registering duplicate payment hashes for inbound
19963 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
19964 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
19965 * before a [`PaymentReceived`] event will be generated, ensuring that we do not provide the
19966 * sender \"proof-of-payment\" unless they have paid the required amount.
19968 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
19969 * in excess of the current time. This should roughly match the expiry time set in the invoice.
19970 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
19971 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
19972 * invoices when no timeout is set.
19974 * Note that we use block header time to time-out pending inbound payments (with some margin
19975 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
19976 * accept a payment and generate a [`PaymentReceived`] event for some time after the expiry.
19977 * If you need exact expiry semantics, you should enforce them upon receipt of
19978 * [`PaymentReceived`].
19980 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
19981 * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
19983 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
19984 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
19988 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
19989 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
19991 * Errors if `min_value_msat` is greater than total bitcoin supply.
19993 * [`create_inbound_payment`]: Self::create_inbound_payment
19994 * [`PaymentReceived`]: events::Event::PaymentReceived
19996 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);
19999 * Legacy version of [`create_inbound_payment_for_hash`]. Use this method if you wish to share
20000 * serialized state with LDK node(s) running 0.0.103 and earlier.
20002 * May panic if `invoice_expiry_delta_secs` is greater than one year.
20005 * This method is deprecated and will be removed soon.
20007 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
20009 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);
20012 * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
20013 * previously returned from [`create_inbound_payment`].
20015 * [`create_inbound_payment`]: Self::create_inbound_payment
20017 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);
20020 * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
20021 * are used when constructing the phantom invoice's route hints.
20023 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
20025 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
20028 * Gets route hints for use in receiving [phantom node payments].
20030 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
20032 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
20035 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
20036 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
20038 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
20041 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
20042 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
20044 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
20047 * Constructs a new Listen which calls the relevant methods on this_arg.
20048 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
20050 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
20053 * Constructs a new Confirm which calls the relevant methods on this_arg.
20054 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
20056 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
20059 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
20060 * indicating whether persistence is necessary. Only one listener on
20061 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
20064 * Note that this method is not available with the `no-std` feature.
20066 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
20069 * Blocks until ChannelManager needs to be persisted. Only one listener on
20070 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
20073 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
20076 * Gets the latest best block which was connected either via the [`chain::Listen`] or
20077 * [`chain::Confirm`] interfaces.
20079 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
20082 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
20083 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
20085 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
20088 * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
20090 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
20093 * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
20095 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
20098 * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
20100 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
20103 * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
20105 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
20108 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
20110 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
20113 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
20115 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
20118 * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
20120 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
20123 * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
20125 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
20128 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
20130 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
20133 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
20135 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
20138 * The keys provider which will give us relevant keys. Some keys will be loaded during
20139 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
20142 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
20145 * The keys provider which will give us relevant keys. Some keys will be loaded during
20146 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
20149 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
20152 * The fee_estimator for use in the ChannelManager in the future.
20154 * No calls to the FeeEstimator will be made during deserialization.
20156 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
20159 * The fee_estimator for use in the ChannelManager in the future.
20161 * No calls to the FeeEstimator will be made during deserialization.
20163 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
20166 * The chain::Watch for use in the ChannelManager in the future.
20168 * No calls to the chain::Watch will be made during deserialization. It is assumed that
20169 * you have deserialized ChannelMonitors separately and will add them to your
20170 * chain::Watch after deserializing this ChannelManager.
20172 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
20175 * The chain::Watch for use in the ChannelManager in the future.
20177 * No calls to the chain::Watch will be made during deserialization. It is assumed that
20178 * you have deserialized ChannelMonitors separately and will add them to your
20179 * chain::Watch after deserializing this ChannelManager.
20181 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
20184 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
20185 * used to broadcast the latest local commitment transactions of channels which must be
20186 * force-closed during deserialization.
20188 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
20191 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
20192 * used to broadcast the latest local commitment transactions of channels which must be
20193 * force-closed during deserialization.
20195 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
20198 * The Logger for use in the ChannelManager and which may be used to log information during
20201 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
20204 * The Logger for use in the ChannelManager and which may be used to log information during
20207 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
20210 * Default settings used for new channels. Any existing channels will continue to use the
20211 * runtime settings which were stored when the ChannelManager was serialized.
20213 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
20216 * Default settings used for new channels. Any existing channels will continue to use the
20217 * runtime settings which were stored when the ChannelManager was serialized.
20219 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
20222 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
20223 * HashMap for you. This is primarily useful for C bindings where it is not practical to
20224 * populate a HashMap directly from C.
20226 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);
20229 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
20231 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
20234 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
20236 void DecodeError_free(struct LDKDecodeError this_obj);
20239 * Creates a copy of the DecodeError
20241 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
20244 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
20246 void Init_free(struct LDKInit this_obj);
20249 * The relevant features which the sender supports
20251 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
20254 * The relevant features which the sender supports
20256 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
20259 * The receipient's network address. This adds the option to report a remote IP address
20260 * back to a connecting peer using the init message. A node can decide to use that information
20261 * to discover a potential update to its public IPv4 address (NAT) and use
20262 * that for a node_announcement update message containing the new address.
20264 struct LDKCOption_NetAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
20267 * The receipient's network address. This adds the option to report a remote IP address
20268 * back to a connecting peer using the init message. A node can decide to use that information
20269 * to discover a potential update to its public IPv4 address (NAT) and use
20270 * that for a node_announcement update message containing the new address.
20272 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_NetAddressZ val);
20275 * Constructs a new Init given each field
20277 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_NetAddressZ remote_network_address_arg);
20280 * Creates a copy of the Init
20282 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
20285 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
20287 void ErrorMessage_free(struct LDKErrorMessage this_obj);
20290 * The channel ID involved in the error.
20292 * All-0s indicates a general error unrelated to a specific channel, after which all channels
20293 * with the sending peer should be closed.
20295 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
20298 * The channel ID involved in the error.
20300 * All-0s indicates a general error unrelated to a specific channel, after which all channels
20301 * with the sending peer should be closed.
20303 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20306 * A possibly human-readable error description.
20307 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
20308 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
20309 * the terminal emulator or the logging subsystem.
20311 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
20314 * A possibly human-readable error description.
20315 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
20316 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
20317 * the terminal emulator or the logging subsystem.
20319 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
20322 * Constructs a new ErrorMessage given each field
20324 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
20327 * Creates a copy of the ErrorMessage
20329 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
20332 * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
20334 void WarningMessage_free(struct LDKWarningMessage this_obj);
20337 * The channel ID involved in the warning.
20339 * All-0s indicates a warning unrelated to a specific channel.
20341 const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32];
20344 * The channel ID involved in the warning.
20346 * All-0s indicates a warning unrelated to a specific channel.
20348 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20351 * A possibly human-readable warning description.
20352 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
20353 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
20354 * the terminal emulator or the logging subsystem.
20356 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
20359 * A possibly human-readable warning description.
20360 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
20361 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
20362 * the terminal emulator or the logging subsystem.
20364 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
20367 * Constructs a new WarningMessage given each field
20369 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
20372 * Creates a copy of the WarningMessage
20374 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
20377 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
20379 void Ping_free(struct LDKPing this_obj);
20382 * The desired response length
20384 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
20387 * The desired response length
20389 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
20392 * The ping packet size.
20393 * This field is not sent on the wire. byteslen zeros are sent.
20395 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
20398 * The ping packet size.
20399 * This field is not sent on the wire. byteslen zeros are sent.
20401 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
20404 * Constructs a new Ping given each field
20406 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
20409 * Creates a copy of the Ping
20411 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
20414 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
20416 void Pong_free(struct LDKPong this_obj);
20419 * The pong packet size.
20420 * This field is not sent on the wire. byteslen zeros are sent.
20422 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
20425 * The pong packet size.
20426 * This field is not sent on the wire. byteslen zeros are sent.
20428 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
20431 * Constructs a new Pong given each field
20433 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
20436 * Creates a copy of the Pong
20438 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
20441 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
20443 void OpenChannel_free(struct LDKOpenChannel this_obj);
20446 * The genesis hash of the blockchain where the channel is to be opened
20448 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
20451 * The genesis hash of the blockchain where the channel is to be opened
20453 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20456 * A temporary channel ID, until the funding outpoint is announced
20458 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
20461 * A temporary channel ID, until the funding outpoint is announced
20463 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20466 * The channel value
20468 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20471 * The channel value
20473 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
20476 * The amount to push to the counterparty as part of the open, in milli-satoshi
20478 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20481 * The amount to push to the counterparty as part of the open, in milli-satoshi
20483 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
20486 * The threshold below which outputs on transactions broadcast by sender will be omitted
20488 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20491 * The threshold below which outputs on transactions broadcast by sender will be omitted
20493 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
20496 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
20498 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20501 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
20503 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
20506 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
20508 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20511 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
20513 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
20516 * The minimum HTLC size incoming to sender, in milli-satoshi
20518 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20521 * The minimum HTLC size incoming to sender, in milli-satoshi
20523 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
20526 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
20528 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20531 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
20533 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
20536 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
20538 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20541 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
20543 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
20546 * The maximum number of inbound HTLCs towards sender
20548 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20551 * The maximum number of inbound HTLCs towards sender
20553 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
20556 * The sender's key controlling the funding transaction
20558 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20561 * The sender's key controlling the funding transaction
20563 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20566 * Used to derive a revocation key for transactions broadcast by counterparty
20568 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20571 * Used to derive a revocation key for transactions broadcast by counterparty
20573 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20576 * A payment key to sender for transactions broadcast by counterparty
20578 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20581 * A payment key to sender for transactions broadcast by counterparty
20583 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20586 * Used to derive a payment key to sender for transactions broadcast by sender
20588 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20591 * Used to derive a payment key to sender for transactions broadcast by sender
20593 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20596 * Used to derive an HTLC payment key to sender
20598 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20601 * Used to derive an HTLC payment key to sender
20603 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20606 * The first to-be-broadcast-by-sender transaction's per commitment point
20608 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20611 * The first to-be-broadcast-by-sender transaction's per commitment point
20613 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20618 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20623 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
20626 * The channel type that this channel will represent. If none is set, we derive the channel
20627 * type from the intersection of our feature bits with our counterparty's feature bits from
20628 * the Init message.
20630 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20632 struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
20635 * The channel type that this channel will represent. If none is set, we derive the channel
20636 * type from the intersection of our feature bits with our counterparty's feature bits from
20637 * the Init message.
20639 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
20641 void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
20644 * Creates a copy of the OpenChannel
20646 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
20649 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
20651 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
20654 * A temporary channel ID, until the funding outpoint is announced
20656 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
20659 * A temporary channel ID, until the funding outpoint is announced
20661 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20664 * The threshold below which outputs on transactions broadcast by sender will be omitted
20666 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20669 * The threshold below which outputs on transactions broadcast by sender will be omitted
20671 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
20674 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
20676 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20679 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
20681 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
20684 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
20686 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20689 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
20691 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
20694 * The minimum HTLC size incoming to sender, in milli-satoshi
20696 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20699 * The minimum HTLC size incoming to sender, in milli-satoshi
20701 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
20704 * Minimum depth of the funding transaction before the channel is considered open
20706 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20709 * Minimum depth of the funding transaction before the channel is considered open
20711 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
20714 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
20716 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20719 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
20721 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
20724 * The maximum number of inbound HTLCs towards sender
20726 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20729 * The maximum number of inbound HTLCs towards sender
20731 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
20734 * The sender's key controlling the funding transaction
20736 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20739 * The sender's key controlling the funding transaction
20741 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20744 * Used to derive a revocation key for transactions broadcast by counterparty
20746 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20749 * Used to derive a revocation key for transactions broadcast by counterparty
20751 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20754 * A payment key to sender for transactions broadcast by counterparty
20756 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20759 * A payment key to sender for transactions broadcast by counterparty
20761 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20764 * Used to derive a payment key to sender for transactions broadcast by sender
20766 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20769 * Used to derive a payment key to sender for transactions broadcast by sender
20771 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20774 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
20776 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20779 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
20781 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20784 * The first to-be-broadcast-by-sender transaction's per commitment point
20786 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20789 * The first to-be-broadcast-by-sender transaction's per commitment point
20791 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20794 * The channel type that this channel will represent. If none is set, we derive the channel
20795 * type from the intersection of our feature bits with our counterparty's feature bits from
20796 * the Init message.
20798 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
20800 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20802 struct LDKChannelTypeFeatures AcceptChannel_get_channel_type(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
20805 * The channel type that this channel will represent. If none is set, we derive the channel
20806 * type from the intersection of our feature bits with our counterparty's feature bits from
20807 * the Init message.
20809 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
20811 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
20813 void AcceptChannel_set_channel_type(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
20816 * Creates a copy of the AcceptChannel
20818 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
20821 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
20823 void FundingCreated_free(struct LDKFundingCreated this_obj);
20826 * A temporary channel ID, until the funding is established
20828 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
20831 * A temporary channel ID, until the funding is established
20833 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20836 * The funding transaction ID
20838 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
20841 * The funding transaction ID
20843 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20846 * The specific output index funding this channel
20848 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
20851 * The specific output index funding this channel
20853 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
20856 * The signature of the channel initiator (funder) on the initial commitment transaction
20858 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
20861 * The signature of the channel initiator (funder) on the initial commitment transaction
20863 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
20866 * Constructs a new FundingCreated given each field
20868 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);
20871 * Creates a copy of the FundingCreated
20873 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
20876 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
20878 void FundingSigned_free(struct LDKFundingSigned this_obj);
20883 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
20888 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20891 * The signature of the channel acceptor (fundee) on the initial commitment transaction
20893 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
20896 * The signature of the channel acceptor (fundee) on the initial commitment transaction
20898 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
20901 * Constructs a new FundingSigned given each field
20903 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
20906 * Creates a copy of the FundingSigned
20908 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
20911 * Frees any resources used by the FundingLocked, if is_owned is set and inner is non-NULL.
20913 void FundingLocked_free(struct LDKFundingLocked this_obj);
20918 const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32];
20923 void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20926 * The per-commitment point of the second commitment transaction
20928 struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr);
20931 * The per-commitment point of the second commitment transaction
20933 void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20936 * If set, provides a short_channel_id alias for this channel. The sender will accept payments
20937 * to be forwarded over this SCID and forward them to this messages' recipient.
20939 struct LDKCOption_u64Z FundingLocked_get_short_channel_id_alias(const struct LDKFundingLocked *NONNULL_PTR this_ptr);
20942 * If set, provides a short_channel_id alias for this channel. The sender will accept payments
20943 * to be forwarded over this SCID and forward them to this messages' recipient.
20945 void FundingLocked_set_short_channel_id_alias(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20948 * Constructs a new FundingLocked given each field
20950 MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg, struct LDKCOption_u64Z short_channel_id_alias_arg);
20953 * Creates a copy of the FundingLocked
20955 struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
20958 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
20960 void Shutdown_free(struct LDKShutdown this_obj);
20965 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
20970 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20973 * The destination of this peer's funds on closing.
20974 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
20976 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
20979 * The destination of this peer's funds on closing.
20980 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
20982 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
20985 * Constructs a new Shutdown given each field
20987 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
20990 * Creates a copy of the Shutdown
20992 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
20995 * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
20997 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
21000 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
21003 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
21006 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
21009 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
21012 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
21015 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
21018 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
21021 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
21024 * Constructs a new ClosingSignedFeeRange given each field
21026 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
21029 * Creates a copy of the ClosingSignedFeeRange
21031 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
21034 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
21036 void ClosingSigned_free(struct LDKClosingSigned this_obj);
21041 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
21046 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21049 * The proposed total fee for the closing transaction
21051 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
21054 * The proposed total fee for the closing transaction
21056 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
21059 * A signature on the closing transaction
21061 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
21064 * A signature on the closing transaction
21066 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
21069 * The minimum and maximum fees which the sender is willing to accept, provided only by new
21072 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21074 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
21077 * The minimum and maximum fees which the sender is willing to accept, provided only by new
21080 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21082 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
21085 * Constructs a new ClosingSigned given each field
21087 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);
21090 * Creates a copy of the ClosingSigned
21092 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
21095 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
21097 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
21102 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
21107 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21112 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
21117 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
21120 * The HTLC value in milli-satoshi
21122 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
21125 * The HTLC value in milli-satoshi
21127 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
21130 * The payment hash, the pre-image of which controls HTLC redemption
21132 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
21135 * The payment hash, the pre-image of which controls HTLC redemption
21137 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21140 * The expiry height of the HTLC
21142 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
21145 * The expiry height of the HTLC
21147 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
21150 * Creates a copy of the UpdateAddHTLC
21152 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
21155 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
21157 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
21162 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
21167 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21172 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
21177 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
21180 * The pre-image of the payment hash, allowing HTLC redemption
21182 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
21185 * The pre-image of the payment hash, allowing HTLC redemption
21187 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21190 * Constructs a new UpdateFulfillHTLC given each field
21192 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
21195 * Creates a copy of the UpdateFulfillHTLC
21197 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
21200 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
21202 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
21207 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
21212 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21217 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
21222 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
21225 * Creates a copy of the UpdateFailHTLC
21227 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
21230 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
21232 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
21237 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
21242 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21247 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
21252 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
21257 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
21262 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
21265 * Creates a copy of the UpdateFailMalformedHTLC
21267 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
21270 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
21272 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
21277 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
21282 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21285 * A signature on the commitment transaction
21287 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
21290 * A signature on the commitment transaction
21292 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
21295 * Signatures on the HTLC transactions
21297 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
21300 * Constructs a new CommitmentSigned given each field
21302 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
21305 * Creates a copy of the CommitmentSigned
21307 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
21310 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
21312 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
21317 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
21322 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21325 * The secret corresponding to the per-commitment point
21327 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
21330 * The secret corresponding to the per-commitment point
21332 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21335 * The next sender-broadcast commitment transaction's per-commitment point
21337 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
21340 * The next sender-broadcast commitment transaction's per-commitment point
21342 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21345 * Constructs a new RevokeAndACK given each field
21347 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);
21350 * Creates a copy of the RevokeAndACK
21352 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
21355 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
21357 void UpdateFee_free(struct LDKUpdateFee this_obj);
21362 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
21367 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21370 * Fee rate per 1000-weight of the transaction
21372 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
21375 * Fee rate per 1000-weight of the transaction
21377 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
21380 * Constructs a new UpdateFee given each field
21382 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
21385 * Creates a copy of the UpdateFee
21387 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
21390 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
21392 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
21395 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
21396 * belonging to the recipient
21398 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
21401 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
21402 * belonging to the recipient
21404 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21407 * The sender's per-commitment point for their current commitment transaction
21409 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
21412 * The sender's per-commitment point for their current commitment transaction
21414 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21417 * Constructs a new DataLossProtect given each field
21419 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
21422 * Creates a copy of the DataLossProtect
21424 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
21427 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
21429 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
21434 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
21439 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21442 * The next commitment number for the sender
21444 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
21447 * The next commitment number for the sender
21449 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
21452 * The next commitment number for the recipient
21454 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
21457 * The next commitment number for the recipient
21459 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
21462 * Creates a copy of the ChannelReestablish
21464 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
21467 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
21469 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
21474 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
21479 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21482 * The short channel ID
21484 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
21487 * The short channel ID
21489 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
21492 * A signature by the node key
21494 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
21497 * A signature by the node key
21499 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
21502 * A signature by the funding key
21504 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
21507 * A signature by the funding key
21509 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
21512 * Constructs a new AnnouncementSignatures given each field
21514 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);
21517 * Creates a copy of the AnnouncementSignatures
21519 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
21522 * Frees any resources used by the NetAddress
21524 void NetAddress_free(struct LDKNetAddress this_ptr);
21527 * Creates a copy of the NetAddress
21529 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
21532 * Utility method to constructs a new IPv4-variant NetAddress
21534 struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port);
21537 * Utility method to constructs a new IPv6-variant NetAddress
21539 struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port);
21542 * Utility method to constructs a new OnionV2-variant NetAddress
21544 struct LDKNetAddress NetAddress_onion_v2(struct LDKTwelveBytes a);
21547 * Utility method to constructs a new OnionV3-variant NetAddress
21549 struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
21552 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
21554 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
21557 * Read a NetAddress from a byte array, created by NetAddress_write
21559 struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
21562 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
21564 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
21567 * The advertised features
21569 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
21572 * The advertised features
21574 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
21577 * A strictly monotonic announcement counter, with gaps allowed
21579 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
21582 * A strictly monotonic announcement counter, with gaps allowed
21584 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
21587 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
21590 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
21593 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
21596 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21599 * An RGB color for UI purposes
21601 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
21604 * An RGB color for UI purposes
21606 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
21609 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
21612 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
21615 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
21618 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21621 * List of addresses on which this node is reachable
21623 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
21626 * Creates a copy of the UnsignedNodeAnnouncement
21628 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
21631 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
21633 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
21636 * The signature by the node key
21638 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
21641 * The signature by the node key
21643 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
21646 * The actual content of the announcement
21648 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
21651 * The actual content of the announcement
21653 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
21656 * Constructs a new NodeAnnouncement given each field
21658 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
21661 * Creates a copy of the NodeAnnouncement
21663 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
21666 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
21668 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
21671 * The advertised channel features
21673 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
21676 * The advertised channel features
21678 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
21681 * The genesis hash of the blockchain where the channel is to be opened
21683 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
21686 * The genesis hash of the blockchain where the channel is to be opened
21688 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21691 * The short channel ID
21693 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
21696 * The short channel ID
21698 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
21701 * One of the two node_ids which are endpoints of this channel
21703 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
21706 * One of the two node_ids which are endpoints of this channel
21708 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21711 * The other of the two node_ids which are endpoints of this channel
21713 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
21716 * The other of the two node_ids which are endpoints of this channel
21718 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21721 * The funding key for the first node
21723 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
21726 * The funding key for the first node
21728 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21731 * The funding key for the second node
21733 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
21736 * The funding key for the second node
21738 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21741 * Creates a copy of the UnsignedChannelAnnouncement
21743 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
21746 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
21748 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
21751 * Authentication of the announcement by the first public node
21753 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
21756 * Authentication of the announcement by the first public node
21758 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
21761 * Authentication of the announcement by the second public node
21763 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
21766 * Authentication of the announcement by the second public node
21768 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
21771 * Proof of funding UTXO ownership by the first public node
21773 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
21776 * Proof of funding UTXO ownership by the first public node
21778 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
21781 * Proof of funding UTXO ownership by the second public node
21783 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
21786 * Proof of funding UTXO ownership by the second public node
21788 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
21791 * The actual announcement
21793 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
21796 * The actual announcement
21798 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
21801 * Constructs a new ChannelAnnouncement given each field
21803 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);
21806 * Creates a copy of the ChannelAnnouncement
21808 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
21811 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
21813 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
21816 * The genesis hash of the blockchain where the channel is to be opened
21818 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
21821 * The genesis hash of the blockchain where the channel is to be opened
21823 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21826 * The short channel ID
21828 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
21831 * The short channel ID
21833 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
21836 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
21838 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
21841 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
21843 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
21848 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
21853 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
21856 * The number of blocks such that if:
21857 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
21858 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
21859 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
21860 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
21861 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
21862 * forwarding. Note that the HTLC sender is the one who originally sets this value when
21863 * constructing the route.
21865 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
21868 * The number of blocks such that if:
21869 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
21870 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
21871 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
21872 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
21873 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
21874 * forwarding. Note that the HTLC sender is the one who originally sets this value when
21875 * constructing the route.
21877 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
21880 * The minimum HTLC size incoming to sender, in milli-satoshi
21882 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
21885 * The minimum HTLC size incoming to sender, in milli-satoshi
21887 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
21890 * The base HTLC fee charged by sender, in milli-satoshi
21892 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
21895 * The base HTLC fee charged by sender, in milli-satoshi
21897 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
21900 * The amount to fee multiplier, in micro-satoshi
21902 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
21905 * The amount to fee multiplier, in micro-satoshi
21907 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
21910 * Creates a copy of the UnsignedChannelUpdate
21912 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
21915 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
21917 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
21920 * A signature of the channel update
21922 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
21925 * A signature of the channel update
21927 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
21930 * The actual channel update
21932 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
21935 * The actual channel update
21937 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
21940 * Constructs a new ChannelUpdate given each field
21942 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
21945 * Creates a copy of the ChannelUpdate
21947 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
21950 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
21952 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
21955 * The genesis hash of the blockchain being queried
21957 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
21960 * The genesis hash of the blockchain being queried
21962 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21965 * The height of the first block for the channel UTXOs being queried
21967 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
21970 * The height of the first block for the channel UTXOs being queried
21972 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
21975 * The number of blocks to include in the query results
21977 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
21980 * The number of blocks to include in the query results
21982 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
21985 * Constructs a new QueryChannelRange given each field
21987 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
21990 * Creates a copy of the QueryChannelRange
21992 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
21995 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
21997 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
22000 * The genesis hash of the blockchain being queried
22002 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
22005 * The genesis hash of the blockchain being queried
22007 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22010 * The height of the first block in the range of the reply
22012 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
22015 * The height of the first block in the range of the reply
22017 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
22020 * The number of blocks included in the range of the reply
22022 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
22025 * The number of blocks included in the range of the reply
22027 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
22030 * True when this is the final reply for a query
22032 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
22035 * True when this is the final reply for a query
22037 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
22040 * The short_channel_ids in the channel range
22042 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
22045 * Constructs a new ReplyChannelRange given each field
22047 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);
22050 * Creates a copy of the ReplyChannelRange
22052 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
22055 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
22057 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
22060 * The genesis hash of the blockchain being queried
22062 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
22065 * The genesis hash of the blockchain being queried
22067 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22070 * The short_channel_ids that are being queried
22072 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
22075 * Constructs a new QueryShortChannelIds given each field
22077 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
22080 * Creates a copy of the QueryShortChannelIds
22082 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
22085 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
22087 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
22090 * The genesis hash of the blockchain that was queried
22092 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
22095 * The genesis hash of the blockchain that was queried
22097 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22100 * Indicates if the query recipient maintains up-to-date channel
22101 * information for the chain_hash
22103 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
22106 * Indicates if the query recipient maintains up-to-date channel
22107 * information for the chain_hash
22109 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
22112 * Constructs a new ReplyShortChannelIdsEnd given each field
22114 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
22117 * Creates a copy of the ReplyShortChannelIdsEnd
22119 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
22122 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
22124 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
22127 * The genesis hash of the blockchain for channel and node information
22129 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
22132 * The genesis hash of the blockchain for channel and node information
22134 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22137 * The starting unix timestamp
22139 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
22142 * The starting unix timestamp
22144 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
22147 * The range of information in seconds
22149 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
22152 * The range of information in seconds
22154 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
22157 * Constructs a new GossipTimestampFilter given each field
22159 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
22162 * Creates a copy of the GossipTimestampFilter
22164 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
22167 * Frees any resources used by the ErrorAction
22169 void ErrorAction_free(struct LDKErrorAction this_ptr);
22172 * Creates a copy of the ErrorAction
22174 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
22177 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
22179 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
22182 * Utility method to constructs a new IgnoreError-variant ErrorAction
22184 struct LDKErrorAction ErrorAction_ignore_error(void);
22187 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
22189 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
22192 * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
22194 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
22197 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
22199 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
22202 * Utility method to constructs a new SendWarningMessage-variant ErrorAction
22204 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
22207 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
22209 void LightningError_free(struct LDKLightningError this_obj);
22212 * A human-readable message describing the error
22214 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
22217 * A human-readable message describing the error
22219 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
22222 * The action which should be taken against the offending peer.
22224 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
22227 * The action which should be taken against the offending peer.
22229 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
22232 * Constructs a new LightningError given each field
22234 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
22237 * Creates a copy of the LightningError
22239 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
22242 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
22244 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
22247 * update_add_htlc messages which should be sent
22249 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
22252 * update_add_htlc messages which should be sent
22254 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
22257 * update_fulfill_htlc messages which should be sent
22259 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
22262 * update_fulfill_htlc messages which should be sent
22264 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
22267 * update_fail_htlc messages which should be sent
22269 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
22272 * update_fail_htlc messages which should be sent
22274 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
22277 * update_fail_malformed_htlc messages which should be sent
22279 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
22282 * update_fail_malformed_htlc messages which should be sent
22284 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
22287 * An update_fee message which should be sent
22289 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22291 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
22294 * An update_fee message which should be sent
22296 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
22298 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
22301 * Finally, the commitment_signed message which should be sent
22303 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
22306 * Finally, the commitment_signed message which should be sent
22308 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
22311 * Constructs a new CommitmentUpdate given each field
22313 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);
22316 * Creates a copy of the CommitmentUpdate
22318 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
22321 * Calls the free function if one is set
22323 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
22326 * Calls the free function if one is set
22328 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
22331 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
22333 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
22336 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
22338 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
22341 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
22343 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
22346 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
22348 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
22351 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
22353 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
22356 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
22358 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
22361 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
22363 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
22366 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
22368 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
22371 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
22373 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
22376 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
22378 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
22381 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
22383 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
22386 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
22388 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
22391 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
22393 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
22396 * Read a FundingCreated from a byte array, created by FundingCreated_write
22398 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
22401 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
22403 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
22406 * Read a FundingSigned from a byte array, created by FundingSigned_write
22408 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
22411 * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
22413 struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
22416 * Read a FundingLocked from a byte array, created by FundingLocked_write
22418 struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
22421 * Serialize the Init object into a byte array which can be read by Init_read
22423 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
22426 * Read a Init from a byte array, created by Init_write
22428 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
22431 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
22433 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
22436 * Read a OpenChannel from a byte array, created by OpenChannel_write
22438 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
22441 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
22443 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
22446 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
22448 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
22451 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
22453 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
22456 * Read a Shutdown from a byte array, created by Shutdown_write
22458 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
22461 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
22463 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
22466 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
22468 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
22471 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
22473 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
22476 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
22478 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
22481 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
22483 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
22486 * Read a UpdateFee from a byte array, created by UpdateFee_write
22488 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
22491 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
22493 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
22496 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
22498 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
22501 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
22503 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
22506 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
22508 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
22511 * Serialize the Ping object into a byte array which can be read by Ping_read
22513 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
22516 * Read a Ping from a byte array, created by Ping_write
22518 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
22521 * Serialize the Pong object into a byte array which can be read by Pong_read
22523 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
22526 * Read a Pong from a byte array, created by Pong_write
22528 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
22531 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
22533 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
22536 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
22538 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
22541 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
22543 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
22546 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
22548 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
22551 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
22553 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
22556 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
22558 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
22561 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
22563 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
22566 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
22568 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
22571 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
22573 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
22576 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
22578 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
22581 * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
22583 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
22586 * Read a WarningMessage from a byte array, created by WarningMessage_write
22588 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
22591 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
22593 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
22596 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
22598 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
22601 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
22603 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
22606 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
22608 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
22611 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
22613 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
22616 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
22618 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
22621 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
22623 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
22626 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
22628 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
22631 *\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
22633 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
22636 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
22638 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
22641 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
22643 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
22646 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
22648 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
22651 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
22653 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
22656 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
22658 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
22661 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
22663 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
22666 * Calls the free function if one is set
22668 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
22671 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
22673 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
22676 * Constructs a new IgnoringMessageHandler given each field
22678 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
22681 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
22682 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
22684 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
22687 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
22688 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
22690 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
22693 * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
22694 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
22696 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
22699 * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
22700 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
22702 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
22705 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
22707 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
22710 * Constructs a new ErroringMessageHandler
22712 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
22715 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
22716 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
22718 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
22721 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
22722 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
22724 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
22727 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
22729 void MessageHandler_free(struct LDKMessageHandler this_obj);
22732 * A message handler which handles messages specific to channels. Usually this is just a
22733 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
22735 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
22737 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
22740 * A message handler which handles messages specific to channels. Usually this is just a
22741 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
22743 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
22745 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
22748 * A message handler which handles messages updating our knowledge of the network channel
22749 * graph. Usually this is just a [`NetGraphMsgHandler`] object or an
22750 * [`IgnoringMessageHandler`].
22752 * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler
22754 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
22757 * A message handler which handles messages updating our knowledge of the network channel
22758 * graph. Usually this is just a [`NetGraphMsgHandler`] object or an
22759 * [`IgnoringMessageHandler`].
22761 * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler
22763 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
22766 * Constructs a new MessageHandler given each field
22768 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
22771 * Creates a copy of a SocketDescriptor
22773 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
22776 * Calls the free function if one is set
22778 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
22781 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
22783 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
22786 * Used to indicate that we probably can't make any future connections to this peer, implying
22787 * we should go ahead and force-close any channels we have with it.
22789 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
22792 * Used to indicate that we probably can't make any future connections to this peer, implying
22793 * we should go ahead and force-close any channels we have with it.
22795 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
22798 * Constructs a new PeerHandleError given each field
22800 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
22803 * Creates a copy of the PeerHandleError
22805 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
22808 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
22810 void PeerManager_free(struct LDKPeerManager this_obj);
22813 * Constructs a new PeerManager with the given message handlers and node_id secret key
22814 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
22815 * cryptographically secure random bytes.
22817 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);
22820 * Get the list of node ids for peers which have completed the initial handshake.
22822 * For outbound connections, this will be the same as the their_node_id parameter passed in to
22823 * new_outbound_connection, however entries will only appear once the initial handshake has
22824 * completed and we are sure the remote peer has the private key for the given node_id.
22826 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
22829 * Indicates a new outbound connection has been established to a node with the given node_id
22830 * and an optional remote network address.
22832 * The remote network address adds the option to report a remote IP address back to a connecting
22833 * peer using the init message.
22834 * The user should pass the remote network address of the host they are connected to.
22836 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
22837 * descriptor but must disconnect the connection immediately.
22839 * Returns a small number of bytes to send to the remote node (currently always 50).
22841 * Panics if descriptor is duplicative with some other descriptor which has not yet been
22842 * [`socket_disconnected()`].
22844 * [`socket_disconnected()`]: PeerManager::socket_disconnected
22846 MUST_USE_RES struct LDKCResult_CVec_u8ZPeerHandleErrorZ PeerManager_new_outbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKSocketDescriptor descriptor, struct LDKCOption_NetAddressZ remote_network_address);
22849 * Indicates a new inbound connection has been established to a node with an optional remote
22852 * The remote network address adds the option to report a remote IP address back to a connecting
22853 * peer using the init message.
22854 * The user should pass the remote network address of the host they are connected to.
22856 * May refuse the connection by returning an Err, but will never write bytes to the remote end
22857 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
22858 * call socket_disconnected for the new descriptor but must disconnect the connection
22861 * Panics if descriptor is duplicative with some other descriptor which has not yet been
22862 * [`socket_disconnected()`].
22864 * [`socket_disconnected()`]: PeerManager::socket_disconnected
22866 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor, struct LDKCOption_NetAddressZ remote_network_address);
22869 * Indicates that there is room to write data to the given socket descriptor.
22871 * May return an Err to indicate that the connection should be closed.
22873 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
22874 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
22875 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
22876 * ready to call `[write_buffer_space_avail`] again if a write call generated here isn't
22879 * [`send_data`]: SocketDescriptor::send_data
22880 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
22882 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
22885 * Indicates that data was read from the given socket descriptor.
22887 * May return an Err to indicate that the connection should be closed.
22889 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
22890 * Thus, however, you should call [`process_events`] after any `read_event` to generate
22891 * [`send_data`] calls to handle responses.
22893 * If `Ok(true)` is returned, further read_events should not be triggered until a
22894 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
22897 * [`send_data`]: SocketDescriptor::send_data
22898 * [`process_events`]: PeerManager::process_events
22900 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);
22903 * Checks for any events generated by our handlers and processes them. Includes sending most
22904 * response messages as well as messages generated by calls to handler functions directly (eg
22905 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
22907 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
22910 * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
22911 * or one of the other clients provided in our language bindings.
22913 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
22914 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
22915 * [`send_data`]: SocketDescriptor::send_data
22917 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
22920 * Indicates that the given socket descriptor's connection is now closed.
22922 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
22925 * Disconnect a peer given its node id.
22927 * Set `no_connection_possible` to true to prevent any further connection with this peer,
22928 * force-closing any channels we have with it.
22930 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
22931 * peer. Thus, be very careful about reentrancy issues.
22933 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
22935 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
22938 * Disconnects all currently-connected peers. This is useful on platforms where there may be
22939 * an indication that TCP sockets have stalled even if we weren't around to time them out
22940 * using regular ping/pongs.
22942 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
22945 * Send pings to each peer and disconnect those which did not respond to the last round of
22948 * This may be called on any timescale you want, however, roughly once every ten seconds is
22949 * preferred. The call rate determines both how often we send a ping to our peers and how much
22950 * time they have to respond before we disconnect them.
22952 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
22955 * [`send_data`]: SocketDescriptor::send_data
22957 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
22960 * Gets the weight for an HTLC-Success transaction.
22962 uint64_t htlc_success_tx_weight(bool opt_anchors);
22965 * Gets the weight for an HTLC-Timeout transaction.
22967 uint64_t htlc_timeout_tx_weight(bool opt_anchors);
22970 * Build the commitment secret from the seed and the commitment number
22972 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
22975 * Build a closing transaction
22977 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);
22980 * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
22982 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
22985 * Creates a copy of the CounterpartyCommitmentSecrets
22987 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
22990 * Creates a new empty `CounterpartyCommitmentSecrets` structure.
22992 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
22995 * Returns the minimum index of all stored secrets. Note that indexes start
22996 * at 1 << 48 and get decremented by one for each new secret.
22998 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
23001 * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
23002 * was generated in accordance with BOLT 3 and is consistent with previous secrets.
23004 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
23007 * Returns the secret at `idx`.
23008 * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
23010 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23012 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
23015 * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
23017 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
23020 * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
23022 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
23025 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
23026 * from the base secret and the per_commitment_point.
23028 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
23029 * generated (ie our own).
23031 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
23034 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
23035 * from the base point and the per_commitment_key. This is the public equivalent of
23036 * derive_private_key - using only public keys to derive a public key instead of private keys.
23038 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
23039 * generated (ie our own).
23041 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
23044 * Derives a per-commitment-transaction revocation key from its constituent parts.
23046 * Only the cheating participant owns a valid witness to propagate a revoked
23047 * commitment transaction, thus per_commitment_secret always come from cheater
23048 * and revocation_base_secret always come from punisher, which is the broadcaster
23049 * of the transaction spending with this key knowledge.
23051 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
23052 * generated (ie our own).
23054 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
23057 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
23058 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
23059 * public key instead of private keys.
23061 * Only the cheating participant owns a valid witness to propagate a revoked
23062 * commitment transaction, thus per_commitment_point always come from cheater
23063 * and revocation_base_point always come from punisher, which is the broadcaster
23064 * of the transaction spending with this key knowledge.
23066 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
23067 * generated (ie our own).
23069 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
23072 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
23074 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
23077 * The broadcaster's per-commitment public key which was used to derive the other keys.
23079 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
23082 * The broadcaster's per-commitment public key which was used to derive the other keys.
23084 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23087 * The revocation key which is used to allow the broadcaster of the commitment
23088 * transaction to provide their counterparty the ability to punish them if they broadcast
23091 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
23094 * The revocation key which is used to allow the broadcaster of the commitment
23095 * transaction to provide their counterparty the ability to punish them if they broadcast
23098 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23101 * Broadcaster's HTLC Key
23103 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
23106 * Broadcaster's HTLC Key
23108 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23111 * Countersignatory's HTLC Key
23113 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
23116 * Countersignatory's HTLC Key
23118 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23121 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
23123 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
23126 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
23128 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23131 * Constructs a new TxCreationKeys given each field
23133 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);
23136 * Creates a copy of the TxCreationKeys
23138 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
23141 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
23143 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
23146 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
23148 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
23151 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
23153 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
23156 * The public key which is used to sign all commitment transactions, as it appears in the
23157 * on-chain channel lock-in 2-of-2 multisig output.
23159 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
23162 * The public key which is used to sign all commitment transactions, as it appears in the
23163 * on-chain channel lock-in 2-of-2 multisig output.
23165 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23168 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
23169 * revocation keys. This is combined with the per-commitment-secret generated by the
23170 * counterparty to create a secret which the counterparty can reveal to revoke previous
23173 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
23176 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
23177 * revocation keys. This is combined with the per-commitment-secret generated by the
23178 * counterparty to create a secret which the counterparty can reveal to revoke previous
23181 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23184 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
23185 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
23186 * static across every commitment transaction.
23188 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
23191 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
23192 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
23193 * static across every commitment transaction.
23195 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23198 * The base point which is used (with derive_public_key) to derive a per-commitment payment
23199 * public key which receives non-HTLC-encumbered funds which are only available for spending
23200 * after some delay (or can be claimed via the revocation path).
23202 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
23205 * The base point which is used (with derive_public_key) to derive a per-commitment payment
23206 * public key which receives non-HTLC-encumbered funds which are only available for spending
23207 * after some delay (or can be claimed via the revocation path).
23209 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23212 * The base point which is used (with derive_public_key) to derive a per-commitment public key
23213 * which is used to encumber HTLC-in-flight outputs.
23215 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
23218 * The base point which is used (with derive_public_key) to derive a per-commitment public key
23219 * which is used to encumber HTLC-in-flight outputs.
23221 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23224 * Constructs a new ChannelPublicKeys given each field
23226 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);
23229 * Creates a copy of the ChannelPublicKeys
23231 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
23234 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
23236 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
23239 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
23241 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
23244 * Create per-state keys from channel base points and the per-commitment point.
23245 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
23247 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);
23250 * Generate per-state keys from channel static keys.
23251 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
23253 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);
23256 * A script either spendable by the revocation
23257 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
23258 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
23260 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
23263 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
23265 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
23268 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
23269 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
23270 * need to compare this value to whether the commitment transaction in question is that of
23271 * the counterparty or our own.
23273 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
23276 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
23277 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
23278 * need to compare this value to whether the commitment transaction in question is that of
23279 * the counterparty or our own.
23281 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
23284 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
23285 * this divided by 1000.
23287 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
23290 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
23291 * this divided by 1000.
23293 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
23296 * The CLTV lock-time at which this HTLC expires.
23298 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
23301 * The CLTV lock-time at which this HTLC expires.
23303 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
23306 * The hash of the preimage which unlocks this HTLC.
23308 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
23311 * The hash of the preimage which unlocks this HTLC.
23313 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23316 * The position within the commitment transactions' outputs. This may be None if the value is
23317 * below the dust limit (in which case no output appears in the commitment transaction and the
23318 * value is spent to additional transaction fees).
23320 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
23323 * The position within the commitment transactions' outputs. This may be None if the value is
23324 * below the dust limit (in which case no output appears in the commitment transaction and the
23325 * value is spent to additional transaction fees).
23327 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
23330 * Constructs a new HTLCOutputInCommitment given each field
23332 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);
23335 * Creates a copy of the HTLCOutputInCommitment
23337 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
23340 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
23342 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
23345 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
23347 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
23350 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
23351 * does not need to have its previous_output_index filled.
23353 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, const struct LDKTxCreationKeys *NONNULL_PTR keys);
23356 * Gets the redeemscript for a funding output from the two funding public keys.
23357 * Note that the order of funding public keys does not matter.
23359 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
23362 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
23363 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
23364 * transaction which needs signing, and can be used to construct an HTLC transaction which is
23365 * broadcastable given a counterparty HTLC signature.
23367 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
23368 * commitment transaction).
23370 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);
23373 * Gets the witnessScript for an anchor output from the funding public key.
23374 * The witness in the spending input must be:
23375 * <BIP 143 funding_signature>
23376 * After 16 blocks of confirmation, an alternative satisfying witness could be:
23378 * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
23380 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
23383 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
23385 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
23388 * Holder public keys
23390 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
23393 * Holder public keys
23395 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
23398 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
23400 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
23403 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
23405 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
23408 * Whether the holder is the initiator of this channel.
23409 * This is an input to the commitment number obscure factor computation.
23411 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
23414 * Whether the holder is the initiator of this channel.
23415 * This is an input to the commitment number obscure factor computation.
23417 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
23420 * The late-bound counterparty channel transaction parameters.
23421 * These parameters are populated at the point in the protocol where the counterparty provides them.
23423 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23425 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
23428 * The late-bound counterparty channel transaction parameters.
23429 * These parameters are populated at the point in the protocol where the counterparty provides them.
23431 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
23433 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
23436 * The late-bound funding outpoint
23438 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23440 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
23443 * The late-bound funding outpoint
23445 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
23447 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
23450 * Are anchors used for this channel. Boolean is serialization backwards-compatible
23452 enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
23455 * Are anchors used for this channel. Boolean is serialization backwards-compatible
23457 void ChannelTransactionParameters_set_opt_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
23460 * Constructs a new ChannelTransactionParameters given each field
23462 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);
23465 * Creates a copy of the ChannelTransactionParameters
23467 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
23470 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
23472 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
23475 * Counter-party public keys
23477 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
23480 * Counter-party public keys
23482 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
23485 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
23487 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
23490 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
23492 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
23495 * Constructs a new CounterpartyChannelTransactionParameters given each field
23497 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
23500 * Creates a copy of the CounterpartyChannelTransactionParameters
23502 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
23505 * Whether the late bound parameters are populated.
23507 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
23510 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
23511 * given that the holder is the broadcaster.
23513 * self.is_populated() must be true before calling this function.
23515 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
23518 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
23519 * given that the counterparty is the broadcaster.
23521 * self.is_populated() must be true before calling this function.
23523 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
23526 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
23528 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
23531 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
23533 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
23536 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
23538 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
23541 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
23543 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
23546 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
23548 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
23551 * Get the channel pubkeys for the broadcaster
23553 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
23556 * Get the channel pubkeys for the countersignatory
23558 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
23561 * Get the contest delay applicable to the transactions.
23562 * Note that the contest delay was selected by the countersignatory.
23564 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
23567 * Whether the channel is outbound from the broadcaster.
23569 * The boolean representing the side that initiated the channel is
23570 * an input to the commitment number obscure factor computation.
23572 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
23575 * The funding outpoint
23577 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
23580 * Whether to use anchors for this channel
23582 MUST_USE_RES bool DirectedChannelTransactionParameters_opt_anchors(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
23585 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
23587 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
23590 * Our counterparty's signature for the transaction
23592 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
23595 * Our counterparty's signature for the transaction
23597 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
23600 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
23602 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
23605 * Creates a copy of the HolderCommitmentTransaction
23607 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
23610 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
23612 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
23615 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
23617 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
23620 * Create a new holder transaction with the given counterparty signatures.
23621 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
23623 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);
23626 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
23628 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
23631 * The commitment transaction
23633 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
23636 * The commitment transaction
23638 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
23641 * The txid for the commitment transaction.
23643 * This is provided as a performance optimization, instead of calling transaction.txid()
23646 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
23649 * The txid for the commitment transaction.
23651 * This is provided as a performance optimization, instead of calling transaction.txid()
23654 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23657 * Constructs a new BuiltCommitmentTransaction given each field
23659 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
23662 * Creates a copy of the BuiltCommitmentTransaction
23664 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
23667 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
23669 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
23672 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
23674 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
23677 * Get the SIGHASH_ALL sighash value of the transaction.
23679 * This can be used to verify a signature.
23681 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);
23684 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
23685 * because we are about to broadcast a holder transaction.
23687 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);
23690 * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
23692 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
23695 * Creates a copy of the ClosingTransaction
23697 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
23700 * Checks if two ClosingTransactions contain equal inner contents.
23702 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
23705 * Construct an object of the class
23707 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);
23710 * Trust our pre-built transaction.
23712 * Applies a wrapper which allows access to the transaction.
23714 * This should only be used if you fully trust the builder of this object. It should not
23715 * be used by an external signer - instead use the verify function.
23717 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
23720 * Verify our pre-built transaction.
23722 * Applies a wrapper which allows access to the transaction.
23724 * An external validating signer must call this method before signing
23725 * or using the built transaction.
23727 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
23730 * The value to be sent to the holder, or zero if the output will be omitted
23732 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
23735 * The value to be sent to the counterparty, or zero if the output will be omitted
23737 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
23740 * The destination of the holder's output
23742 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
23745 * The destination of the counterparty's output
23747 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
23750 * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
23752 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
23755 * The pre-built Bitcoin commitment transaction
23757 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
23760 * Get the SIGHASH_ALL sighash value of the transaction.
23762 * This can be used to verify a signature.
23764 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);
23767 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
23768 * because we are about to broadcast a holder transaction.
23770 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);
23773 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
23775 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
23778 * Creates a copy of the CommitmentTransaction
23780 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
23783 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
23785 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
23788 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
23790 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
23793 * The backwards-counting commitment number
23795 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
23798 * The value to be sent to the broadcaster
23800 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
23803 * The value to be sent to the counterparty
23805 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
23808 * The feerate paid per 1000-weight-unit in this commitment transaction.
23810 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
23813 * Trust our pre-built transaction and derived transaction creation public keys.
23815 * Applies a wrapper which allows access to these fields.
23817 * This should only be used if you fully trust the builder of this object. It should not
23818 * be used by an external signer - instead use the verify function.
23820 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
23823 * Verify our pre-built transaction and derived transaction creation public keys.
23825 * Applies a wrapper which allows access to these fields.
23827 * An external validating signer must call this method before signing
23828 * or using the built transaction.
23830 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);
23833 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
23835 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
23838 * The transaction ID of the built Bitcoin transaction
23840 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
23843 * The pre-built Bitcoin commitment transaction
23845 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
23848 * The pre-calculated transaction creation public keys.
23850 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
23853 * Should anchors be used.
23855 MUST_USE_RES bool TrustedCommitmentTransaction_opt_anchors(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
23858 * Get a signature for each HTLC which was included in the commitment transaction (ie for
23859 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
23861 * The returned Vec has one entry for each HTLC, and in the same order.
23863 * This function is only valid in the holder commitment context, it always uses SigHashType::All.
23865 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);
23868 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
23869 * shared secret first. This prevents on-chain observers from discovering how many commitment
23870 * transactions occurred in a channel before it was closed.
23872 * This function gets the shared secret from relevant channel public keys and can be used to
23873 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
23875 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
23878 * Checks if two InitFeaturess contain equal inner contents.
23879 * This ignores pointers and is_owned flags and looks at the values in fields.
23880 * Two objects with NULL inner values will be considered "equal" here.
23882 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
23885 * Checks if two NodeFeaturess contain equal inner contents.
23886 * This ignores pointers and is_owned flags and looks at the values in fields.
23887 * Two objects with NULL inner values will be considered "equal" here.
23889 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
23892 * Checks if two ChannelFeaturess contain equal inner contents.
23893 * This ignores pointers and is_owned flags and looks at the values in fields.
23894 * Two objects with NULL inner values will be considered "equal" here.
23896 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
23899 * Checks if two InvoiceFeaturess contain equal inner contents.
23900 * This ignores pointers and is_owned flags and looks at the values in fields.
23901 * Two objects with NULL inner values will be considered "equal" here.
23903 bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b);
23906 * Checks if two ChannelTypeFeaturess contain equal inner contents.
23907 * This ignores pointers and is_owned flags and looks at the values in fields.
23908 * Two objects with NULL inner values will be considered "equal" here.
23910 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
23913 * Creates a copy of the InitFeatures
23915 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
23918 * Creates a copy of the NodeFeatures
23920 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
23923 * Creates a copy of the ChannelFeatures
23925 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
23928 * Creates a copy of the InvoiceFeatures
23930 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
23933 * Creates a copy of the ChannelTypeFeatures
23935 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
23938 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
23940 void InitFeatures_free(struct LDKInitFeatures this_obj);
23943 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
23945 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
23948 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
23950 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
23953 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
23955 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
23958 * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
23960 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
23963 * Create a blank Features with no features set
23965 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
23968 * Creates a Features with the bits set which are known by the implementation
23970 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
23973 * Returns true if this `Features` object contains unknown feature flags which are set as
23976 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
23979 * Create a blank Features with no features set
23981 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
23984 * Creates a Features with the bits set which are known by the implementation
23986 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
23989 * Returns true if this `Features` object contains unknown feature flags which are set as
23992 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
23995 * Create a blank Features with no features set
23997 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
24000 * Creates a Features with the bits set which are known by the implementation
24002 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
24005 * Returns true if this `Features` object contains unknown feature flags which are set as
24008 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
24011 * Create a blank Features with no features set
24013 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
24016 * Creates a Features with the bits set which are known by the implementation
24018 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
24021 * Returns true if this `Features` object contains unknown feature flags which are set as
24024 MUST_USE_RES bool InvoiceFeatures_requires_unknown_bits(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
24027 * Create a blank Features with no features set
24029 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
24032 * Creates a Features with the bits set which are known by the implementation
24034 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_known(void);
24037 * Returns true if this `Features` object contains unknown feature flags which are set as
24040 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
24043 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
24045 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
24048 * Read a InitFeatures from a byte array, created by InitFeatures_write
24050 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
24053 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
24055 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
24058 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
24060 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
24063 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
24065 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
24068 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
24070 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
24073 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
24075 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
24078 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
24080 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
24083 * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
24085 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
24088 * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
24090 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
24093 * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
24095 void ShutdownScript_free(struct LDKShutdownScript this_obj);
24098 * Creates a copy of the ShutdownScript
24100 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
24103 * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
24105 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
24108 * The script that did not meet the requirements from [BOLT #2].
24110 * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md
24112 struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
24115 * The script that did not meet the requirements from [BOLT #2].
24117 * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md
24119 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
24122 * Constructs a new InvalidShutdownScript given each field
24124 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
24127 * Creates a copy of the InvalidShutdownScript
24129 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
24132 * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
24134 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
24137 * Read a ShutdownScript from a byte array, created by ShutdownScript_write
24139 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
24142 * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
24144 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
24147 * Generates a P2WSH script pubkey from the given [`WScriptHash`].
24149 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
24152 * Generates a witness script pubkey from the given segwit version and program.
24154 * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
24155 * [`ShutdownScript::new_p2wsh`] instead.
24159 * This function may return an error if `program` is invalid for the segwit `version`.
24161 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(uint8_t version, struct LDKu8slice program);
24164 * Converts the shutdown script into the underlying [`Script`].
24166 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
24169 * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
24171 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24173 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
24176 * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
24178 * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
24180 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
24183 * Calls the free function if one is set
24185 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
24188 * Calls the free function if one is set
24190 void Type_free(struct LDKType this_ptr);
24193 * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
24195 void NodeId_free(struct LDKNodeId this_obj);
24198 * Creates a copy of the NodeId
24200 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
24203 * Create a new NodeId from a public key
24205 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
24208 * Get the public key slice from this NodeId
24210 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
24213 * Checks if two NodeIds contain equal inner contents.
24215 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
24218 * Serialize the NodeId object into a byte array which can be read by NodeId_read
24220 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
24223 * Read a NodeId from a byte array, created by NodeId_write
24225 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
24228 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
24230 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
24233 * Creates a copy of the NetworkGraph
24235 struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
24238 * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
24240 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
24243 * Frees any resources used by the NetworkUpdate
24245 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
24248 * Creates a copy of the NetworkUpdate
24250 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
24253 * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
24255 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
24258 * Utility method to constructs a new ChannelClosed-variant NetworkUpdate
24260 struct LDKNetworkUpdate NetworkUpdate_channel_closed(uint64_t short_channel_id, bool is_permanent);
24263 * Utility method to constructs a new NodeFailure-variant NetworkUpdate
24265 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
24268 * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
24270 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
24273 * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
24275 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
24278 * Constructs a new EventHandler which calls the relevant methods on this_arg.
24279 * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
24281 struct LDKEventHandler NetGraphMsgHandler_as_EventHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
24284 * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
24286 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
24289 * Creates a new tracker of the actual state of the network of channels and nodes,
24290 * assuming an existing Network Graph.
24291 * Chain monitor is used to make sure announced channels exist on-chain,
24292 * channel data is correct, and that the announcement is signed with
24293 * channel owners' keys.
24295 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_AccessZ chain_access, struct LDKLogger logger);
24298 * Adds a provider used to check new announcements. Does not affect
24299 * existing announcements unless they are updated.
24300 * Add, update or remove the provider would replace the current one.
24302 void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKCOption_AccessZ chain_access);
24305 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
24306 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
24308 struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
24311 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
24312 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
24314 struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
24317 * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
24319 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
24322 * When the last update to the channel direction was issued.
24323 * Value is opaque, as set in the announcement.
24325 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
24328 * When the last update to the channel direction was issued.
24329 * Value is opaque, as set in the announcement.
24331 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
24334 * Whether the channel can be currently used for payments (in this one direction).
24336 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
24339 * Whether the channel can be currently used for payments (in this one direction).
24341 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
24344 * The difference in CLTV values that you must have when routing through this channel.
24346 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
24349 * The difference in CLTV values that you must have when routing through this channel.
24351 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
24354 * The minimum value, which must be relayed to the next hop via the channel
24356 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
24359 * The minimum value, which must be relayed to the next hop via the channel
24361 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
24364 * The maximum value which may be relayed to the next hop via the channel.
24366 struct LDKCOption_u64Z ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
24369 * The maximum value which may be relayed to the next hop via the channel.
24371 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
24374 * Fees charged when the channel is used for routing
24376 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
24379 * Fees charged when the channel is used for routing
24381 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
24384 * Most recent update for the channel received from the network
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 LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
24394 * Most recent update for the channel received from the network
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 ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
24404 * Constructs a new ChannelUpdateInfo given each field
24406 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);
24409 * Creates a copy of the ChannelUpdateInfo
24411 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
24414 * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
24416 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
24419 * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
24421 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
24424 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
24426 void ChannelInfo_free(struct LDKChannelInfo this_obj);
24429 * Protocol features of a channel communicated during its announcement
24431 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
24434 * Protocol features of a channel communicated during its announcement
24436 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
24439 * Source node of the first direction of a channel
24441 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
24444 * Source node of the first direction of a channel
24446 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
24449 * Details about the first direction of a channel
24451 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24453 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
24456 * Details about the first direction of a channel
24458 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24460 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
24463 * Source node of the second direction of a channel
24465 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
24468 * Source node of the second direction of a channel
24470 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
24473 * Details about the second direction of a channel
24475 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24477 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
24480 * Details about the second direction of a channel
24482 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24484 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
24487 * The channel capacity as seen on-chain, if chain lookup is available.
24489 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
24492 * The channel capacity as seen on-chain, if chain lookup is available.
24494 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
24497 * An initial announcement of the channel
24498 * Mostly redundant with the data we store in fields explicitly.
24499 * Everything else is useful only for sending out for initial routing sync.
24500 * Not stored if contains excess data to prevent DoS.
24502 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24504 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
24507 * An initial announcement of the channel
24508 * Mostly redundant with the data we store in fields explicitly.
24509 * Everything else is useful only for sending out for initial routing sync.
24510 * Not stored if contains excess data to prevent DoS.
24512 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24514 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
24517 * Creates a copy of the ChannelInfo
24519 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
24522 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
24524 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
24527 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
24529 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
24532 * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
24534 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
24537 * Creates a copy of the DirectedChannelInfo
24539 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
24542 * Returns information for the channel.
24544 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
24547 * Returns information for the direction.
24549 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24551 MUST_USE_RES struct LDKChannelUpdateInfo DirectedChannelInfo_direction(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
24554 * Returns the [`EffectiveCapacity`] of the channel in the direction.
24556 * This is either the total capacity from the funding transaction, if known, or the
24557 * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
24558 * whichever is smaller.
24560 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
24563 * Frees any resources used by the EffectiveCapacity
24565 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
24568 * Creates a copy of the EffectiveCapacity
24570 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
24573 * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
24575 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
24578 * Utility method to constructs a new MaximumHTLC-variant EffectiveCapacity
24580 struct LDKEffectiveCapacity EffectiveCapacity_maximum_htlc(uint64_t amount_msat);
24583 * Utility method to constructs a new Total-variant EffectiveCapacity
24585 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat);
24588 * Utility method to constructs a new Infinite-variant EffectiveCapacity
24590 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
24593 * Utility method to constructs a new Unknown-variant EffectiveCapacity
24595 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
24598 * Returns the effective capacity denominated in millisatoshi.
24600 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
24603 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
24605 void RoutingFees_free(struct LDKRoutingFees this_obj);
24608 * Flat routing fee in satoshis
24610 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
24613 * Flat routing fee in satoshis
24615 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
24618 * Liquidity-based routing fee in millionths of a routed amount.
24619 * In other words, 10000 is 1%.
24621 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
24624 * Liquidity-based routing fee in millionths of a routed amount.
24625 * In other words, 10000 is 1%.
24627 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
24630 * Constructs a new RoutingFees given each field
24632 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
24635 * Checks if two RoutingFeess contain equal inner contents.
24636 * This ignores pointers and is_owned flags and looks at the values in fields.
24637 * Two objects with NULL inner values will be considered "equal" here.
24639 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
24642 * Creates a copy of the RoutingFees
24644 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
24647 * Checks if two RoutingFeess contain equal inner contents.
24649 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
24652 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
24654 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
24657 * Read a RoutingFees from a byte array, created by RoutingFees_write
24659 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
24662 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
24664 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
24667 * Protocol features the node announced support for
24669 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
24672 * Protocol features the node announced support for
24674 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
24677 * When the last known update to the node state was issued.
24678 * Value is opaque, as set in the announcement.
24680 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
24683 * When the last known update to the node state was issued.
24684 * Value is opaque, as set in the announcement.
24686 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
24689 * Color assigned to the node
24691 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
24694 * Color assigned to the node
24696 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
24699 * Moniker assigned to the node.
24700 * May be invalid or malicious (eg control chars),
24701 * should not be exposed to the user.
24703 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
24706 * Moniker assigned to the node.
24707 * May be invalid or malicious (eg control chars),
24708 * should not be exposed to the user.
24710 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24713 * Internet-level addresses via which one can connect to the node
24715 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
24718 * An initial announcement of the node
24719 * Mostly redundant with the data we store in fields explicitly.
24720 * Everything else is useful only for sending out for initial routing sync.
24721 * Not stored if contains excess data to prevent DoS.
24723 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24725 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
24728 * An initial announcement of the node
24729 * Mostly redundant with the data we store in fields explicitly.
24730 * Everything else is useful only for sending out for initial routing sync.
24731 * Not stored if contains excess data to prevent DoS.
24733 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24735 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
24738 * Constructs a new NodeAnnouncementInfo given each field
24740 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);
24743 * Creates a copy of the NodeAnnouncementInfo
24745 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
24748 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
24750 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
24753 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
24755 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
24758 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
24760 void NodeInfo_free(struct LDKNodeInfo this_obj);
24763 * All valid channels a node has announced
24765 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
24768 * Lowest fees enabling routing via any of the enabled, known channels to a node.
24769 * The two fields (flat and proportional fee) are independent,
24770 * meaning they don't have to refer to the same channel.
24772 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24774 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
24777 * Lowest fees enabling routing via any of the enabled, known channels to a node.
24778 * The two fields (flat and proportional fee) are independent,
24779 * meaning they don't have to refer to the same channel.
24781 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24783 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
24786 * More information about a node from node_announcement.
24787 * Optional because we store a Node entry after learning about it from
24788 * a channel announcement, but before receiving a node announcement.
24790 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24792 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
24795 * More information about a node from node_announcement.
24796 * Optional because we store a Node entry after learning about it from
24797 * a channel announcement, but before receiving a node announcement.
24799 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24801 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
24804 * Constructs a new NodeInfo given each field
24806 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
24809 * Creates a copy of the NodeInfo
24811 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
24814 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
24816 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
24819 * Read a NodeInfo from a byte array, created by NodeInfo_write
24821 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
24824 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
24826 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
24829 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
24831 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
24834 * Creates a new, empty, network graph.
24836 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
24839 * Returns a read-only view of the network graph.
24841 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
24844 * For an already known node (from channel announcements), update its stored properties from a
24845 * given node announcement.
24847 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
24848 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
24849 * routing messages from a source using a protocol other than the lightning P2P protocol.
24851 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
24854 * For an already known node (from channel announcements), update its stored properties from a
24855 * given node announcement without verifying the associated signatures. Because we aren't
24856 * given the associated signatures here we cannot relay the node announcement to any of our
24859 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);
24862 * Store or update channel info from a channel announcement.
24864 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
24865 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
24866 * routing messages from a source using a protocol other than the lightning P2P protocol.
24868 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
24869 * the corresponding UTXO exists on chain and is correctly-formatted.
24871 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);
24874 * Store or update channel info from a channel announcement without verifying the associated
24875 * signatures. Because we aren't given the associated signatures here we cannot relay the
24876 * channel announcement to any of our peers.
24878 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
24879 * the corresponding UTXO exists on chain and is correctly-formatted.
24881 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);
24884 * Close a channel if a corresponding HTLC fail was sent.
24885 * If permanent, removes a channel from the local storage.
24886 * May cause the removal of nodes too, if this was their last channel.
24887 * If not permanent, makes channels unavailable for routing.
24889 void NetworkGraph_close_channel_from_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
24892 * Marks a node in the graph as failed.
24894 void NetworkGraph_fail_node(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey _node_id, bool is_permanent);
24897 * Removes information about channels that we haven't heard any updates about in some time.
24898 * This can be used regularly to prune the network graph of channels that likely no longer
24901 * While there is no formal requirement that nodes regularly re-broadcast their channel
24902 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
24903 * pruning occur for updates which are at least two weeks old, which we implement here.
24905 * Note that for users of the `lightning-background-processor` crate this method may be
24906 * automatically called regularly for you.
24908 * This method is only available with the `std` feature. See
24909 * [`NetworkGraph::remove_stale_channels_with_time`] for `no-std` use.
24911 void NetworkGraph_remove_stale_channels(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
24914 * Removes information about channels that we haven't heard any updates about in some time.
24915 * This can be used regularly to prune the network graph of channels that likely no longer
24918 * While there is no formal requirement that nodes regularly re-broadcast their channel
24919 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
24920 * pruning occur for updates which are at least two weeks old, which we implement here.
24922 * This function takes the current unix time as an argument. For users with the `std` feature
24923 * enabled, [`NetworkGraph::remove_stale_channels`] may be preferable.
24925 void NetworkGraph_remove_stale_channels_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
24928 * For an already known (from announcement) channel, update info about one of the directions
24931 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
24932 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
24933 * routing messages from a source using a protocol other than the lightning P2P protocol.
24935 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
24936 * materially in the future will be rejected.
24938 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
24941 * For an already known (from announcement) channel, update info about one of the directions
24942 * of the channel without verifying the associated signatures. Because we aren't given the
24943 * associated signatures here we cannot relay the channel update to any of our peers.
24945 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
24946 * materially in the future will be rejected.
24948 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
24951 * Get network addresses by node id.
24952 * Returns None if the requested node is completely unknown,
24953 * or if node announcement for the node was never received.
24955 MUST_USE_RES struct LDKCOption_CVec_NetAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
24958 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
24960 void RouteHop_free(struct LDKRouteHop this_obj);
24963 * The node_id of the node at this hop.
24965 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
24968 * The node_id of the node at this hop.
24970 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24973 * The node_announcement features of the node at this hop. For the last hop, these may be
24974 * amended to match the features present in the invoice this node generated.
24976 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
24979 * The node_announcement features of the node at this hop. For the last hop, these may be
24980 * amended to match the features present in the invoice this node generated.
24982 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
24985 * The channel that should be used from the previous hop to reach this node.
24987 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
24990 * The channel that should be used from the previous hop to reach this node.
24992 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
24995 * The channel_announcement features of the channel that should be used from the previous hop
24996 * to reach this node.
24998 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
25001 * The channel_announcement features of the channel that should be used from the previous hop
25002 * to reach this node.
25004 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
25007 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
25008 * For the last hop, this should be the full value of the payment (might be more than
25009 * requested if we had to match htlc_minimum_msat).
25011 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
25014 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
25015 * For the last hop, this should be the full value of the payment (might be more than
25016 * requested if we had to match htlc_minimum_msat).
25018 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
25021 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
25022 * expected at the destination, in excess of the current block height.
25024 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
25027 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
25028 * expected at the destination, in excess of the current block height.
25030 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
25033 * Constructs a new RouteHop given each field
25035 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);
25038 * Creates a copy of the RouteHop
25040 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
25043 * Checks if two RouteHops contain equal inner contents.
25045 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
25048 * Checks if two RouteHops contain equal inner contents.
25049 * This ignores pointers and is_owned flags and looks at the values in fields.
25050 * Two objects with NULL inner values will be considered "equal" here.
25052 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
25055 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
25057 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
25060 * Read a RouteHop from a byte array, created by RouteHop_write
25062 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
25065 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
25067 void Route_free(struct LDKRoute this_obj);
25070 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
25071 * last RouteHop in each path must be the same.
25072 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
25073 * destination. Thus, this must always be at least length one. While the maximum length of any
25074 * given path is variable, keeping the length of any path to less than 20 should currently
25075 * ensure it is viable.
25077 struct LDKCVec_CVec_RouteHopZZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
25080 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
25081 * last RouteHop in each path must be the same.
25082 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
25083 * destination. Thus, this must always be at least length one. While the maximum length of any
25084 * given path is variable, keeping the length of any path to less than 20 should currently
25085 * ensure it is viable.
25087 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
25090 * The `payment_params` parameter passed to [`find_route`].
25091 * This is used by `ChannelManager` to track information which may be required for retries,
25092 * provided back to you via [`Event::PaymentPathFailed`].
25094 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
25096 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25098 struct LDKPaymentParameters Route_get_payment_params(const struct LDKRoute *NONNULL_PTR this_ptr);
25101 * The `payment_params` parameter passed to [`find_route`].
25102 * This is used by `ChannelManager` to track information which may be required for retries,
25103 * provided back to you via [`Event::PaymentPathFailed`].
25105 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
25107 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
25109 void Route_set_payment_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
25112 * Constructs a new Route given each field
25114 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg, struct LDKPaymentParameters payment_params_arg);
25117 * Creates a copy of the Route
25119 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
25122 * Checks if two Routes contain equal inner contents.
25124 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
25127 * Checks if two Routes contain equal inner contents.
25128 * This ignores pointers and is_owned flags and looks at the values in fields.
25129 * Two objects with NULL inner values will be considered "equal" here.
25131 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
25134 * Returns the total amount of fees paid on this [`Route`].
25136 * This doesn't include any extra payment made to the recipient, which can happen in excess of
25137 * the amount passed to [`find_route`]'s `params.final_value_msat`.
25139 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
25142 * Returns the total amount paid on this [`Route`], excluding the fees.
25144 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
25147 * Serialize the Route object into a byte array which can be read by Route_read
25149 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
25152 * Read a Route from a byte array, created by Route_write
25154 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
25157 * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
25159 void RouteParameters_free(struct LDKRouteParameters this_obj);
25162 * The parameters of the failed payment path.
25164 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
25167 * The parameters of the failed payment path.
25169 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
25172 * The amount in msats sent on the failed payment path.
25174 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
25177 * The amount in msats sent on the failed payment path.
25179 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
25182 * The CLTV on the final hop of the failed payment path.
25184 uint32_t RouteParameters_get_final_cltv_expiry_delta(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
25187 * The CLTV on the final hop of the failed payment path.
25189 void RouteParameters_set_final_cltv_expiry_delta(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint32_t val);
25192 * Constructs a new RouteParameters given each field
25194 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);
25197 * Creates a copy of the RouteParameters
25199 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
25202 * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
25204 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
25207 * Read a RouteParameters from a byte array, created by RouteParameters_write
25209 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
25212 * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
25214 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
25217 * The node id of the payee.
25219 struct LDKPublicKey PaymentParameters_get_payee_pubkey(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
25222 * The node id of the payee.
25224 void PaymentParameters_set_payee_pubkey(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25227 * Features supported by the payee.
25229 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
25230 * does not contain any features.
25232 * [`for_keysend`]: Self::for_keysend
25234 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25236 struct LDKInvoiceFeatures PaymentParameters_get_features(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
25239 * Features supported by the payee.
25241 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
25242 * does not contain any features.
25244 * [`for_keysend`]: Self::for_keysend
25246 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
25248 void PaymentParameters_set_features(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKInvoiceFeatures val);
25251 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
25253 struct LDKCVec_RouteHintZ PaymentParameters_get_route_hints(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
25256 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
25258 void PaymentParameters_set_route_hints(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintZ val);
25261 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
25263 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
25266 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
25268 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
25271 * The maximum total CLTV delta we accept for the route.
25273 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
25276 * The maximum total CLTV delta we accept for the route.
25278 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
25281 * Constructs a new PaymentParameters given each field
25283 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);
25286 * Creates a copy of the PaymentParameters
25288 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
25291 * Checks if two PaymentParameterss contain equal inner contents.
25293 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
25296 * Checks if two PaymentParameterss contain equal inner contents.
25297 * This ignores pointers and is_owned flags and looks at the values in fields.
25298 * Two objects with NULL inner values will be considered "equal" here.
25300 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
25303 * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
25305 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
25308 * Read a PaymentParameters from a byte array, created by PaymentParameters_write
25310 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser);
25313 * Creates a payee with the node id of the given `pubkey`.
25315 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey);
25318 * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
25320 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey);
25323 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
25325 void RouteHint_free(struct LDKRouteHint this_obj);
25327 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
25329 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
25332 * Constructs a new RouteHint given each field
25334 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
25337 * Creates a copy of the RouteHint
25339 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
25342 * Checks if two RouteHints contain equal inner contents.
25344 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
25347 * Checks if two RouteHints contain equal inner contents.
25348 * This ignores pointers and is_owned flags and looks at the values in fields.
25349 * Two objects with NULL inner values will be considered "equal" here.
25351 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
25354 * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
25356 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
25359 * Read a RouteHint from a byte array, created by RouteHint_write
25361 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
25364 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
25366 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
25369 * The node_id of the non-target end of the route
25371 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
25374 * The node_id of the non-target end of the route
25376 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25379 * The short_channel_id of this channel
25381 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
25384 * The short_channel_id of this channel
25386 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
25389 * The fees which must be paid to use this channel
25391 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
25394 * The fees which must be paid to use this channel
25396 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
25399 * The difference in CLTV values between this node and the next node.
25401 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
25404 * The difference in CLTV values between this node and the next node.
25406 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
25409 * The minimum value, in msat, which must be relayed to the next hop.
25411 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
25414 * The minimum value, in msat, which must be relayed to the next hop.
25416 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
25419 * The maximum value in msat available for routing with a single HTLC.
25421 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
25424 * The maximum value in msat available for routing with a single HTLC.
25426 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
25429 * Constructs a new RouteHintHop given each field
25431 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);
25434 * Creates a copy of the RouteHintHop
25436 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
25439 * Checks if two RouteHintHops contain equal inner contents.
25441 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
25444 * Checks if two RouteHintHops contain equal inner contents.
25445 * This ignores pointers and is_owned flags and looks at the values in fields.
25446 * Two objects with NULL inner values will be considered "equal" here.
25448 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
25451 * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
25453 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
25456 * Read a RouteHintHop from a byte array, created by RouteHintHop_write
25458 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
25461 * Finds a route from us (payer) to the given target node (payee).
25463 * If the payee provided features in their invoice, they should be provided via `params.payee`.
25464 * Without this, MPP will only be used if the payee's features are available in the network graph.
25466 * Private routing paths between a public node and the target may be included in `params.payee`.
25468 * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
25469 * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of our local
25470 * channels from [`NetworkGraph`] will be ignored, and only those in `first_hops` will be used.
25472 * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
25473 * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
25474 * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
25478 * May be used to re-compute a [`Route`] when handling a [`Event::PaymentPathFailed`]. Any
25479 * adjustments to the [`NetworkGraph`] and channel scores should be made prior to calling this
25484 * Panics if first_hops contains channels without short_channel_ids;
25485 * [`ChannelManager::list_usable_channels`] will never include such channels.
25487 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
25488 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
25490 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
25492 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, const uint8_t (*random_seed_bytes)[32]);
25495 * Calls the free function if one is set
25497 void Score_free(struct LDKScore this_ptr);
25500 * Calls the free function if one is set
25502 void LockableScore_free(struct LDKLockableScore this_ptr);
25505 * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
25507 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
25510 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
25512 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
25515 * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
25517 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
25520 * Creates a copy of the FixedPenaltyScorer
25522 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
25525 * Creates a new scorer using `penalty_msat`.
25527 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
25530 * Constructs a new Score which calls the relevant methods on this_arg.
25531 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
25533 struct LDKScore FixedPenaltyScorer_as_Score(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
25536 * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
25538 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
25541 * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
25543 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
25546 * Frees any resources used by the Scorer, if is_owned is set and inner is non-NULL.
25548 void Scorer_free(struct LDKScorer this_obj);
25551 * Frees any resources used by the ScoringParameters, if is_owned is set and inner is non-NULL.
25553 void ScoringParameters_free(struct LDKScoringParameters this_obj);
25556 * A fixed penalty in msats to apply to each channel.
25558 * Default value: 500 msat
25560 uint64_t ScoringParameters_get_base_penalty_msat(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
25563 * A fixed penalty in msats to apply to each channel.
25565 * Default value: 500 msat
25567 void ScoringParameters_set_base_penalty_msat(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
25570 * A penalty in msats to apply to a channel upon failing to relay a payment.
25572 * This accumulates for each failure but may be reduced over time based on
25573 * [`failure_penalty_half_life`] or when successfully routing through a channel.
25575 * Default value: 1,024,000 msat
25577 * [`failure_penalty_half_life`]: Self::failure_penalty_half_life
25579 uint64_t ScoringParameters_get_failure_penalty_msat(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
25582 * A penalty in msats to apply to a channel upon failing to relay a payment.
25584 * This accumulates for each failure but may be reduced over time based on
25585 * [`failure_penalty_half_life`] or when successfully routing through a channel.
25587 * Default value: 1,024,000 msat
25589 * [`failure_penalty_half_life`]: Self::failure_penalty_half_life
25591 void ScoringParameters_set_failure_penalty_msat(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
25594 * When the amount being sent over a channel is this many 1024ths of the total channel
25595 * capacity, we begin applying [`overuse_penalty_msat_per_1024th`].
25597 * Default value: 128 1024ths (i.e. begin penalizing when an HTLC uses 1/8th of a channel)
25599 * [`overuse_penalty_msat_per_1024th`]: Self::overuse_penalty_msat_per_1024th
25601 uint16_t ScoringParameters_get_overuse_penalty_start_1024th(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
25604 * When the amount being sent over a channel is this many 1024ths of the total channel
25605 * capacity, we begin applying [`overuse_penalty_msat_per_1024th`].
25607 * Default value: 128 1024ths (i.e. begin penalizing when an HTLC uses 1/8th of a channel)
25609 * [`overuse_penalty_msat_per_1024th`]: Self::overuse_penalty_msat_per_1024th
25611 void ScoringParameters_set_overuse_penalty_start_1024th(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint16_t val);
25614 * A penalty applied, per whole 1024ths of the channel capacity which the amount being sent
25615 * over the channel exceeds [`overuse_penalty_start_1024th`] by.
25617 * Default value: 20 msat (i.e. 2560 msat penalty to use 1/4th of a channel, 7680 msat penalty
25618 * to use half a channel, and 12,560 msat penalty to use 3/4ths of a channel)
25620 * [`overuse_penalty_start_1024th`]: Self::overuse_penalty_start_1024th
25622 uint64_t ScoringParameters_get_overuse_penalty_msat_per_1024th(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
25625 * A penalty applied, per whole 1024ths of the channel capacity which the amount being sent
25626 * over the channel exceeds [`overuse_penalty_start_1024th`] by.
25628 * Default value: 20 msat (i.e. 2560 msat penalty to use 1/4th of a channel, 7680 msat penalty
25629 * to use half a channel, and 12,560 msat penalty to use 3/4ths of a channel)
25631 * [`overuse_penalty_start_1024th`]: Self::overuse_penalty_start_1024th
25633 void ScoringParameters_set_overuse_penalty_msat_per_1024th(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
25636 * The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are
25639 * Successfully routing through a channel will immediately cut the penalty in half as well.
25641 * Default value: 1 hour
25645 * When built with the `no-std` feature, time will never elapse. Therefore, this penalty will
25648 * [`failure_penalty_msat`]: Self::failure_penalty_msat
25650 uint64_t ScoringParameters_get_failure_penalty_half_life(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
25653 * The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are
25656 * Successfully routing through a channel will immediately cut the penalty in half as well.
25658 * Default value: 1 hour
25662 * When built with the `no-std` feature, time will never elapse. Therefore, this penalty will
25665 * [`failure_penalty_msat`]: Self::failure_penalty_msat
25667 void ScoringParameters_set_failure_penalty_half_life(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
25670 * Constructs a new ScoringParameters given each field
25672 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);
25675 * Creates a copy of the ScoringParameters
25677 struct LDKScoringParameters ScoringParameters_clone(const struct LDKScoringParameters *NONNULL_PTR orig);
25680 * Serialize the ScoringParameters object into a byte array which can be read by ScoringParameters_read
25682 struct LDKCVec_u8Z ScoringParameters_write(const struct LDKScoringParameters *NONNULL_PTR obj);
25685 * Read a ScoringParameters from a byte array, created by ScoringParameters_write
25687 struct LDKCResult_ScoringParametersDecodeErrorZ ScoringParameters_read(struct LDKu8slice ser);
25690 * Creates a new scorer using the given scoring parameters.
25692 MUST_USE_RES struct LDKScorer Scorer_new(struct LDKScoringParameters params);
25695 * Creates a "default" Scorer. See struct and individual field documentaiton for details on which values are used.
25697 MUST_USE_RES struct LDKScorer Scorer_default(void);
25700 * Creates a "default" ScoringParameters. See struct and individual field documentaiton for details on which values are used.
25702 MUST_USE_RES struct LDKScoringParameters ScoringParameters_default(void);
25705 * Constructs a new Score which calls the relevant methods on this_arg.
25706 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
25708 struct LDKScore Scorer_as_Score(const struct LDKScorer *NONNULL_PTR this_arg);
25711 * Serialize the Scorer object into a byte array which can be read by Scorer_read
25713 struct LDKCVec_u8Z Scorer_write(const struct LDKScorer *NONNULL_PTR obj);
25716 * Read a Scorer from a byte array, created by Scorer_write
25718 struct LDKCResult_ScorerDecodeErrorZ Scorer_read(struct LDKu8slice ser);
25721 * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
25723 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
25726 * Frees any resources used by the ProbabilisticScoringParameters, if is_owned is set and inner is non-NULL.
25728 void ProbabilisticScoringParameters_free(struct LDKProbabilisticScoringParameters this_obj);
25731 * A fixed penalty in msats to apply to each channel.
25733 * Default value: 500 msat
25735 uint64_t ProbabilisticScoringParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
25738 * A fixed penalty in msats to apply to each channel.
25740 * Default value: 500 msat
25742 void ProbabilisticScoringParameters_set_base_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
25745 * A multiplier used in conjunction with the negative `log10` of the channel's success
25746 * probability for a payment to determine the liquidity penalty.
25748 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
25749 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
25750 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
25751 * lower bounding the success probability to `0.01`) when the amount falls within the
25752 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
25753 * result in a `u64::max_value` penalty, however.
25755 * Default value: 40,000 msat
25757 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
25759 uint64_t ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
25762 * A multiplier used in conjunction with the negative `log10` of the channel's success
25763 * probability for a payment to determine the liquidity penalty.
25765 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
25766 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
25767 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
25768 * lower bounding the success probability to `0.01`) when the amount falls within the
25769 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
25770 * result in a `u64::max_value` penalty, however.
25772 * Default value: 40,000 msat
25774 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
25776 void ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
25779 * The time required to elapse before any knowledge learned about channel liquidity balances is
25782 * The bounds are defined in terms of offsets and are initially zero. Increasing the offsets
25783 * gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases
25784 * the certainty of the channel liquidity balance.
25786 * Default value: 1 hour
25790 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
25791 * liquidity knowledge will never decay except when the bounds cross.
25793 uint64_t ProbabilisticScoringParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
25796 * The time required to elapse before any knowledge learned about channel liquidity balances is
25799 * The bounds are defined in terms of offsets and are initially zero. Increasing the offsets
25800 * gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases
25801 * the certainty of the channel liquidity balance.
25803 * Default value: 1 hour
25807 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
25808 * liquidity knowledge will never decay except when the bounds cross.
25810 void ProbabilisticScoringParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
25813 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
25814 * channel's success probability for the payment to determine the amount penalty.
25816 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
25817 * fees plus penalty) for large payments. The penalty is computed as the product of this
25818 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
25819 * success probability.
25821 * `-log10(success_probability) * amount_penalty_multiplier_msat * amount_msat / 2^20`
25823 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
25824 * the amount will result in a penalty of the multiplier. And, as the success probability
25825 * decreases, the negative `log10` weighting will increase dramatically. For higher success
25826 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
25829 * Default value: 256 msat
25831 uint64_t ProbabilisticScoringParameters_get_amount_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
25834 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
25835 * channel's success probability for the payment to determine the amount penalty.
25837 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
25838 * fees plus penalty) for large payments. The penalty is computed as the product of this
25839 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
25840 * success probability.
25842 * `-log10(success_probability) * amount_penalty_multiplier_msat * amount_msat / 2^20`
25844 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
25845 * the amount will result in a penalty of the multiplier. And, as the success probability
25846 * decreases, the negative `log10` weighting will increase dramatically. For higher success
25847 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
25850 * Default value: 256 msat
25852 void ProbabilisticScoringParameters_set_amount_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
25855 * Constructs a new ProbabilisticScoringParameters given each field
25857 MUST_USE_RES struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_new(uint64_t base_penalty_msat_arg, uint64_t liquidity_penalty_multiplier_msat_arg, uint64_t liquidity_offset_half_life_arg, uint64_t amount_penalty_multiplier_msat_arg);
25860 * Creates a copy of the ProbabilisticScoringParameters
25862 struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_clone(const struct LDKProbabilisticScoringParameters *NONNULL_PTR orig);
25865 * Creates a new scorer using the given scoring parameters for sending payments from a node
25866 * through a network graph.
25868 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringParameters params, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
25871 * Creates a "default" ProbabilisticScoringParameters. See struct and individual field documentaiton for details on which values are used.
25873 MUST_USE_RES struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_default(void);
25876 * Constructs a new Score which calls the relevant methods on this_arg.
25877 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
25879 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
25882 * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
25884 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
25887 * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
25889 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b);
25892 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
25894 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
25897 * Initialize a new FilesystemPersister and set the path to the individual channels'
25900 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
25903 * Get the directory which was provided when this persister was initialized.
25905 MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
25908 * Writes the provided `ChannelManager` to the path provided at `FilesystemPersister`
25909 * initialization, within a file called \"manager\".
25911 MUST_USE_RES struct LDKCResult_NoneErrorZ FilesystemPersister_persist_manager(struct LDKStr data_dir, const struct LDKChannelManager *NONNULL_PTR manager);
25914 * Write the provided `NetworkGraph` to the path provided at `FilesystemPersister`
25915 * initialization, within a file called \"network_graph\"
25917 MUST_USE_RES struct LDKCResult_NoneErrorZ FilesystemPersister_persist_network_graph(struct LDKStr data_dir, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
25920 * Read `ChannelMonitor`s from disk.
25922 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
25925 * Constructs a new Persist which calls the relevant methods on this_arg.
25926 * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
25928 struct LDKPersist FilesystemPersister_as_Persist(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
25931 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
25933 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
25936 * Calls the free function if one is set
25938 void Persister_free(struct LDKPersister this_ptr);
25941 * Start a background thread that takes care of responsibilities enumerated in the [top-level
25944 * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
25945 * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
25946 * either [`join`] or [`stop`].
25948 * # Data Persistence
25950 * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
25951 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
25952 * [`ChannelManager`]. See [`FilesystemPersister::persist_manager`] for Rust-Lightning's
25953 * provided implementation.
25955 * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk. See
25956 * [`NetworkGraph::write`] for writing out a [`NetworkGraph`]. See [`FilesystemPersister::persist_network_graph`]
25957 * for Rust-Lightning's provided implementation.
25959 * Typically, users should either implement [`Persister::persist_manager`] to never return an
25960 * error or call [`join`] and handle any error that may arise. For the latter case,
25961 * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
25965 * `event_handler` is responsible for handling events that users should be notified of (e.g.,
25966 * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
25967 * functionality implemented by other handlers.
25968 * * [`NetGraphMsgHandler`] if given will update the [`NetworkGraph`] based on payment failures.
25970 * [top-level documentation]: BackgroundProcessor
25971 * [`join`]: Self::join
25972 * [`stop`]: Self::stop
25973 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
25974 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
25975 * [`FilesystemPersister::persist_manager`]: lightning_persister::FilesystemPersister::persist_manager
25976 * [`FilesystemPersister::persist_network_graph`]: lightning_persister::FilesystemPersister::persist_network_graph
25977 * [`NetworkGraph`]: lightning::routing::network_graph::NetworkGraph
25978 * [`NetworkGraph::write`]: lightning::routing::network_graph::NetworkGraph#impl-Writeable
25980 * Note that net_graph_msg_handler (or a relevant inner pointer) may be NULL or all-0s to represent None
25982 MUST_USE_RES struct LDKBackgroundProcessor BackgroundProcessor_start(struct LDKPersister persister, struct LDKEventHandler event_handler, const struct LDKChainMonitor *NONNULL_PTR chain_monitor, const struct LDKChannelManager *NONNULL_PTR channel_manager, struct LDKNetGraphMsgHandler net_graph_msg_handler, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger);
25985 * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
25986 * [`ChannelManager`].
25990 * This function panics if the background thread has panicked such as while persisting or
25993 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
25995 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
25998 * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
25999 * [`ChannelManager`].
26003 * This function panics if the background thread has panicked such as while persisting or
26006 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
26008 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
26011 * Frees any resources used by the ParseError
26013 void ParseError_free(struct LDKParseError this_ptr);
26016 * Creates a copy of the ParseError
26018 struct LDKParseError ParseError_clone(const struct LDKParseError *NONNULL_PTR orig);
26021 * Utility method to constructs a new Bech32Error-variant ParseError
26023 struct LDKParseError ParseError_bech32_error(struct LDKBech32Error a);
26026 * Utility method to constructs a new ParseAmountError-variant ParseError
26028 struct LDKParseError ParseError_parse_amount_error(struct LDKError a);
26031 * Utility method to constructs a new MalformedSignature-variant ParseError
26033 struct LDKParseError ParseError_malformed_signature(enum LDKSecp256k1Error a);
26036 * Utility method to constructs a new BadPrefix-variant ParseError
26038 struct LDKParseError ParseError_bad_prefix(void);
26041 * Utility method to constructs a new UnknownCurrency-variant ParseError
26043 struct LDKParseError ParseError_unknown_currency(void);
26046 * Utility method to constructs a new UnknownSiPrefix-variant ParseError
26048 struct LDKParseError ParseError_unknown_si_prefix(void);
26051 * Utility method to constructs a new MalformedHRP-variant ParseError
26053 struct LDKParseError ParseError_malformed_hrp(void);
26056 * Utility method to constructs a new TooShortDataPart-variant ParseError
26058 struct LDKParseError ParseError_too_short_data_part(void);
26061 * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant ParseError
26063 struct LDKParseError ParseError_unexpected_end_of_tagged_fields(void);
26066 * Utility method to constructs a new DescriptionDecodeError-variant ParseError
26068 struct LDKParseError ParseError_description_decode_error(struct LDKError a);
26071 * Utility method to constructs a new PaddingError-variant ParseError
26073 struct LDKParseError ParseError_padding_error(void);
26076 * Utility method to constructs a new IntegerOverflowError-variant ParseError
26078 struct LDKParseError ParseError_integer_overflow_error(void);
26081 * Utility method to constructs a new InvalidSegWitProgramLength-variant ParseError
26083 struct LDKParseError ParseError_invalid_seg_wit_program_length(void);
26086 * Utility method to constructs a new InvalidPubKeyHashLength-variant ParseError
26088 struct LDKParseError ParseError_invalid_pub_key_hash_length(void);
26091 * Utility method to constructs a new InvalidScriptHashLength-variant ParseError
26093 struct LDKParseError ParseError_invalid_script_hash_length(void);
26096 * Utility method to constructs a new InvalidRecoveryId-variant ParseError
26098 struct LDKParseError ParseError_invalid_recovery_id(void);
26101 * Utility method to constructs a new InvalidSliceLength-variant ParseError
26103 struct LDKParseError ParseError_invalid_slice_length(struct LDKStr a);
26106 * Utility method to constructs a new Skip-variant ParseError
26108 struct LDKParseError ParseError_skip(void);
26111 * Frees any resources used by the ParseOrSemanticError
26113 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
26116 * Creates a copy of the ParseOrSemanticError
26118 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
26121 * Utility method to constructs a new ParseError-variant ParseOrSemanticError
26123 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKParseError a);
26126 * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
26128 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKSemanticError a);
26131 * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
26133 void Invoice_free(struct LDKInvoice this_obj);
26136 * Checks if two Invoices contain equal inner contents.
26137 * This ignores pointers and is_owned flags and looks at the values in fields.
26138 * Two objects with NULL inner values will be considered "equal" here.
26140 bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
26143 * Creates a copy of the Invoice
26145 struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
26148 * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
26150 void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
26153 * Checks if two SignedRawInvoices contain equal inner contents.
26154 * This ignores pointers and is_owned flags and looks at the values in fields.
26155 * Two objects with NULL inner values will be considered "equal" here.
26157 bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b);
26160 * Creates a copy of the SignedRawInvoice
26162 struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
26165 * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
26167 void RawInvoice_free(struct LDKRawInvoice this_obj);
26172 struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
26177 void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
26180 * Checks if two RawInvoices contain equal inner contents.
26181 * This ignores pointers and is_owned flags and looks at the values in fields.
26182 * Two objects with NULL inner values will be considered "equal" here.
26184 bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b);
26187 * Creates a copy of the RawInvoice
26189 struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
26192 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
26194 void RawDataPart_free(struct LDKRawDataPart this_obj);
26197 * generation time of the invoice
26199 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
26202 * generation time of the invoice
26204 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
26207 * Checks if two RawDataParts contain equal inner contents.
26208 * This ignores pointers and is_owned flags and looks at the values in fields.
26209 * Two objects with NULL inner values will be considered "equal" here.
26211 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
26214 * Creates a copy of the RawDataPart
26216 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
26219 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
26221 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
26224 * Checks if two PositiveTimestamps contain equal inner contents.
26225 * This ignores pointers and is_owned flags and looks at the values in fields.
26226 * Two objects with NULL inner values will be considered "equal" here.
26228 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
26231 * Creates a copy of the PositiveTimestamp
26233 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
26236 * Creates a copy of the SiPrefix
26238 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
26241 * Utility method to constructs a new Milli-variant SiPrefix
26243 enum LDKSiPrefix SiPrefix_milli(void);
26246 * Utility method to constructs a new Micro-variant SiPrefix
26248 enum LDKSiPrefix SiPrefix_micro(void);
26251 * Utility method to constructs a new Nano-variant SiPrefix
26253 enum LDKSiPrefix SiPrefix_nano(void);
26256 * Utility method to constructs a new Pico-variant SiPrefix
26258 enum LDKSiPrefix SiPrefix_pico(void);
26261 * Checks if two SiPrefixs contain equal inner contents.
26262 * This ignores pointers and is_owned flags and looks at the values in fields.
26264 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
26267 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
26268 * This is effectively 10^12 * the prefix multiplier
26270 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
26273 * Creates a copy of the Currency
26275 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
26278 * Utility method to constructs a new Bitcoin-variant Currency
26280 enum LDKCurrency Currency_bitcoin(void);
26283 * Utility method to constructs a new BitcoinTestnet-variant Currency
26285 enum LDKCurrency Currency_bitcoin_testnet(void);
26288 * Utility method to constructs a new Regtest-variant Currency
26290 enum LDKCurrency Currency_regtest(void);
26293 * Utility method to constructs a new Simnet-variant Currency
26295 enum LDKCurrency Currency_simnet(void);
26298 * Utility method to constructs a new Signet-variant Currency
26300 enum LDKCurrency Currency_signet(void);
26303 * Checks if two Currencys contain equal inner contents.
26305 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
26308 * Checks if two Currencys contain equal inner contents.
26309 * This ignores pointers and is_owned flags and looks at the values in fields.
26311 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
26314 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
26316 void Sha256_free(struct LDKSha256 this_obj);
26319 * Creates a copy of the Sha256
26321 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
26324 * Checks if two Sha256s contain equal inner contents.
26326 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
26329 * Checks if two Sha256s contain equal inner contents.
26330 * This ignores pointers and is_owned flags and looks at the values in fields.
26331 * Two objects with NULL inner values will be considered "equal" here.
26333 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
26336 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
26338 void Description_free(struct LDKDescription this_obj);
26341 * Creates a copy of the Description
26343 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
26346 * Checks if two Descriptions contain equal inner contents.
26348 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
26351 * Checks if two Descriptions contain equal inner contents.
26352 * This ignores pointers and is_owned flags and looks at the values in fields.
26353 * Two objects with NULL inner values will be considered "equal" here.
26355 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
26358 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
26360 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
26362 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
26364 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26367 * Constructs a new PayeePubKey given each field
26369 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
26372 * Creates a copy of the PayeePubKey
26374 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
26377 * Checks if two PayeePubKeys contain equal inner contents.
26379 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
26382 * Checks if two PayeePubKeys contain equal inner contents.
26383 * This ignores pointers and is_owned flags and looks at the values in fields.
26384 * Two objects with NULL inner values will be considered "equal" here.
26386 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
26389 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
26391 void ExpiryTime_free(struct LDKExpiryTime this_obj);
26394 * Creates a copy of the ExpiryTime
26396 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
26399 * Checks if two ExpiryTimes contain equal inner contents.
26401 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
26404 * Checks if two ExpiryTimes contain equal inner contents.
26405 * This ignores pointers and is_owned flags and looks at the values in fields.
26406 * Two objects with NULL inner values will be considered "equal" here.
26408 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
26411 * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
26413 void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
26415 uint64_t MinFinalCltvExpiry_get_a(const struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr);
26417 void MinFinalCltvExpiry_set_a(struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr, uint64_t val);
26420 * Constructs a new MinFinalCltvExpiry given each field
26422 MUST_USE_RES struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_new(uint64_t a_arg);
26425 * Creates a copy of the MinFinalCltvExpiry
26427 struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
26430 * Checks if two MinFinalCltvExpirys contain equal inner contents.
26432 uint64_t MinFinalCltvExpiry_hash(const struct LDKMinFinalCltvExpiry *NONNULL_PTR o);
26435 * Checks if two MinFinalCltvExpirys contain equal inner contents.
26436 * This ignores pointers and is_owned flags and looks at the values in fields.
26437 * Two objects with NULL inner values will be considered "equal" here.
26439 bool MinFinalCltvExpiry_eq(const struct LDKMinFinalCltvExpiry *NONNULL_PTR a, const struct LDKMinFinalCltvExpiry *NONNULL_PTR b);
26442 * Frees any resources used by the Fallback
26444 void Fallback_free(struct LDKFallback this_ptr);
26447 * Creates a copy of the Fallback
26449 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
26452 * Utility method to constructs a new SegWitProgram-variant Fallback
26454 struct LDKFallback Fallback_seg_wit_program(struct LDKu5 version, struct LDKCVec_u8Z program);
26457 * Utility method to constructs a new PubKeyHash-variant Fallback
26459 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
26462 * Utility method to constructs a new ScriptHash-variant Fallback
26464 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
26467 * Checks if two Fallbacks contain equal inner contents.
26469 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
26472 * Checks if two Fallbacks contain equal inner contents.
26473 * This ignores pointers and is_owned flags and looks at the values in fields.
26475 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
26478 * Frees any resources used by the InvoiceSignature, if is_owned is set and inner is non-NULL.
26480 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
26483 * Creates a copy of the InvoiceSignature
26485 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
26488 * Checks if two InvoiceSignatures contain equal inner contents.
26489 * This ignores pointers and is_owned flags and looks at the values in fields.
26490 * Two objects with NULL inner values will be considered "equal" here.
26492 bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b);
26495 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
26497 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
26500 * Creates a copy of the PrivateRoute
26502 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
26505 * Checks if two PrivateRoutes contain equal inner contents.
26507 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
26510 * Checks if two PrivateRoutes contain equal inner contents.
26511 * This ignores pointers and is_owned flags and looks at the values in fields.
26512 * Two objects with NULL inner values will be considered "equal" here.
26514 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
26517 * Disassembles the `SignedRawInvoice` into its three parts:
26519 * 2. hash of the raw invoice
26522 MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg);
26525 * The `RawInvoice` which was signed.
26527 MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
26530 * The hash of the `RawInvoice` that was signed.
26532 MUST_USE_RES const uint8_t (*SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32];
26535 * InvoiceSignature for the invoice.
26537 MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
26540 * Recovers the public key used for signing the invoice from the recoverable signature.
26542 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
26545 * Checks if the signature is valid for the included payee public key or if none exists if it's
26546 * valid for the recovered signature (which should always be true?).
26548 MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
26551 * Calculate the hash of the encoded `RawInvoice`
26553 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26557 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26559 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26563 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26565 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26569 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26571 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26575 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26577 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26581 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26583 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26587 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26589 MUST_USE_RES struct LDKMinFinalCltvExpiry RawInvoice_min_final_cltv_expiry(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26593 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26595 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26599 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26601 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26603 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawInvoice_private_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26605 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26607 MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg);
26610 * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
26612 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
26614 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
26617 * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
26618 * the range `0..=MAX_TIMESTAMP`.
26620 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
26622 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
26625 * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
26626 * `0..=MAX_TIMESTAMP`.
26628 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
26630 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
26633 * Returns the Unix timestamp representing the stored time
26635 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
26638 * Returns the duration of the stored time since the Unix epoch
26640 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
26643 * Returns the [`SystemTime`] representing the stored time
26645 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
26648 * Transform the `Invoice` into it's unchecked version
26650 MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg);
26653 * Check that the invoice is signed correctly and that key recovery works
26655 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
26658 * Constructs an `Invoice` from a `SignedRawInvoice` by checking all its invariants.
26660 * use lightning_invoice::*;
26662 * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
26663 * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
26664 * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
26665 * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
26666 * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
26667 * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
26668 * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
26669 * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
26670 * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
26671 * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
26672 * j5r6drg6k6zcqj0fcwg\";
26674 * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
26676 * assert!(Invoice::from_signed(signed).is_ok());
26679 MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice);
26682 * Returns the `Invoice`'s timestamp (should equal its creation time)
26684 MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg);
26687 * Returns the `Invoice`'s timestamp as a duration since the Unix epoch
26689 MUST_USE_RES uint64_t Invoice_duration_since_epoch(const struct LDKInvoice *NONNULL_PTR this_arg);
26692 * Returns the hash to which we will receive the preimage on completion of the payment
26694 MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
26697 * Get the payee's public key if one was included in the invoice
26699 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26701 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
26704 * Get the payment secret if one was included in the invoice
26706 MUST_USE_RES const uint8_t (*Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
26709 * Get the invoice features if they were included in the invoice
26711 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26713 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
26716 * Recover the payee's public key (only to be used if none was included in the invoice)
26718 MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
26721 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
26723 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
26726 * Returns whether the invoice has expired.
26728 MUST_USE_RES bool Invoice_is_expired(const struct LDKInvoice *NONNULL_PTR this_arg);
26731 * Returns whether the expiry time would pass at the given point in time.
26732 * `at_time` is the timestamp as a duration since the Unix epoch.
26734 MUST_USE_RES bool Invoice_would_expire(const struct LDKInvoice *NONNULL_PTR this_arg, uint64_t at_time);
26737 * Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
26738 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`].
26740 MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
26743 * Returns a list of all routes included in the invoice
26745 MUST_USE_RES struct LDKCVec_PrivateRouteZ Invoice_private_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
26748 * Returns a list of all routes included in the invoice as the underlying hints
26750 MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_route_hints(const struct LDKInvoice *NONNULL_PTR this_arg);
26753 * Returns the currency for which the invoice was issued
26755 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
26758 * Returns the amount if specified in the invoice as millisatoshis.
26760 MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_milli_satoshis(const struct LDKInvoice *NONNULL_PTR this_arg);
26763 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
26764 * returns `CreationError::DescriptionTooLong` otherwise
26766 * Please note that single characters may use more than one byte due to UTF8 encoding.
26768 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
26771 * Returns the underlying description `String`
26773 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
26776 * Construct an `ExpiryTime` from seconds.
26778 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
26781 * Construct an `ExpiryTime` from a `Duration`.
26783 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
26786 * Returns the expiry time in seconds
26788 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
26791 * Returns a reference to the underlying `Duration` (=expiry time)
26793 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
26796 * Creates a new (partial) route from a list of hops
26798 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
26801 * Returns the underlying list of hops
26803 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
26806 * Creates a copy of the CreationError
26808 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
26811 * Utility method to constructs a new DescriptionTooLong-variant CreationError
26813 enum LDKCreationError CreationError_description_too_long(void);
26816 * Utility method to constructs a new RouteTooLong-variant CreationError
26818 enum LDKCreationError CreationError_route_too_long(void);
26821 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
26823 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
26826 * Utility method to constructs a new InvalidAmount-variant CreationError
26828 enum LDKCreationError CreationError_invalid_amount(void);
26831 * Utility method to constructs a new MissingRouteHints-variant CreationError
26833 enum LDKCreationError CreationError_missing_route_hints(void);
26836 * Checks if two CreationErrors contain equal inner contents.
26837 * This ignores pointers and is_owned flags and looks at the values in fields.
26839 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
26842 * Get the string representation of a CreationError object
26844 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
26847 * Creates a copy of the SemanticError
26849 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
26852 * Utility method to constructs a new NoPaymentHash-variant SemanticError
26854 enum LDKSemanticError SemanticError_no_payment_hash(void);
26857 * Utility method to constructs a new MultiplePaymentHashes-variant SemanticError
26859 enum LDKSemanticError SemanticError_multiple_payment_hashes(void);
26862 * Utility method to constructs a new NoDescription-variant SemanticError
26864 enum LDKSemanticError SemanticError_no_description(void);
26867 * Utility method to constructs a new MultipleDescriptions-variant SemanticError
26869 enum LDKSemanticError SemanticError_multiple_descriptions(void);
26872 * Utility method to constructs a new NoPaymentSecret-variant SemanticError
26874 enum LDKSemanticError SemanticError_no_payment_secret(void);
26877 * Utility method to constructs a new MultiplePaymentSecrets-variant SemanticError
26879 enum LDKSemanticError SemanticError_multiple_payment_secrets(void);
26882 * Utility method to constructs a new InvalidFeatures-variant SemanticError
26884 enum LDKSemanticError SemanticError_invalid_features(void);
26887 * Utility method to constructs a new InvalidRecoveryId-variant SemanticError
26889 enum LDKSemanticError SemanticError_invalid_recovery_id(void);
26892 * Utility method to constructs a new InvalidSignature-variant SemanticError
26894 enum LDKSemanticError SemanticError_invalid_signature(void);
26897 * Utility method to constructs a new ImpreciseAmount-variant SemanticError
26899 enum LDKSemanticError SemanticError_imprecise_amount(void);
26902 * Checks if two SemanticErrors contain equal inner contents.
26903 * This ignores pointers and is_owned flags and looks at the values in fields.
26905 bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b);
26908 * Get the string representation of a SemanticError object
26910 struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
26913 * Frees any resources used by the SignOrCreationError
26915 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
26918 * Creates a copy of the SignOrCreationError
26920 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
26923 * Utility method to constructs a new SignError-variant SignOrCreationError
26925 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
26928 * Utility method to constructs a new CreationError-variant SignOrCreationError
26930 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
26933 * Checks if two SignOrCreationErrors contain equal inner contents.
26934 * This ignores pointers and is_owned flags and looks at the values in fields.
26936 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
26939 * Get the string representation of a SignOrCreationError object
26941 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
26944 * Frees any resources used by the InvoicePayer, if is_owned is set and inner is non-NULL.
26946 void InvoicePayer_free(struct LDKInvoicePayer this_obj);
26949 * Calls the free function if one is set
26951 void Payer_free(struct LDKPayer this_ptr);
26954 * Calls the free function if one is set
26956 void Router_free(struct LDKRouter this_ptr);
26959 * Frees any resources used by the RetryAttempts, if is_owned is set and inner is non-NULL.
26961 void RetryAttempts_free(struct LDKRetryAttempts this_obj);
26963 uintptr_t RetryAttempts_get_a(const struct LDKRetryAttempts *NONNULL_PTR this_ptr);
26965 void RetryAttempts_set_a(struct LDKRetryAttempts *NONNULL_PTR this_ptr, uintptr_t val);
26968 * Constructs a new RetryAttempts given each field
26970 MUST_USE_RES struct LDKRetryAttempts RetryAttempts_new(uintptr_t a_arg);
26973 * Creates a copy of the RetryAttempts
26975 struct LDKRetryAttempts RetryAttempts_clone(const struct LDKRetryAttempts *NONNULL_PTR orig);
26978 * Checks if two RetryAttemptss contain equal inner contents.
26979 * This ignores pointers and is_owned flags and looks at the values in fields.
26980 * Two objects with NULL inner values will be considered "equal" here.
26982 bool RetryAttempts_eq(const struct LDKRetryAttempts *NONNULL_PTR a, const struct LDKRetryAttempts *NONNULL_PTR b);
26985 * Checks if two RetryAttemptss contain equal inner contents.
26987 uint64_t RetryAttempts_hash(const struct LDKRetryAttempts *NONNULL_PTR o);
26990 * Frees any resources used by the PaymentError
26992 void PaymentError_free(struct LDKPaymentError this_ptr);
26995 * Creates a copy of the PaymentError
26997 struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig);
27000 * Utility method to constructs a new Invoice-variant PaymentError
27002 struct LDKPaymentError PaymentError_invoice(struct LDKStr a);
27005 * Utility method to constructs a new Routing-variant PaymentError
27007 struct LDKPaymentError PaymentError_routing(struct LDKLightningError a);
27010 * Utility method to constructs a new Sending-variant PaymentError
27012 struct LDKPaymentError PaymentError_sending(struct LDKPaymentSendFailure a);
27015 * Creates an invoice payer that retries failed payment paths.
27017 * Will forward any [`Event::PaymentPathFailed`] events to the decorated `event_handler` once
27018 * `retry_attempts` has been exceeded for a given [`Invoice`].
27020 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);
27023 * Pays the given [`Invoice`], caching it for later use in case a retry is needed.
27025 * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
27026 * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
27029 MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice);
27032 * Pays the given zero-value [`Invoice`] using the given amount, caching it for later use in
27033 * case a retry is needed.
27035 * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
27036 * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
27039 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);
27042 * Pays `pubkey` an amount using the hash of the given preimage, caching it for later use in
27043 * case a retry is needed.
27045 * You should ensure that `payment_preimage` is unique and that its `payment_hash` has never
27046 * been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so for you.
27048 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);
27051 * Removes the payment cached by the given payment hash.
27053 * Should be called once a payment has failed or succeeded if not using [`InvoicePayer`] as an
27054 * [`EventHandler`]. Otherwise, calling this method is unnecessary.
27056 void InvoicePayer_remove_cached_payment(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
27059 * Constructs a new EventHandler which calls the relevant methods on this_arg.
27060 * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
27062 struct LDKEventHandler InvoicePayer_as_EventHandler(const struct LDKInvoicePayer *NONNULL_PTR this_arg);
27065 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
27066 * See [`PhantomKeysManager`] for more information on phantom node payments.
27068 * `phantom_route_hints` parameter:
27069 * * Contains channel info for all nodes participating in the phantom invoice
27070 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
27071 * participating node
27072 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
27073 * updated when a channel becomes disabled or closes
27074 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
27075 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
27078 * `payment_hash` and `payment_secret` come from [`ChannelManager::create_inbound_payment`] or
27079 * [`ChannelManager::create_inbound_payment_for_hash`]. These values can be retrieved from any
27080 * participating node.
27082 * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom
27083 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
27086 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
27087 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
27088 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
27090 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);
27093 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
27094 * See [`PhantomKeysManager`] for more information on phantom node payments.
27096 * `phantom_route_hints` parameter:
27097 * * Contains channel info for all nodes participating in the phantom invoice
27098 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
27099 * participating node
27100 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
27101 * updated when a channel becomes disabled or closes
27102 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
27103 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
27106 * `description_hash` is a SHA-256 hash of the description text
27108 * `payment_hash` and `payment_secret` come from [`ChannelManager::create_inbound_payment`] or
27109 * [`ChannelManager::create_inbound_payment_for_hash`]. These values can be retrieved from any
27110 * participating node.
27112 * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom
27113 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
27116 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
27117 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
27118 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
27120 struct LDKCResult_InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKKeysInterface keys_manager, enum LDKCurrency network);
27123 * Utility to construct an invoice. Generally, unless you want to do something like a custom
27124 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
27125 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
27126 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
27127 * that the payment secret is valid when the invoice is paid.
27129 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);
27132 * Utility to construct an invoice. Generally, unless you want to do something like a custom
27133 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
27134 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
27135 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
27136 * that the payment secret is valid when the invoice is paid.
27137 * Use this variant if you want to pass the `description_hash` to the invoice.
27139 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash);
27142 * See [`create_invoice_from_channelmanager_with_description_hash`]
27143 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
27144 * available and the current time is supplied by the caller.
27146 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint64_t duration_since_epoch);
27149 * See [`create_invoice_from_channelmanager`]
27150 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
27151 * available and the current time is supplied by the caller.
27153 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);
27156 * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
27158 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
27161 * Creates a new router using the given [`NetworkGraph`], a [`Logger`], and a randomness source
27162 * `random_seed_bytes`.
27164 MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, struct LDKThirtyTwoBytes random_seed_bytes);
27167 * Constructs a new Router which calls the relevant methods on this_arg.
27168 * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
27170 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
27173 * Constructs a new Payer which calls the relevant methods on this_arg.
27174 * This copies the `inner` pointer in this_arg and thus the returned Payer must be freed before this_arg is
27176 struct LDKPayer ChannelManager_as_Payer(const struct LDKChannelManager *NONNULL_PTR this_arg);
27179 * Read a SiPrefix object from a string
27181 struct LDKCResult_SiPrefixParseErrorZ SiPrefix_from_str(struct LDKStr s);
27184 * Read a Invoice object from a string
27186 struct LDKCResult_InvoiceParseOrSemanticErrorZ Invoice_from_str(struct LDKStr s);
27189 * Read a SignedRawInvoice object from a string
27191 struct LDKCResult_SignedRawInvoiceParseErrorZ SignedRawInvoice_from_str(struct LDKStr s);
27194 * Get the string representation of a ParseError object
27196 struct LDKStr ParseError_to_str(const struct LDKParseError *NONNULL_PTR o);
27199 * Get the string representation of a ParseOrSemanticError object
27201 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
27204 * Get the string representation of a Invoice object
27206 struct LDKStr Invoice_to_str(const struct LDKInvoice *NONNULL_PTR o);
27209 * Get the string representation of a SignedRawInvoice object
27211 struct LDKStr SignedRawInvoice_to_str(const struct LDKSignedRawInvoice *NONNULL_PTR o);
27214 * Get the string representation of a Currency object
27216 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
27219 * Get the string representation of a SiPrefix object
27221 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
27223 #endif /* LDK_C_BINDINGS_H */
27225 #include "ldk_ver.h"