1 #ifndef LDK_C_BINDINGS_H
2 #define LDK_C_BINDINGS_H
4 /* Generated with cbindgen:0.19.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 error enum representing a failure to persist a channel monitor update.
34 typedef enum LDKChannelMonitorUpdateErr {
36 * Used to indicate a temporary failure (eg connection to a watchtower or remote backup of
37 * our state failed, but is expected to succeed at some point in the future).
39 * Such a failure will \"freeze\" a channel, preventing us from revoking old states or
40 * submitting new commitment transactions to the counterparty. Once the update(s) which failed
41 * have been successfully applied, ChannelManager::channel_monitor_updated can be used to
42 * restore the channel to an operational state.
44 * Note that a given ChannelManager will *never* re-generate a given ChannelMonitorUpdate. If
45 * you return a TemporaryFailure you must ensure that it is written to disk safely before
46 * writing out the latest ChannelManager state.
48 * Even when a channel has been \"frozen\" updates to the ChannelMonitor can continue to occur
49 * (eg if an inbound HTLC which we forwarded was claimed upstream resulting in us attempting
50 * to claim it on this channel) and those updates must be applied wherever they can be. At
51 * least one such updated ChannelMonitor must be persisted otherwise PermanentFailure should
52 * be returned to get things on-chain ASAP using only the in-memory copy. Obviously updates to
53 * the channel which would invalidate previous ChannelMonitors are not made when a channel has
56 * Note that even if updates made after TemporaryFailure succeed you must still call
57 * channel_monitor_updated to ensure you have the latest monitor and re-enable normal channel
60 * Note that the update being processed here will not be replayed for you when you call
61 * ChannelManager::channel_monitor_updated, so you must store the update itself along
62 * with the persisted ChannelMonitor on your own local disk prior to returning a
63 * TemporaryFailure. You may, of course, employ a journaling approach, storing only the
64 * ChannelMonitorUpdate on disk without updating the monitor itself, replaying the journal at
67 * For deployments where a copy of ChannelMonitors and other local state are backed up in a
68 * remote location (with local copies persisted immediately), it is anticipated that all
69 * updates will return TemporaryFailure until the remote copies could be updated.
71 LDKChannelMonitorUpdateErr_TemporaryFailure,
73 * Used to indicate no further channel monitor updates will be allowed (eg we've moved on to a
74 * different watchtower and cannot update with all watchtowers that were previously informed
77 * At reception of this error, ChannelManager will force-close the channel and return at
78 * least a final ChannelMonitorUpdate::ChannelForceClosed which must be delivered to at
79 * least one ChannelMonitor copy. Revocation secret MUST NOT be released and offchain channel
80 * update must be rejected.
82 * This failure may also signal a failure to update the local persisted copy of one of
83 * the channel monitor instance.
85 * Note that even when you fail a holder commitment transaction update, you must store the
86 * update to ensure you can claim from it in case of a duplicate copy of this ChannelMonitor
87 * broadcasts it (e.g distributed channel-monitor deployment)
89 * In case of distributed watchtowers deployment, the new version must be written to disk, as
90 * state may have been stored but rejected due to a block forcing a commitment broadcast. This
91 * storage is used to claim outputs of rejected state confirmed onchain by another watchtower,
92 * lagging behind on block processing.
94 LDKChannelMonitorUpdateErr_PermanentFailure,
96 * Must be last for serialization purposes
98 LDKChannelMonitorUpdateErr_Sentinel,
99 } LDKChannelMonitorUpdateErr;
102 * An enum that represents the speed at which we want a transaction to confirm used for feerate
105 typedef enum LDKConfirmationTarget {
107 * We are happy with this transaction confirming slowly when feerate drops some.
109 LDKConfirmationTarget_Background,
111 * We'd like this transaction to confirm without major delay, but 12-18 blocks is fine.
113 LDKConfirmationTarget_Normal,
115 * We'd like this transaction to confirm in the next few blocks.
117 LDKConfirmationTarget_HighPriority,
119 * Must be last for serialization purposes
121 LDKConfirmationTarget_Sentinel,
122 } LDKConfirmationTarget;
125 * Errors that may occur when constructing a new `RawInvoice` or `Invoice`
127 typedef enum LDKCreationError {
129 * The supplied description string was longer than 639 __bytes__ (see [`Description::new(…)`](./struct.Description.html#method.new))
131 LDKCreationError_DescriptionTooLong,
133 * The specified route has too many hops and can't be encoded
135 LDKCreationError_RouteTooLong,
137 * The unix timestamp of the supplied date is <0 or can't be represented as `SystemTime`
139 LDKCreationError_TimestampOutOfBounds,
141 * The supplied expiry time could cause an overflow if added to a `PositiveTimestamp`
143 LDKCreationError_ExpiryTimeOutOfBounds,
145 * Must be last for serialization purposes
147 LDKCreationError_Sentinel,
151 * Enum representing the crypto currencies (or networks) supported by this library
153 typedef enum LDKCurrency {
161 LDKCurrency_BitcoinTestnet,
175 * Must be last for serialization purposes
177 LDKCurrency_Sentinel,
181 * Represents an IO Error. Note that some information is lost in the conversion from Rust.
183 typedef enum LDKIOError {
185 LDKIOError_PermissionDenied,
186 LDKIOError_ConnectionRefused,
187 LDKIOError_ConnectionReset,
188 LDKIOError_ConnectionAborted,
189 LDKIOError_NotConnected,
190 LDKIOError_AddrInUse,
191 LDKIOError_AddrNotAvailable,
192 LDKIOError_BrokenPipe,
193 LDKIOError_AlreadyExists,
194 LDKIOError_WouldBlock,
195 LDKIOError_InvalidInput,
196 LDKIOError_InvalidData,
198 LDKIOError_WriteZero,
199 LDKIOError_Interrupted,
201 LDKIOError_UnexpectedEof,
203 * Must be last for serialization purposes
209 * An enum representing the available verbosity levels of the logger.
211 typedef enum LDKLevel {
213 * Designates very low priority, often extremely verbose, information
217 * Designates lower priority information
221 * Designates useful information
225 * Designates hazardous situations
229 * Designates very serious errors
233 * Must be last for serialization purposes
239 * An enum representing the possible Bitcoin or test networks which we can run on
241 typedef enum LDKNetwork {
243 * The main Bitcoin blockchain.
247 * The testnet3 blockchain.
251 * A local test blockchain.
255 * A blockchain on which blocks are signed instead of mined.
259 * Must be last for serialization purposes
265 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
267 typedef enum LDKSecp256k1Error {
269 * Signature failed verification
271 LDKSecp256k1Error_IncorrectSignature,
273 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
275 LDKSecp256k1Error_InvalidMessage,
279 LDKSecp256k1Error_InvalidPublicKey,
283 LDKSecp256k1Error_InvalidSignature,
287 LDKSecp256k1Error_InvalidSecretKey,
291 LDKSecp256k1Error_InvalidRecoveryId,
293 * Invalid tweak for add_assign or mul_assign
295 LDKSecp256k1Error_InvalidTweak,
297 * tweak_add_check failed on an xonly public key
299 LDKSecp256k1Error_TweakCheckFailed,
301 * Didn't pass enough memory to context creation with preallocated memory
303 LDKSecp256k1Error_NotEnoughMemory,
305 * Must be last for serialization purposes
307 LDKSecp256k1Error_Sentinel,
311 * Errors that may occur when converting a `RawInvoice` to an `Invoice`. They relate to the
312 * requirements sections in BOLT #11
314 typedef enum LDKSemanticError {
316 * The invoice is missing the mandatory payment hash
318 LDKSemanticError_NoPaymentHash,
320 * The invoice has multiple payment hashes which isn't allowed
322 LDKSemanticError_MultiplePaymentHashes,
324 * No description or description hash are part of the invoice
326 LDKSemanticError_NoDescription,
328 * The invoice contains multiple descriptions and/or description hashes which isn't allowed
330 LDKSemanticError_MultipleDescriptions,
332 * The invoice contains multiple payment secrets
334 LDKSemanticError_MultiplePaymentSecrets,
336 * The invoice's features are invalid
338 LDKSemanticError_InvalidFeatures,
340 * The recovery id doesn't fit the signature/pub key
342 LDKSemanticError_InvalidRecoveryId,
344 * The invoice's signature is invalid
346 LDKSemanticError_InvalidSignature,
348 * Must be last for serialization purposes
350 LDKSemanticError_Sentinel,
354 * SI prefixes for the human readable part
356 typedef enum LDKSiPrefix {
374 * Must be last for serialization purposes
376 LDKSiPrefix_Sentinel,
380 * A Rust str object, ie a reference to a UTF8-valid string.
381 * This is *not* null-terminated so cannot be used directly as a C string!
383 typedef struct LDKStr {
385 * A pointer to the string's bytes, in UTF8 encoding
387 const uint8_t *chars;
389 * The number of bytes (not characters!) pointed to by `chars`
393 * Whether the data pointed to by `chars` should be freed or not.
399 * A serialized transaction, in (pointer, length) form.
401 * This type optionally owns its own memory, and thus the semantics around access change based on
402 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
403 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
404 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
405 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
406 * you would be invalid.
408 * Note that, while it may change in the future, because transactions on the Rust side are stored
409 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
410 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
411 * `data_is_owned` either set or unset at your discretion.
413 typedef struct LDKTransaction {
415 * The serialized transaction data.
417 * This is non-const for your convenience, an object passed to Rust is never written to.
421 * The length of the serialized transaction
425 * Whether the data pointed to by `data` should be freed or not.
431 * A dynamically-allocated array of u8s of arbitrary size.
432 * This corresponds to std::vector in C++
434 typedef struct LDKCVec_u8Z {
436 * The elements in the array.
437 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
441 * The number of elements pointed to by `data`.
447 * A transaction output including a scriptPubKey and value.
448 * This type *does* own its own memory, so must be free'd appropriately.
450 typedef struct LDKTxOut {
452 * The script_pubkey in this output
454 struct LDKCVec_u8Z script_pubkey;
456 * The value, in satoshis, of this output
462 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
464 typedef struct LDKSecretKey {
466 * The bytes of the secret key
472 * The contents of CResult_SecretKeyErrorZ
474 typedef union LDKCResult_SecretKeyErrorZPtr {
476 * A pointer to the contents in the success state.
477 * Reading from this pointer when `result_ok` is not set is undefined.
479 struct LDKSecretKey *result;
481 * A pointer to the contents in the error state.
482 * Reading from this pointer when `result_ok` is set is undefined.
484 enum LDKSecp256k1Error *err;
485 } LDKCResult_SecretKeyErrorZPtr;
488 * A CResult_SecretKeyErrorZ represents the result of a fallible operation,
489 * containing a crate::c_types::SecretKey on success and a crate::c_types::Secp256k1Error on failure.
490 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
492 typedef struct LDKCResult_SecretKeyErrorZ {
494 * The contents of this CResult_SecretKeyErrorZ, accessible via either
495 * `err` or `result` depending on the state of `result_ok`.
497 union LDKCResult_SecretKeyErrorZPtr contents;
499 * Whether this CResult_SecretKeyErrorZ represents a success state.
502 } LDKCResult_SecretKeyErrorZ;
505 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
507 typedef struct LDKPublicKey {
509 * The bytes of the public key
511 uint8_t compressed_form[33];
515 * The contents of CResult_PublicKeyErrorZ
517 typedef union LDKCResult_PublicKeyErrorZPtr {
519 * A pointer to the contents in the success state.
520 * Reading from this pointer when `result_ok` is not set is undefined.
522 struct LDKPublicKey *result;
524 * A pointer to the contents in the error state.
525 * Reading from this pointer when `result_ok` is set is undefined.
527 enum LDKSecp256k1Error *err;
528 } LDKCResult_PublicKeyErrorZPtr;
531 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
532 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
533 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
535 typedef struct LDKCResult_PublicKeyErrorZ {
537 * The contents of this CResult_PublicKeyErrorZ, accessible via either
538 * `err` or `result` depending on the state of `result_ok`.
540 union LDKCResult_PublicKeyErrorZPtr contents;
542 * Whether this CResult_PublicKeyErrorZ represents a success state.
545 } LDKCResult_PublicKeyErrorZ;
550 * The set of public keys which are used in the creation of one commitment transaction.
551 * These are derived from the channel base keys and per-commitment data.
553 * A broadcaster key is provided from potential broadcaster of the computed transaction.
554 * A countersignatory key is coming from a protocol participant unable to broadcast the
557 * These keys are assumed to be good, either because the code derived them from
558 * channel basepoints via the new function, or they were obtained via
559 * CommitmentTransaction.trust().keys() because we trusted the source of the
560 * pre-calculated keys.
562 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
564 * A pointer to the opaque Rust object.
565 * Nearly everywhere, inner must be non-null, however in places where
566 * the Rust equivalent takes an Option, it may be set to null to indicate None.
568 LDKnativeTxCreationKeys *inner;
570 * Indicates that this is the only struct which contains the same pointer.
571 * Rust functions which take ownership of an object provided via an argument require
572 * this to be true and invalidate the object pointed to by inner.
580 * An error in decoding a message or struct.
582 typedef struct MUST_USE_STRUCT LDKDecodeError {
584 * A pointer to the opaque Rust object.
585 * Nearly everywhere, inner must be non-null, however in places where
586 * the Rust equivalent takes an Option, it may be set to null to indicate None.
588 LDKnativeDecodeError *inner;
590 * Indicates that this is the only struct which contains the same pointer.
591 * Rust functions which take ownership of an object provided via an argument require
592 * this to be true and invalidate the object pointed to by inner.
598 * The contents of CResult_TxCreationKeysDecodeErrorZ
600 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
602 * A pointer to the contents in the success state.
603 * Reading from this pointer when `result_ok` is not set is undefined.
605 struct LDKTxCreationKeys *result;
607 * A pointer to the contents in the error state.
608 * Reading from this pointer when `result_ok` is set is undefined.
610 struct LDKDecodeError *err;
611 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
614 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
615 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
616 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
618 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
620 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
621 * `err` or `result` depending on the state of `result_ok`.
623 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
625 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
628 } LDKCResult_TxCreationKeysDecodeErrorZ;
633 * One counterparty's public keys which do not change over the life of a channel.
635 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
637 * A pointer to the opaque Rust object.
638 * Nearly everywhere, inner must be non-null, however in places where
639 * the Rust equivalent takes an Option, it may be set to null to indicate None.
641 LDKnativeChannelPublicKeys *inner;
643 * Indicates that this is the only struct which contains the same pointer.
644 * Rust functions which take ownership of an object provided via an argument require
645 * this to be true and invalidate the object pointed to by inner.
648 } LDKChannelPublicKeys;
651 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
653 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
655 * A pointer to the contents in the success state.
656 * Reading from this pointer when `result_ok` is not set is undefined.
658 struct LDKChannelPublicKeys *result;
660 * A pointer to the contents in the error state.
661 * Reading from this pointer when `result_ok` is set is undefined.
663 struct LDKDecodeError *err;
664 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
667 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
668 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
669 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
671 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
673 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
674 * `err` or `result` depending on the state of `result_ok`.
676 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
678 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
681 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
684 * The contents of CResult_TxCreationKeysErrorZ
686 typedef union LDKCResult_TxCreationKeysErrorZPtr {
688 * A pointer to the contents in the success state.
689 * Reading from this pointer when `result_ok` is not set is undefined.
691 struct LDKTxCreationKeys *result;
693 * A pointer to the contents in the error state.
694 * Reading from this pointer when `result_ok` is set is undefined.
696 enum LDKSecp256k1Error *err;
697 } LDKCResult_TxCreationKeysErrorZPtr;
700 * A CResult_TxCreationKeysErrorZ represents the result of a fallible operation,
701 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::c_types::Secp256k1Error on failure.
702 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
704 typedef struct LDKCResult_TxCreationKeysErrorZ {
706 * The contents of this CResult_TxCreationKeysErrorZ, accessible via either
707 * `err` or `result` depending on the state of `result_ok`.
709 union LDKCResult_TxCreationKeysErrorZPtr contents;
711 * Whether this CResult_TxCreationKeysErrorZ represents a success state.
714 } LDKCResult_TxCreationKeysErrorZ;
717 * An enum which can either contain a u32 or not
719 typedef enum LDKCOption_u32Z_Tag {
721 * When we're in this state, this COption_u32Z contains a u32
723 LDKCOption_u32Z_Some,
725 * When we're in this state, this COption_u32Z contains nothing
727 LDKCOption_u32Z_None,
729 * Must be last for serialization purposes
731 LDKCOption_u32Z_Sentinel,
732 } LDKCOption_u32Z_Tag;
734 typedef struct LDKCOption_u32Z {
735 LDKCOption_u32Z_Tag tag;
746 * Information about an HTLC as it appears in a commitment transaction
748 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
750 * A pointer to the opaque Rust object.
751 * Nearly everywhere, inner must be non-null, however in places where
752 * the Rust equivalent takes an Option, it may be set to null to indicate None.
754 LDKnativeHTLCOutputInCommitment *inner;
756 * Indicates that this is the only struct which contains the same pointer.
757 * Rust functions which take ownership of an object provided via an argument require
758 * this to be true and invalidate the object pointed to by inner.
761 } LDKHTLCOutputInCommitment;
764 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
766 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
768 * A pointer to the contents in the success state.
769 * Reading from this pointer when `result_ok` is not set is undefined.
771 struct LDKHTLCOutputInCommitment *result;
773 * A pointer to the contents in the error state.
774 * Reading from this pointer when `result_ok` is set is undefined.
776 struct LDKDecodeError *err;
777 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
780 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
781 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
782 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
784 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
786 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
787 * `err` or `result` depending on the state of `result_ok`.
789 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
791 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
794 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
799 * Late-bound per-channel counterparty data used to build transactions.
801 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
803 * A pointer to the opaque Rust object.
804 * Nearly everywhere, inner must be non-null, however in places where
805 * the Rust equivalent takes an Option, it may be set to null to indicate None.
807 LDKnativeCounterpartyChannelTransactionParameters *inner;
809 * Indicates that this is the only struct which contains the same pointer.
810 * Rust functions which take ownership of an object provided via an argument require
811 * this to be true and invalidate the object pointed to by inner.
814 } LDKCounterpartyChannelTransactionParameters;
817 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
819 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
821 * A pointer to the contents in the success state.
822 * Reading from this pointer when `result_ok` is not set is undefined.
824 struct LDKCounterpartyChannelTransactionParameters *result;
826 * A pointer to the contents in the error state.
827 * Reading from this pointer when `result_ok` is set is undefined.
829 struct LDKDecodeError *err;
830 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
833 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
834 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
835 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
837 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
839 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
840 * `err` or `result` depending on the state of `result_ok`.
842 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
844 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
847 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
852 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
853 * The fields are organized by holder/counterparty.
855 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
856 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
858 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
860 * A pointer to the opaque Rust object.
861 * Nearly everywhere, inner must be non-null, however in places where
862 * the Rust equivalent takes an Option, it may be set to null to indicate None.
864 LDKnativeChannelTransactionParameters *inner;
866 * Indicates that this is the only struct which contains the same pointer.
867 * Rust functions which take ownership of an object provided via an argument require
868 * this to be true and invalidate the object pointed to by inner.
871 } LDKChannelTransactionParameters;
874 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
876 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
878 * A pointer to the contents in the success state.
879 * Reading from this pointer when `result_ok` is not set is undefined.
881 struct LDKChannelTransactionParameters *result;
883 * A pointer to the contents in the error state.
884 * Reading from this pointer when `result_ok` is set is undefined.
886 struct LDKDecodeError *err;
887 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
890 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
891 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
892 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
894 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
896 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
897 * `err` or `result` depending on the state of `result_ok`.
899 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
901 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
904 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
907 * Represents a secp256k1 signature serialized as two 32-byte numbers
909 typedef struct LDKSignature {
911 * The bytes of the signature in "compact" form
913 uint8_t compact_form[64];
917 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
918 * This corresponds to std::vector in C++
920 typedef struct LDKCVec_SignatureZ {
922 * The elements in the array.
923 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
925 struct LDKSignature *data;
927 * The number of elements pointed to by `data`.
930 } LDKCVec_SignatureZ;
935 * Information needed to build and sign a holder's commitment transaction.
937 * The transaction is only signed once we are ready to broadcast.
939 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
941 * A pointer to the opaque Rust object.
942 * Nearly everywhere, inner must be non-null, however in places where
943 * the Rust equivalent takes an Option, it may be set to null to indicate None.
945 LDKnativeHolderCommitmentTransaction *inner;
947 * Indicates that this is the only struct which contains the same pointer.
948 * Rust functions which take ownership of an object provided via an argument require
949 * this to be true and invalidate the object pointed to by inner.
952 } LDKHolderCommitmentTransaction;
955 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
957 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
959 * A pointer to the contents in the success state.
960 * Reading from this pointer when `result_ok` is not set is undefined.
962 struct LDKHolderCommitmentTransaction *result;
964 * A pointer to the contents in the error state.
965 * Reading from this pointer when `result_ok` is set is undefined.
967 struct LDKDecodeError *err;
968 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
971 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
972 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
973 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
975 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
977 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
978 * `err` or `result` depending on the state of `result_ok`.
980 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
982 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
985 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
990 * A pre-built Bitcoin commitment transaction and its txid.
992 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
994 * A pointer to the opaque Rust object.
995 * Nearly everywhere, inner must be non-null, however in places where
996 * the Rust equivalent takes an Option, it may be set to null to indicate None.
998 LDKnativeBuiltCommitmentTransaction *inner;
1000 * Indicates that this is the only struct which contains the same pointer.
1001 * Rust functions which take ownership of an object provided via an argument require
1002 * this to be true and invalidate the object pointed to by inner.
1005 } LDKBuiltCommitmentTransaction;
1008 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
1010 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
1012 * A pointer to the contents in the success state.
1013 * Reading from this pointer when `result_ok` is not set is undefined.
1015 struct LDKBuiltCommitmentTransaction *result;
1017 * A pointer to the contents in the error state.
1018 * Reading from this pointer when `result_ok` is set is undefined.
1020 struct LDKDecodeError *err;
1021 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
1024 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1025 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1026 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1028 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
1030 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
1031 * `err` or `result` depending on the state of `result_ok`.
1033 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
1035 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
1038 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
1043 * This class tracks the per-transaction information needed to build a commitment transaction and to
1044 * actually build it and sign. It is used for holder transactions that we sign only when needed
1045 * and for transactions we sign for the counterparty.
1047 * This class can be used inside a signer implementation to generate a signature given the relevant
1050 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
1052 * A pointer to the opaque Rust object.
1053 * Nearly everywhere, inner must be non-null, however in places where
1054 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1056 LDKnativeCommitmentTransaction *inner;
1058 * Indicates that this is the only struct which contains the same pointer.
1059 * Rust functions which take ownership of an object provided via an argument require
1060 * this to be true and invalidate the object pointed to by inner.
1063 } LDKCommitmentTransaction;
1066 * The contents of CResult_CommitmentTransactionDecodeErrorZ
1068 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
1070 * A pointer to the contents in the success state.
1071 * Reading from this pointer when `result_ok` is not set is undefined.
1073 struct LDKCommitmentTransaction *result;
1075 * A pointer to the contents in the error state.
1076 * Reading from this pointer when `result_ok` is set is undefined.
1078 struct LDKDecodeError *err;
1079 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
1082 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1083 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1084 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1086 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
1088 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
1089 * `err` or `result` depending on the state of `result_ok`.
1091 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
1093 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
1096 } LDKCResult_CommitmentTransactionDecodeErrorZ;
1101 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
1102 * transaction and the transaction creation keys) are trusted.
1104 * See trust() and verify() functions on CommitmentTransaction.
1106 * This structure implements Deref.
1108 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
1110 * A pointer to the opaque Rust object.
1111 * Nearly everywhere, inner must be non-null, however in places where
1112 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1114 LDKnativeTrustedCommitmentTransaction *inner;
1116 * Indicates that this is the only struct which contains the same pointer.
1117 * Rust functions which take ownership of an object provided via an argument require
1118 * this to be true and invalidate the object pointed to by inner.
1121 } LDKTrustedCommitmentTransaction;
1124 * The contents of CResult_TrustedCommitmentTransactionNoneZ
1126 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
1128 * A pointer to the contents in the success state.
1129 * Reading from this pointer when `result_ok` is not set is undefined.
1131 struct LDKTrustedCommitmentTransaction *result;
1133 * Note that this value is always NULL, as there are no contents in the Err variant
1136 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
1139 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
1140 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
1141 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1143 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
1145 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
1146 * `err` or `result` depending on the state of `result_ok`.
1148 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
1150 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
1153 } LDKCResult_TrustedCommitmentTransactionNoneZ;
1156 * The contents of CResult_CVec_SignatureZNoneZ
1158 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
1160 * A pointer to the contents in the success state.
1161 * Reading from this pointer when `result_ok` is not set is undefined.
1163 struct LDKCVec_SignatureZ *result;
1165 * Note that this value is always NULL, as there are no contents in the Err variant
1168 } LDKCResult_CVec_SignatureZNoneZPtr;
1171 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
1172 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
1173 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1175 typedef struct LDKCResult_CVec_SignatureZNoneZ {
1177 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
1178 * `err` or `result` depending on the state of `result_ok`.
1180 union LDKCResult_CVec_SignatureZNoneZPtr contents;
1182 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
1185 } LDKCResult_CVec_SignatureZNoneZ;
1190 * A script pubkey for shutting down a channel as defined by [BOLT #2].
1192 * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md
1194 typedef struct MUST_USE_STRUCT LDKShutdownScript {
1196 * A pointer to the opaque Rust object.
1197 * Nearly everywhere, inner must be non-null, however in places where
1198 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1200 LDKnativeShutdownScript *inner;
1202 * Indicates that this is the only struct which contains the same pointer.
1203 * Rust functions which take ownership of an object provided via an argument require
1204 * this to be true and invalidate the object pointed to by inner.
1207 } LDKShutdownScript;
1210 * The contents of CResult_ShutdownScriptDecodeErrorZ
1212 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
1214 * A pointer to the contents in the success state.
1215 * Reading from this pointer when `result_ok` is not set is undefined.
1217 struct LDKShutdownScript *result;
1219 * A pointer to the contents in the error state.
1220 * Reading from this pointer when `result_ok` is set is undefined.
1222 struct LDKDecodeError *err;
1223 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
1226 * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
1227 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
1228 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1230 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
1232 * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
1233 * `err` or `result` depending on the state of `result_ok`.
1235 union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
1237 * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
1240 } LDKCResult_ShutdownScriptDecodeErrorZ;
1245 * An error occurring when converting from [`Script`] to [`ShutdownScript`].
1247 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
1249 * A pointer to the opaque Rust object.
1250 * Nearly everywhere, inner must be non-null, however in places where
1251 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1253 LDKnativeInvalidShutdownScript *inner;
1255 * Indicates that this is the only struct which contains the same pointer.
1256 * Rust functions which take ownership of an object provided via an argument require
1257 * this to be true and invalidate the object pointed to by inner.
1260 } LDKInvalidShutdownScript;
1263 * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
1265 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
1267 * A pointer to the contents in the success state.
1268 * Reading from this pointer when `result_ok` is not set is undefined.
1270 struct LDKShutdownScript *result;
1272 * A pointer to the contents in the error state.
1273 * Reading from this pointer when `result_ok` is set is undefined.
1275 struct LDKInvalidShutdownScript *err;
1276 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
1279 * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
1280 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
1281 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1283 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
1285 * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
1286 * `err` or `result` depending on the state of `result_ok`.
1288 union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
1290 * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
1293 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
1296 * The contents of CResult_NoneErrorZ
1298 typedef union LDKCResult_NoneErrorZPtr {
1300 * Note that this value is always NULL, as there are no contents in the OK variant
1304 * A pointer to the contents in the error state.
1305 * Reading from this pointer when `result_ok` is set is undefined.
1307 enum LDKIOError *err;
1308 } LDKCResult_NoneErrorZPtr;
1311 * A CResult_NoneErrorZ represents the result of a fallible operation,
1312 * containing a () on success and a crate::c_types::IOError on failure.
1313 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1315 typedef struct LDKCResult_NoneErrorZ {
1317 * The contents of this CResult_NoneErrorZ, accessible via either
1318 * `err` or `result` depending on the state of `result_ok`.
1320 union LDKCResult_NoneErrorZPtr contents;
1322 * Whether this CResult_NoneErrorZ represents a success state.
1325 } LDKCResult_NoneErrorZ;
1332 typedef struct MUST_USE_STRUCT LDKRouteHop {
1334 * A pointer to the opaque Rust object.
1335 * Nearly everywhere, inner must be non-null, however in places where
1336 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1338 LDKnativeRouteHop *inner;
1340 * Indicates that this is the only struct which contains the same pointer.
1341 * Rust functions which take ownership of an object provided via an argument require
1342 * this to be true and invalidate the object pointed to by inner.
1348 * The contents of CResult_RouteHopDecodeErrorZ
1350 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
1352 * A pointer to the contents in the success state.
1353 * Reading from this pointer when `result_ok` is not set is undefined.
1355 struct LDKRouteHop *result;
1357 * A pointer to the contents in the error state.
1358 * Reading from this pointer when `result_ok` is set is undefined.
1360 struct LDKDecodeError *err;
1361 } LDKCResult_RouteHopDecodeErrorZPtr;
1364 * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
1365 * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
1366 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1368 typedef struct LDKCResult_RouteHopDecodeErrorZ {
1370 * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
1371 * `err` or `result` depending on the state of `result_ok`.
1373 union LDKCResult_RouteHopDecodeErrorZPtr contents;
1375 * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
1378 } LDKCResult_RouteHopDecodeErrorZ;
1381 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
1382 * This corresponds to std::vector in C++
1384 typedef struct LDKCVec_RouteHopZ {
1386 * The elements in the array.
1387 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1389 struct LDKRouteHop *data;
1391 * The number of elements pointed to by `data`.
1394 } LDKCVec_RouteHopZ;
1397 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
1398 * This corresponds to std::vector in C++
1400 typedef struct LDKCVec_CVec_RouteHopZZ {
1402 * The elements in the array.
1403 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1405 struct LDKCVec_RouteHopZ *data;
1407 * The number of elements pointed to by `data`.
1410 } LDKCVec_CVec_RouteHopZZ;
1415 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
1416 * it can take multiple paths. Each path is composed of one or more hops through the network.
1418 typedef struct MUST_USE_STRUCT LDKRoute {
1420 * A pointer to the opaque Rust object.
1421 * Nearly everywhere, inner must be non-null, however in places where
1422 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1424 LDKnativeRoute *inner;
1426 * Indicates that this is the only struct which contains the same pointer.
1427 * Rust functions which take ownership of an object provided via an argument require
1428 * this to be true and invalidate the object pointed to by inner.
1434 * The contents of CResult_RouteDecodeErrorZ
1436 typedef union LDKCResult_RouteDecodeErrorZPtr {
1438 * A pointer to the contents in the success state.
1439 * Reading from this pointer when `result_ok` is not set is undefined.
1441 struct LDKRoute *result;
1443 * A pointer to the contents in the error state.
1444 * Reading from this pointer when `result_ok` is set is undefined.
1446 struct LDKDecodeError *err;
1447 } LDKCResult_RouteDecodeErrorZPtr;
1450 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
1451 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
1452 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1454 typedef struct LDKCResult_RouteDecodeErrorZ {
1456 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
1457 * `err` or `result` depending on the state of `result_ok`.
1459 union LDKCResult_RouteDecodeErrorZPtr contents;
1461 * Whether this CResult_RouteDecodeErrorZ represents a success state.
1464 } LDKCResult_RouteDecodeErrorZ;
1467 * An enum which can either contain a u64 or not
1469 typedef enum LDKCOption_u64Z_Tag {
1471 * When we're in this state, this COption_u64Z contains a u64
1473 LDKCOption_u64Z_Some,
1475 * When we're in this state, this COption_u64Z contains nothing
1477 LDKCOption_u64Z_None,
1479 * Must be last for serialization purposes
1481 LDKCOption_u64Z_Sentinel,
1482 } LDKCOption_u64Z_Tag;
1484 typedef struct LDKCOption_u64Z {
1485 LDKCOption_u64Z_Tag tag;
1496 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
1498 typedef struct MUST_USE_STRUCT LDKChannelDetails {
1500 * A pointer to the opaque Rust object.
1501 * Nearly everywhere, inner must be non-null, however in places where
1502 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1504 LDKnativeChannelDetails *inner;
1506 * Indicates that this is the only struct which contains the same pointer.
1507 * Rust functions which take ownership of an object provided via an argument require
1508 * this to be true and invalidate the object pointed to by inner.
1511 } LDKChannelDetails;
1514 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
1515 * This corresponds to std::vector in C++
1517 typedef struct LDKCVec_ChannelDetailsZ {
1519 * The elements in the array.
1520 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1522 struct LDKChannelDetails *data;
1524 * The number of elements pointed to by `data`.
1527 } LDKCVec_ChannelDetailsZ;
1532 * A list of hops along a payment path terminating with a channel to the recipient.
1534 typedef struct MUST_USE_STRUCT LDKRouteHint {
1536 * A pointer to the opaque Rust object.
1537 * Nearly everywhere, inner must be non-null, however in places where
1538 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1540 LDKnativeRouteHint *inner;
1542 * Indicates that this is the only struct which contains the same pointer.
1543 * Rust functions which take ownership of an object provided via an argument require
1544 * this to be true and invalidate the object pointed to by inner.
1550 * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
1551 * This corresponds to std::vector in C++
1553 typedef struct LDKCVec_RouteHintZ {
1555 * The elements in the array.
1556 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1558 struct LDKRouteHint *data;
1560 * The number of elements pointed to by `data`.
1563 } LDKCVec_RouteHintZ;
1568 * An Err type for failure to process messages.
1570 typedef struct MUST_USE_STRUCT LDKLightningError {
1572 * A pointer to the opaque Rust object.
1573 * Nearly everywhere, inner must be non-null, however in places where
1574 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1576 LDKnativeLightningError *inner;
1578 * Indicates that this is the only struct which contains the same pointer.
1579 * Rust functions which take ownership of an object provided via an argument require
1580 * this to be true and invalidate the object pointed to by inner.
1583 } LDKLightningError;
1586 * The contents of CResult_RouteLightningErrorZ
1588 typedef union LDKCResult_RouteLightningErrorZPtr {
1590 * A pointer to the contents in the success state.
1591 * Reading from this pointer when `result_ok` is not set is undefined.
1593 struct LDKRoute *result;
1595 * A pointer to the contents in the error state.
1596 * Reading from this pointer when `result_ok` is set is undefined.
1598 struct LDKLightningError *err;
1599 } LDKCResult_RouteLightningErrorZPtr;
1602 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
1603 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
1604 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1606 typedef struct LDKCResult_RouteLightningErrorZ {
1608 * The contents of this CResult_RouteLightningErrorZ, accessible via either
1609 * `err` or `result` depending on the state of `result_ok`.
1611 union LDKCResult_RouteLightningErrorZPtr contents;
1613 * Whether this CResult_RouteLightningErrorZ represents a success state.
1616 } LDKCResult_RouteLightningErrorZ;
1619 * The contents of CResult_TxOutAccessErrorZ
1621 typedef union LDKCResult_TxOutAccessErrorZPtr {
1623 * A pointer to the contents in the success state.
1624 * Reading from this pointer when `result_ok` is not set is undefined.
1626 struct LDKTxOut *result;
1628 * A pointer to the contents in the error state.
1629 * Reading from this pointer when `result_ok` is set is undefined.
1631 enum LDKAccessError *err;
1632 } LDKCResult_TxOutAccessErrorZPtr;
1635 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
1636 * containing a crate::c_types::TxOut on success and a crate::lightning::chain::AccessError on failure.
1637 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1639 typedef struct LDKCResult_TxOutAccessErrorZ {
1641 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
1642 * `err` or `result` depending on the state of `result_ok`.
1644 union LDKCResult_TxOutAccessErrorZPtr contents;
1646 * Whether this CResult_TxOutAccessErrorZ represents a success state.
1649 } LDKCResult_TxOutAccessErrorZ;
1652 * A tuple of 2 elements. See the individual fields for the types contained.
1654 typedef struct LDKC2Tuple_usizeTransactionZ {
1656 * The element at position 0
1660 * The element at position 1
1662 struct LDKTransaction b;
1663 } LDKC2Tuple_usizeTransactionZ;
1666 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
1667 * This corresponds to std::vector in C++
1669 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
1671 * The elements in the array.
1672 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1674 struct LDKC2Tuple_usizeTransactionZ *data;
1676 * The number of elements pointed to by `data`.
1679 } LDKCVec_C2Tuple_usizeTransactionZZ;
1682 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
1683 * look up the corresponding function in rust-lightning's docs.
1685 typedef struct LDKThirtyTwoBytes {
1687 * The thirty-two bytes
1690 } LDKThirtyTwoBytes;
1693 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
1694 * This corresponds to std::vector in C++
1696 typedef struct LDKCVec_TxidZ {
1698 * The elements in the array.
1699 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1701 struct LDKThirtyTwoBytes *data;
1703 * The number of elements pointed to by `data`.
1709 * The contents of CResult_NoneChannelMonitorUpdateErrZ
1711 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
1713 * Note that this value is always NULL, as there are no contents in the OK variant
1717 * A pointer to the contents in the error state.
1718 * Reading from this pointer when `result_ok` is set is undefined.
1720 enum LDKChannelMonitorUpdateErr *err;
1721 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
1724 * A CResult_NoneChannelMonitorUpdateErrZ represents the result of a fallible operation,
1725 * containing a () on success and a crate::lightning::chain::channelmonitor::ChannelMonitorUpdateErr on failure.
1726 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1728 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
1730 * The contents of this CResult_NoneChannelMonitorUpdateErrZ, accessible via either
1731 * `err` or `result` depending on the state of `result_ok`.
1733 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
1735 * Whether this CResult_NoneChannelMonitorUpdateErrZ represents a success state.
1738 } LDKCResult_NoneChannelMonitorUpdateErrZ;
1743 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
1744 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
1745 * preimage claim backward will lead to loss of funds.
1747 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
1749 * A pointer to the opaque Rust object.
1750 * Nearly everywhere, inner must be non-null, however in places where
1751 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1753 LDKnativeHTLCUpdate *inner;
1755 * Indicates that this is the only struct which contains the same pointer.
1756 * Rust functions which take ownership of an object provided via an argument require
1757 * this to be true and invalidate the object pointed to by inner.
1765 * A reference to a transaction output.
1767 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
1768 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
1770 typedef struct MUST_USE_STRUCT LDKOutPoint {
1772 * A pointer to the opaque Rust object.
1773 * Nearly everywhere, inner must be non-null, however in places where
1774 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1776 LDKnativeOutPoint *inner;
1778 * Indicates that this is the only struct which contains the same pointer.
1779 * Rust functions which take ownership of an object provided via an argument require
1780 * this to be true and invalidate the object pointed to by inner.
1786 * An event to be processed by the ChannelManager.
1788 typedef enum LDKMonitorEvent_Tag {
1790 * A monitor event containing an HTLCUpdate.
1792 LDKMonitorEvent_HTLCEvent,
1794 * A monitor event that the Channel's commitment transaction was broadcasted.
1796 LDKMonitorEvent_CommitmentTxBroadcasted,
1798 * Must be last for serialization purposes
1800 LDKMonitorEvent_Sentinel,
1801 } LDKMonitorEvent_Tag;
1803 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
1804 LDKMonitorEvent_Tag tag;
1807 struct LDKHTLCUpdate htlc_event;
1810 struct LDKOutPoint commitment_tx_broadcasted;
1816 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
1817 * This corresponds to std::vector in C++
1819 typedef struct LDKCVec_MonitorEventZ {
1821 * The elements in the array.
1822 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1824 struct LDKMonitorEvent *data;
1826 * The number of elements pointed to by `data`.
1829 } LDKCVec_MonitorEventZ;
1832 * An enum which can either contain a crate::c_types::derived::C2Tuple_usizeTransactionZ or not
1834 typedef enum LDKCOption_C2Tuple_usizeTransactionZZ_Tag {
1836 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains a crate::c_types::derived::C2Tuple_usizeTransactionZ
1838 LDKCOption_C2Tuple_usizeTransactionZZ_Some,
1840 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains nothing
1842 LDKCOption_C2Tuple_usizeTransactionZZ_None,
1844 * Must be last for serialization purposes
1846 LDKCOption_C2Tuple_usizeTransactionZZ_Sentinel,
1847 } LDKCOption_C2Tuple_usizeTransactionZZ_Tag;
1849 typedef struct LDKCOption_C2Tuple_usizeTransactionZZ {
1850 LDKCOption_C2Tuple_usizeTransactionZZ_Tag tag;
1853 struct LDKC2Tuple_usizeTransactionZ some;
1856 } LDKCOption_C2Tuple_usizeTransactionZZ;
1861 * Information about a spendable output to a P2WSH script. See
1862 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
1864 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
1866 * A pointer to the opaque Rust object.
1867 * Nearly everywhere, inner must be non-null, however in places where
1868 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1870 LDKnativeDelayedPaymentOutputDescriptor *inner;
1872 * Indicates that this is the only struct which contains the same pointer.
1873 * Rust functions which take ownership of an object provided via an argument require
1874 * this to be true and invalidate the object pointed to by inner.
1877 } LDKDelayedPaymentOutputDescriptor;
1882 * Information about a spendable output to our \"payment key\". See
1883 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
1885 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
1887 * A pointer to the opaque Rust object.
1888 * Nearly everywhere, inner must be non-null, however in places where
1889 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1891 LDKnativeStaticPaymentOutputDescriptor *inner;
1893 * Indicates that this is the only struct which contains the same pointer.
1894 * Rust functions which take ownership of an object provided via an argument require
1895 * this to be true and invalidate the object pointed to by inner.
1898 } LDKStaticPaymentOutputDescriptor;
1901 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
1902 * claim at any point in the future) an event is generated which you must track and be able to
1903 * spend on-chain. The information needed to do this is provided in this enum, including the
1904 * outpoint describing which txid and output index is available, the full output which exists at
1905 * that txid/index, and any keys or other information required to sign.
1907 typedef enum LDKSpendableOutputDescriptor_Tag {
1909 * An output to a script which was provided via KeysInterface directly, either from
1910 * `get_destination_script()` or `get_shutdown_scriptpubkey()`, thus you should already know
1911 * how to spend it. No secret keys are provided as rust-lightning was never given any key.
1912 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
1913 * on-chain using the payment preimage or after it has timed out.
1915 LDKSpendableOutputDescriptor_StaticOutput,
1917 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
1919 * The witness in the spending input should be:
1920 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
1922 * Note that the nSequence field in the spending input must be set to to_self_delay
1923 * (which means the transaction is not broadcastable until at least to_self_delay
1924 * blocks after the outpoint confirms).
1926 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
1927 * it is an output from an old state which we broadcast (which should never happen).
1929 * To derive the delayed_payment key which is used to sign for this input, you must pass the
1930 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
1931 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
1932 * chan_utils::derive_private_key. The public key can be generated without the secret key
1933 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
1936 * To derive the revocation_pubkey provided here (which is used in the witness
1937 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
1938 * call to Sign::ready_channel) and the provided per_commitment point
1939 * to chan_utils::derive_public_revocation_key.
1941 * The witness script which is hashed and included in the output script_pubkey may be
1942 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
1943 * (derived as above), and the to_self_delay contained here to
1944 * chan_utils::get_revokeable_redeemscript.
1946 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
1948 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
1949 * corresponds to the public key in Sign::pubkeys().payment_point).
1950 * The witness in the spending input, is, thus, simply:
1951 * <BIP 143 signature> <payment key>
1953 * These are generally the result of our counterparty having broadcast the current state,
1954 * allowing us to claim the non-HTLC-encumbered outputs immediately.
1956 LDKSpendableOutputDescriptor_StaticPaymentOutput,
1958 * Must be last for serialization purposes
1960 LDKSpendableOutputDescriptor_Sentinel,
1961 } LDKSpendableOutputDescriptor_Tag;
1963 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
1965 * The outpoint which is spendable
1967 struct LDKOutPoint outpoint;
1969 * The output which is referenced by the given outpoint.
1971 struct LDKTxOut output;
1972 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
1974 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
1975 LDKSpendableOutputDescriptor_Tag tag;
1977 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
1979 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
1982 struct LDKStaticPaymentOutputDescriptor static_payment_output;
1985 } LDKSpendableOutputDescriptor;
1988 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
1989 * This corresponds to std::vector in C++
1991 typedef struct LDKCVec_SpendableOutputDescriptorZ {
1993 * The elements in the array.
1994 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1996 struct LDKSpendableOutputDescriptor *data;
1998 * The number of elements pointed to by `data`.
2001 } LDKCVec_SpendableOutputDescriptorZ;
2006 * An accept_channel message to be sent or received from a peer
2008 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
2010 * A pointer to the opaque Rust object.
2011 * Nearly everywhere, inner must be non-null, however in places where
2012 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2014 LDKnativeAcceptChannel *inner;
2016 * Indicates that this is the only struct which contains the same pointer.
2017 * Rust functions which take ownership of an object provided via an argument require
2018 * this to be true and invalidate the object pointed to by inner.
2026 * An open_channel message to be sent or received from a peer
2028 typedef struct MUST_USE_STRUCT LDKOpenChannel {
2030 * A pointer to the opaque Rust object.
2031 * Nearly everywhere, inner must be non-null, however in places where
2032 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2034 LDKnativeOpenChannel *inner;
2036 * Indicates that this is the only struct which contains the same pointer.
2037 * Rust functions which take ownership of an object provided via an argument require
2038 * this to be true and invalidate the object pointed to by inner.
2046 * A funding_created message to be sent or received from a peer
2048 typedef struct MUST_USE_STRUCT LDKFundingCreated {
2050 * A pointer to the opaque Rust object.
2051 * Nearly everywhere, inner must be non-null, however in places where
2052 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2054 LDKnativeFundingCreated *inner;
2056 * Indicates that this is the only struct which contains the same pointer.
2057 * Rust functions which take ownership of an object provided via an argument require
2058 * this to be true and invalidate the object pointed to by inner.
2061 } LDKFundingCreated;
2066 * A funding_signed message to be sent or received from a peer
2068 typedef struct MUST_USE_STRUCT LDKFundingSigned {
2070 * A pointer to the opaque Rust object.
2071 * Nearly everywhere, inner must be non-null, however in places where
2072 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2074 LDKnativeFundingSigned *inner;
2076 * Indicates that this is the only struct which contains the same pointer.
2077 * Rust functions which take ownership of an object provided via an argument require
2078 * this to be true and invalidate the object pointed to by inner.
2086 * A funding_locked message to be sent or received from a peer
2088 typedef struct MUST_USE_STRUCT LDKFundingLocked {
2090 * A pointer to the opaque Rust object.
2091 * Nearly everywhere, inner must be non-null, however in places where
2092 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2094 LDKnativeFundingLocked *inner;
2096 * Indicates that this is the only struct which contains the same pointer.
2097 * Rust functions which take ownership of an object provided via an argument require
2098 * this to be true and invalidate the object pointed to by inner.
2106 * An announcement_signatures message to be sent or received from a peer
2108 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
2110 * A pointer to the opaque Rust object.
2111 * Nearly everywhere, inner must be non-null, however in places where
2112 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2114 LDKnativeAnnouncementSignatures *inner;
2116 * Indicates that this is the only struct which contains the same pointer.
2117 * Rust functions which take ownership of an object provided via an argument require
2118 * this to be true and invalidate the object pointed to by inner.
2121 } LDKAnnouncementSignatures;
2126 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
2127 * transaction updates if they were pending.
2129 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
2131 * A pointer to the opaque Rust object.
2132 * Nearly everywhere, inner must be non-null, however in places where
2133 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2135 LDKnativeCommitmentUpdate *inner;
2137 * Indicates that this is the only struct which contains the same pointer.
2138 * Rust functions which take ownership of an object provided via an argument require
2139 * this to be true and invalidate the object pointed to by inner.
2142 } LDKCommitmentUpdate;
2147 * A revoke_and_ack message to be sent or received from a peer
2149 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
2151 * A pointer to the opaque Rust object.
2152 * Nearly everywhere, inner must be non-null, however in places where
2153 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2155 LDKnativeRevokeAndACK *inner;
2157 * Indicates that this is the only struct which contains the same pointer.
2158 * Rust functions which take ownership of an object provided via an argument require
2159 * this to be true and invalidate the object pointed to by inner.
2167 * A closing_signed message to be sent or received from a peer
2169 typedef struct MUST_USE_STRUCT LDKClosingSigned {
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 LDKnativeClosingSigned *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 shutdown message to be sent or received from a peer
2189 typedef struct MUST_USE_STRUCT LDKShutdown {
2191 * A pointer to the opaque Rust object.
2192 * Nearly everywhere, inner must be non-null, however in places where
2193 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2195 LDKnativeShutdown *inner;
2197 * Indicates that this is the only struct which contains the same pointer.
2198 * Rust functions which take ownership of an object provided via an argument require
2199 * this to be true and invalidate the object pointed to by inner.
2207 * A channel_reestablish message to be sent or received from a peer
2209 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
2211 * A pointer to the opaque Rust object.
2212 * Nearly everywhere, inner must be non-null, however in places where
2213 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2215 LDKnativeChannelReestablish *inner;
2217 * Indicates that this is the only struct which contains the same pointer.
2218 * Rust functions which take ownership of an object provided via an argument require
2219 * this to be true and invalidate the object pointed to by inner.
2222 } LDKChannelReestablish;
2227 * A channel_announcement message to be sent or received from a peer
2229 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
2231 * A pointer to the opaque Rust object.
2232 * Nearly everywhere, inner must be non-null, however in places where
2233 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2235 LDKnativeChannelAnnouncement *inner;
2237 * Indicates that this is the only struct which contains the same pointer.
2238 * Rust functions which take ownership of an object provided via an argument require
2239 * this to be true and invalidate the object pointed to by inner.
2242 } LDKChannelAnnouncement;
2247 * A channel_update message to be sent or received from a peer
2249 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
2251 * A pointer to the opaque Rust object.
2252 * Nearly everywhere, inner must be non-null, however in places where
2253 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2255 LDKnativeChannelUpdate *inner;
2257 * Indicates that this is the only struct which contains the same pointer.
2258 * Rust functions which take ownership of an object provided via an argument require
2259 * this to be true and invalidate the object pointed to by inner.
2267 * A node_announcement message to be sent or received from a peer
2269 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
2271 * A pointer to the opaque Rust object.
2272 * Nearly everywhere, inner must be non-null, however in places where
2273 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2275 LDKnativeNodeAnnouncement *inner;
2277 * Indicates that this is the only struct which contains the same pointer.
2278 * Rust functions which take ownership of an object provided via an argument require
2279 * this to be true and invalidate the object pointed to by inner.
2282 } LDKNodeAnnouncement;
2287 * An error message to be sent or received from a peer
2289 typedef struct MUST_USE_STRUCT LDKErrorMessage {
2291 * A pointer to the opaque Rust object.
2292 * Nearly everywhere, inner must be non-null, however in places where
2293 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2295 LDKnativeErrorMessage *inner;
2297 * Indicates that this is the only struct which contains the same pointer.
2298 * Rust functions which take ownership of an object provided via an argument require
2299 * this to be true and invalidate the object pointed to by inner.
2305 * Used to put an error message in a LightningError
2307 typedef enum LDKErrorAction_Tag {
2309 * The peer took some action which made us think they were useless. Disconnect them.
2311 LDKErrorAction_DisconnectPeer,
2313 * The peer did something harmless that we weren't able to process, just log and ignore
2315 LDKErrorAction_IgnoreError,
2317 * The peer did something harmless that we weren't able to meaningfully process.
2318 * If the error is logged, log it at the given level.
2320 LDKErrorAction_IgnoreAndLog,
2322 * The peer did something incorrect. Tell them.
2324 LDKErrorAction_SendErrorMessage,
2326 * Must be last for serialization purposes
2328 LDKErrorAction_Sentinel,
2329 } LDKErrorAction_Tag;
2331 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
2333 * An error message which we should make an effort to send before we disconnect.
2335 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2337 struct LDKErrorMessage msg;
2338 } LDKErrorAction_LDKDisconnectPeer_Body;
2340 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
2342 * The message to send.
2344 struct LDKErrorMessage msg;
2345 } LDKErrorAction_LDKSendErrorMessage_Body;
2347 typedef struct MUST_USE_STRUCT LDKErrorAction {
2348 LDKErrorAction_Tag tag;
2350 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
2352 enum LDKLevel ignore_and_log;
2354 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
2359 * The information we received from a peer along the route of a payment we originated. This is
2360 * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
2361 * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
2363 typedef enum LDKHTLCFailChannelUpdate_Tag {
2365 * We received an error which included a full ChannelUpdate message.
2367 LDKHTLCFailChannelUpdate_ChannelUpdateMessage,
2369 * We received an error which indicated only that a channel has been closed
2371 LDKHTLCFailChannelUpdate_ChannelClosed,
2373 * We received an error which indicated only that a node has failed
2375 LDKHTLCFailChannelUpdate_NodeFailure,
2377 * Must be last for serialization purposes
2379 LDKHTLCFailChannelUpdate_Sentinel,
2380 } LDKHTLCFailChannelUpdate_Tag;
2382 typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body {
2384 * The unwrapped message we received
2386 struct LDKChannelUpdate msg;
2387 } LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
2389 typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
2391 * The short_channel_id which has now closed.
2393 uint64_t short_channel_id;
2395 * when this true, this channel should be permanently removed from the
2396 * consideration. Otherwise, this channel can be restored as new channel_update is received
2399 } LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
2401 typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
2403 * The node_id that has failed.
2405 struct LDKPublicKey node_id;
2407 * when this true, node should be permanently removed from the
2408 * consideration. Otherwise, the channels connected to this node can be
2409 * restored as new channel_update is received
2412 } LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
2414 typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate {
2415 LDKHTLCFailChannelUpdate_Tag tag;
2417 LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message;
2418 LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed;
2419 LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure;
2421 } LDKHTLCFailChannelUpdate;
2426 * A query_channel_range message is used to query a peer for channel
2427 * UTXOs in a range of blocks. The recipient of a query makes a best
2428 * effort to reply to the query using one or more reply_channel_range
2431 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
2433 * A pointer to the opaque Rust object.
2434 * Nearly everywhere, inner must be non-null, however in places where
2435 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2437 LDKnativeQueryChannelRange *inner;
2439 * Indicates that this is the only struct which contains the same pointer.
2440 * Rust functions which take ownership of an object provided via an argument require
2441 * this to be true and invalidate the object pointed to by inner.
2444 } LDKQueryChannelRange;
2449 * A query_short_channel_ids message is used to query a peer for
2450 * routing gossip messages related to one or more short_channel_ids.
2451 * The query recipient will reply with the latest, if available,
2452 * channel_announcement, channel_update and node_announcement messages
2453 * it maintains for the requested short_channel_ids followed by a
2454 * reply_short_channel_ids_end message. The short_channel_ids sent in
2455 * this query are encoded. We only support encoding_type=0 uncompressed
2456 * serialization and do not support encoding_type=1 zlib serialization.
2458 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
2460 * A pointer to the opaque Rust object.
2461 * Nearly everywhere, inner must be non-null, however in places where
2462 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2464 LDKnativeQueryShortChannelIds *inner;
2466 * Indicates that this is the only struct which contains the same pointer.
2467 * Rust functions which take ownership of an object provided via an argument require
2468 * this to be true and invalidate the object pointed to by inner.
2471 } LDKQueryShortChannelIds;
2476 * A reply_channel_range message is a reply to a query_channel_range
2477 * message. Multiple reply_channel_range messages can be sent in reply
2478 * to a single query_channel_range message. The query recipient makes a
2479 * best effort to respond based on their local network view which may
2480 * not be a perfect view of the network. The short_channel_ids in the
2481 * reply are encoded. We only support encoding_type=0 uncompressed
2482 * serialization and do not support encoding_type=1 zlib serialization.
2484 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
2486 * A pointer to the opaque Rust object.
2487 * Nearly everywhere, inner must be non-null, however in places where
2488 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2490 LDKnativeReplyChannelRange *inner;
2492 * Indicates that this is the only struct which contains the same pointer.
2493 * Rust functions which take ownership of an object provided via an argument require
2494 * this to be true and invalidate the object pointed to by inner.
2497 } LDKReplyChannelRange;
2500 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
2501 * broadcast to most peers).
2502 * These events are handled by PeerManager::process_events if you are using a PeerManager.
2504 typedef enum LDKMessageSendEvent_Tag {
2506 * Used to indicate that we've accepted a channel open and should send the accept_channel
2507 * message provided to the given peer.
2509 LDKMessageSendEvent_SendAcceptChannel,
2511 * Used to indicate that we've initiated a channel open and should send the open_channel
2512 * message provided to the given peer.
2514 LDKMessageSendEvent_SendOpenChannel,
2516 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
2518 LDKMessageSendEvent_SendFundingCreated,
2520 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
2522 LDKMessageSendEvent_SendFundingSigned,
2524 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
2526 LDKMessageSendEvent_SendFundingLocked,
2528 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
2530 LDKMessageSendEvent_SendAnnouncementSignatures,
2532 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
2533 * message should be sent to the peer with the given node_id.
2535 LDKMessageSendEvent_UpdateHTLCs,
2537 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
2539 LDKMessageSendEvent_SendRevokeAndACK,
2541 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
2543 LDKMessageSendEvent_SendClosingSigned,
2545 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
2547 LDKMessageSendEvent_SendShutdown,
2549 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
2551 LDKMessageSendEvent_SendChannelReestablish,
2553 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
2554 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
2556 * Note that after doing so, you very likely (unless you did so very recently) want to call
2557 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
2558 * This ensures that any nodes which see our channel_announcement also have a relevant
2559 * node_announcement, including relevant feature flags which may be important for routing
2562 LDKMessageSendEvent_BroadcastChannelAnnouncement,
2564 * Used to indicate that a node_announcement should be broadcast to all peers.
2566 LDKMessageSendEvent_BroadcastNodeAnnouncement,
2568 * Used to indicate that a channel_update should be broadcast to all peers.
2570 LDKMessageSendEvent_BroadcastChannelUpdate,
2572 * Used to indicate that a channel_update should be sent to a single peer.
2573 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
2574 * private channel and we shouldn't be informing all of our peers of channel parameters.
2576 LDKMessageSendEvent_SendChannelUpdate,
2578 * Broadcast an error downstream to be handled
2580 LDKMessageSendEvent_HandleError,
2582 * When a payment fails we may receive updates back from the hop where it failed. In such
2583 * cases this event is generated so that we can inform the network graph of this information.
2585 LDKMessageSendEvent_PaymentFailureNetworkUpdate,
2587 * Query a peer for channels with funding transaction UTXOs in a block range.
2589 LDKMessageSendEvent_SendChannelRangeQuery,
2591 * Request routing gossip messages from a peer for a list of channels identified by
2592 * their short_channel_ids.
2594 LDKMessageSendEvent_SendShortIdsQuery,
2596 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
2597 * emitted during processing of the query.
2599 LDKMessageSendEvent_SendReplyChannelRange,
2601 * Must be last for serialization purposes
2603 LDKMessageSendEvent_Sentinel,
2604 } LDKMessageSendEvent_Tag;
2606 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
2608 * The node_id of the node which should receive this message
2610 struct LDKPublicKey node_id;
2612 * The message which should be sent.
2614 struct LDKAcceptChannel msg;
2615 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
2617 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
2619 * The node_id of the node which should receive this message
2621 struct LDKPublicKey node_id;
2623 * The message which should be sent.
2625 struct LDKOpenChannel msg;
2626 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
2628 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
2630 * The node_id of the node which should receive this message
2632 struct LDKPublicKey node_id;
2634 * The message which should be sent.
2636 struct LDKFundingCreated msg;
2637 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
2639 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
2641 * The node_id of the node which should receive this message
2643 struct LDKPublicKey node_id;
2645 * The message which should be sent.
2647 struct LDKFundingSigned msg;
2648 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
2650 typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
2652 * The node_id of the node which should receive these message(s)
2654 struct LDKPublicKey node_id;
2656 * The funding_locked message which should be sent.
2658 struct LDKFundingLocked msg;
2659 } LDKMessageSendEvent_LDKSendFundingLocked_Body;
2661 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
2663 * The node_id of the node which should receive these message(s)
2665 struct LDKPublicKey node_id;
2667 * The announcement_signatures message which should be sent.
2669 struct LDKAnnouncementSignatures msg;
2670 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
2672 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
2674 * The node_id of the node which should receive these message(s)
2676 struct LDKPublicKey node_id;
2678 * The update messages which should be sent. ALL messages in the struct should be sent!
2680 struct LDKCommitmentUpdate updates;
2681 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
2683 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
2685 * The node_id of the node which should receive this message
2687 struct LDKPublicKey node_id;
2689 * The message which should be sent.
2691 struct LDKRevokeAndACK msg;
2692 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
2694 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
2696 * The node_id of the node which should receive this message
2698 struct LDKPublicKey node_id;
2700 * The message which should be sent.
2702 struct LDKClosingSigned msg;
2703 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
2705 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
2707 * The node_id of the node which should receive this message
2709 struct LDKPublicKey node_id;
2711 * The message which should be sent.
2713 struct LDKShutdown msg;
2714 } LDKMessageSendEvent_LDKSendShutdown_Body;
2716 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
2718 * The node_id of the node which should receive this message
2720 struct LDKPublicKey node_id;
2722 * The message which should be sent.
2724 struct LDKChannelReestablish msg;
2725 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
2727 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
2729 * The channel_announcement which should be sent.
2731 struct LDKChannelAnnouncement msg;
2733 * The followup channel_update which should be sent.
2735 struct LDKChannelUpdate update_msg;
2736 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
2738 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
2740 * The node_announcement which should be sent.
2742 struct LDKNodeAnnouncement msg;
2743 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
2745 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
2747 * The channel_update which should be sent.
2749 struct LDKChannelUpdate msg;
2750 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
2752 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
2754 * The node_id of the node which should receive this message
2756 struct LDKPublicKey node_id;
2758 * The channel_update which should be sent.
2760 struct LDKChannelUpdate msg;
2761 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
2763 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
2765 * The node_id of the node which should receive this message
2767 struct LDKPublicKey node_id;
2769 * The action which should be taken.
2771 struct LDKErrorAction action;
2772 } LDKMessageSendEvent_LDKHandleError_Body;
2774 typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
2776 * The channel/node update which should be sent to NetGraphMsgHandler
2778 struct LDKHTLCFailChannelUpdate update;
2779 } LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
2781 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
2783 * The node_id of this message recipient
2785 struct LDKPublicKey node_id;
2787 * The query_channel_range which should be sent.
2789 struct LDKQueryChannelRange msg;
2790 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
2792 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
2794 * The node_id of this message recipient
2796 struct LDKPublicKey node_id;
2798 * The query_short_channel_ids which should be sent.
2800 struct LDKQueryShortChannelIds msg;
2801 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
2803 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
2805 * The node_id of this message recipient
2807 struct LDKPublicKey node_id;
2809 * The reply_channel_range which should be sent.
2811 struct LDKReplyChannelRange msg;
2812 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
2814 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
2815 LDKMessageSendEvent_Tag tag;
2817 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
2818 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
2819 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
2820 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
2821 LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
2822 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
2823 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
2824 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
2825 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
2826 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
2827 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
2828 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
2829 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
2830 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
2831 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
2832 LDKMessageSendEvent_LDKHandleError_Body handle_error;
2833 LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update;
2834 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
2835 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
2836 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
2838 } LDKMessageSendEvent;
2841 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
2842 * This corresponds to std::vector in C++
2844 typedef struct LDKCVec_MessageSendEventZ {
2846 * The elements in the array.
2847 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2849 struct LDKMessageSendEvent *data;
2851 * The number of elements pointed to by `data`.
2854 } LDKCVec_MessageSendEventZ;
2859 * Features used within an `init` message.
2861 typedef struct MUST_USE_STRUCT LDKInitFeatures {
2863 * A pointer to the opaque Rust object.
2864 * Nearly everywhere, inner must be non-null, however in places where
2865 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2867 LDKnativeInitFeatures *inner;
2869 * Indicates that this is the only struct which contains the same pointer.
2870 * Rust functions which take ownership of an object provided via an argument require
2871 * this to be true and invalidate the object pointed to by inner.
2877 * The contents of CResult_InitFeaturesDecodeErrorZ
2879 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
2881 * A pointer to the contents in the success state.
2882 * Reading from this pointer when `result_ok` is not set is undefined.
2884 struct LDKInitFeatures *result;
2886 * A pointer to the contents in the error state.
2887 * Reading from this pointer when `result_ok` is set is undefined.
2889 struct LDKDecodeError *err;
2890 } LDKCResult_InitFeaturesDecodeErrorZPtr;
2893 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
2894 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
2895 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2897 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
2899 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
2900 * `err` or `result` depending on the state of `result_ok`.
2902 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
2904 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
2907 } LDKCResult_InitFeaturesDecodeErrorZ;
2912 * Features used within a `node_announcement` message.
2914 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
2916 * A pointer to the opaque Rust object.
2917 * Nearly everywhere, inner must be non-null, however in places where
2918 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2920 LDKnativeNodeFeatures *inner;
2922 * Indicates that this is the only struct which contains the same pointer.
2923 * Rust functions which take ownership of an object provided via an argument require
2924 * this to be true and invalidate the object pointed to by inner.
2930 * The contents of CResult_NodeFeaturesDecodeErrorZ
2932 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
2934 * A pointer to the contents in the success state.
2935 * Reading from this pointer when `result_ok` is not set is undefined.
2937 struct LDKNodeFeatures *result;
2939 * A pointer to the contents in the error state.
2940 * Reading from this pointer when `result_ok` is set is undefined.
2942 struct LDKDecodeError *err;
2943 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
2946 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
2947 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
2948 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2950 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
2952 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
2953 * `err` or `result` depending on the state of `result_ok`.
2955 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
2957 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
2960 } LDKCResult_NodeFeaturesDecodeErrorZ;
2965 * Features used within a `channel_announcement` message.
2967 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
2969 * A pointer to the opaque Rust object.
2970 * Nearly everywhere, inner must be non-null, however in places where
2971 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2973 LDKnativeChannelFeatures *inner;
2975 * Indicates that this is the only struct which contains the same pointer.
2976 * Rust functions which take ownership of an object provided via an argument require
2977 * this to be true and invalidate the object pointed to by inner.
2980 } LDKChannelFeatures;
2983 * The contents of CResult_ChannelFeaturesDecodeErrorZ
2985 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
2987 * A pointer to the contents in the success state.
2988 * Reading from this pointer when `result_ok` is not set is undefined.
2990 struct LDKChannelFeatures *result;
2992 * A pointer to the contents in the error state.
2993 * Reading from this pointer when `result_ok` is set is undefined.
2995 struct LDKDecodeError *err;
2996 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
2999 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
3000 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
3001 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3003 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
3005 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
3006 * `err` or `result` depending on the state of `result_ok`.
3008 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
3010 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
3013 } LDKCResult_ChannelFeaturesDecodeErrorZ;
3018 * Features used within an invoice.
3020 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
3022 * A pointer to the opaque Rust object.
3023 * Nearly everywhere, inner must be non-null, however in places where
3024 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3026 LDKnativeInvoiceFeatures *inner;
3028 * Indicates that this is the only struct which contains the same pointer.
3029 * Rust functions which take ownership of an object provided via an argument require
3030 * this to be true and invalidate the object pointed to by inner.
3033 } LDKInvoiceFeatures;
3036 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
3038 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
3040 * A pointer to the contents in the success state.
3041 * Reading from this pointer when `result_ok` is not set is undefined.
3043 struct LDKInvoiceFeatures *result;
3045 * A pointer to the contents in the error state.
3046 * Reading from this pointer when `result_ok` is set is undefined.
3048 struct LDKDecodeError *err;
3049 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
3052 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
3053 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
3054 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3056 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
3058 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
3059 * `err` or `result` depending on the state of `result_ok`.
3061 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
3063 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
3066 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
3069 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
3071 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
3073 * A pointer to the contents in the success state.
3074 * Reading from this pointer when `result_ok` is not set is undefined.
3076 struct LDKDelayedPaymentOutputDescriptor *result;
3078 * A pointer to the contents in the error state.
3079 * Reading from this pointer when `result_ok` is set is undefined.
3081 struct LDKDecodeError *err;
3082 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
3085 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
3086 * containing a crate::lightning::chain::keysinterface::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
3087 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3089 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
3091 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
3092 * `err` or `result` depending on the state of `result_ok`.
3094 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
3096 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
3099 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
3102 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
3104 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
3106 * A pointer to the contents in the success state.
3107 * Reading from this pointer when `result_ok` is not set is undefined.
3109 struct LDKStaticPaymentOutputDescriptor *result;
3111 * A pointer to the contents in the error state.
3112 * Reading from this pointer when `result_ok` is set is undefined.
3114 struct LDKDecodeError *err;
3115 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
3118 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
3119 * containing a crate::lightning::chain::keysinterface::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
3120 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3122 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
3124 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
3125 * `err` or `result` depending on the state of `result_ok`.
3127 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
3129 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
3132 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
3135 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
3137 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
3139 * A pointer to the contents in the success state.
3140 * Reading from this pointer when `result_ok` is not set is undefined.
3142 struct LDKSpendableOutputDescriptor *result;
3144 * A pointer to the contents in the error state.
3145 * Reading from this pointer when `result_ok` is set is undefined.
3147 struct LDKDecodeError *err;
3148 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
3151 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
3152 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
3153 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3155 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
3157 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
3158 * `err` or `result` depending on the state of `result_ok`.
3160 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
3162 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
3165 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
3168 * A tuple of 2 elements. See the individual fields for the types contained.
3170 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
3172 * The element at position 0
3174 struct LDKSignature a;
3176 * The element at position 1
3178 struct LDKCVec_SignatureZ b;
3179 } LDKC2Tuple_SignatureCVec_SignatureZZ;
3182 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
3184 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
3186 * A pointer to the contents in the success state.
3187 * Reading from this pointer when `result_ok` is not set is undefined.
3189 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
3191 * Note that this value is always NULL, as there are no contents in the Err variant
3194 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
3197 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
3198 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
3199 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3201 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3203 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
3204 * `err` or `result` depending on the state of `result_ok`.
3206 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
3208 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
3211 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
3214 * The contents of CResult_SignatureNoneZ
3216 typedef union LDKCResult_SignatureNoneZPtr {
3218 * A pointer to the contents in the success state.
3219 * Reading from this pointer when `result_ok` is not set is undefined.
3221 struct LDKSignature *result;
3223 * Note that this value is always NULL, as there are no contents in the Err variant
3226 } LDKCResult_SignatureNoneZPtr;
3229 * A CResult_SignatureNoneZ represents the result of a fallible operation,
3230 * containing a crate::c_types::Signature on success and a () on failure.
3231 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3233 typedef struct LDKCResult_SignatureNoneZ {
3235 * The contents of this CResult_SignatureNoneZ, accessible via either
3236 * `err` or `result` depending on the state of `result_ok`.
3238 union LDKCResult_SignatureNoneZPtr contents;
3240 * Whether this CResult_SignatureNoneZ represents a success state.
3243 } LDKCResult_SignatureNoneZ;
3248 * The unsigned part of a channel_announcement
3250 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
3252 * A pointer to the opaque Rust object.
3253 * Nearly everywhere, inner must be non-null, however in places where
3254 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3256 LDKnativeUnsignedChannelAnnouncement *inner;
3258 * Indicates that this is the only struct which contains the same pointer.
3259 * Rust functions which take ownership of an object provided via an argument require
3260 * this to be true and invalidate the object pointed to by inner.
3263 } LDKUnsignedChannelAnnouncement;
3266 * A trait to sign lightning channel transactions as described in BOLT 3.
3268 * Signing services could be implemented on a hardware wallet. In this case,
3269 * the current Sign would be a front-end on top of a communication
3270 * channel connected to your secure device and lightning key material wouldn't
3271 * reside on a hot server. Nevertheless, a this deployment would still need
3272 * to trust the ChannelManager to avoid loss of funds as this latest component
3273 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
3275 * A more secure iteration would be to use hashlock (or payment points) to pair
3276 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
3277 * at the price of more state and computation on the hardware wallet side. In the future,
3278 * we are looking forward to design such interface.
3280 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
3281 * to act, as liveness and breach reply correctness are always going to be hard requirements
3282 * of LN security model, orthogonal of key management issues.
3284 typedef struct LDKBaseSign {
3286 * An opaque pointer which is passed to your function implementations as an argument.
3287 * This has no meaning in the LDK, and can be NULL or any other value.
3291 * Gets the per-commitment point for a specific commitment number
3293 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
3295 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
3297 * Gets the commitment secret for a specific commitment number as part of the revocation process
3299 * An external signer implementation should error here if the commitment was already signed
3300 * and should refuse to sign it in the future.
3302 * May be called more than once for the same index.
3304 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
3306 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
3308 * Gets the holder's channel public keys and basepoints
3310 struct LDKChannelPublicKeys pubkeys;
3312 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
3313 * Note that this takes a pointer to this object, not the this_ptr like other methods do
3314 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
3316 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
3318 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
3319 * some SpendableOutputDescriptor types. This should be sufficient to identify this
3320 * Sign object uniquely and lookup or re-derive its keys.
3322 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
3324 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
3326 * Note that if signing fails or is rejected, the channel will be force-closed.
3328 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx);
3330 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
3331 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
3332 * latest commitment_tx when we initiate a force-close.
3333 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
3334 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
3336 * This may be called multiple times for the same transaction.
3338 * An external signer implementation should check that the commitment has not been revoked.
3340 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
3342 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
3344 * Create a signature for the given input in a transaction spending an HTLC transaction output
3345 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
3347 * A justice transaction may claim multiple outputs at the same time if timelocks are
3348 * similar, but only a signature for the input at index `input` should be signed for here.
3349 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
3350 * to an upcoming timelock expiration.
3352 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
3354 * per_commitment_key is revocation secret which was provided by our counterparty when they
3355 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
3356 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
3359 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]);
3361 * Create a signature for the given input in a transaction spending a commitment transaction
3362 * HTLC output when our counterparty broadcasts an old state.
3364 * A justice transaction may claim multiple outputs at the same time if timelocks are
3365 * similar, but only a signature for the input at index `input` should be signed for here.
3366 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
3367 * to an upcoming timelock expiration.
3369 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
3371 * per_commitment_key is revocation secret which was provided by our counterparty when they
3372 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
3373 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
3376 * htlc holds HTLC elements (hash, timelock), thus changing the format of the witness script
3377 * (which is committed to in the BIP 143 signatures).
3379 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);
3381 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
3382 * transaction, either offered or received.
3384 * Such a transaction may claim multiples offered outputs at same time if we know the
3385 * preimage for each when we create it, but only the input at index `input` should be
3386 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
3387 * needed with regards to an upcoming timelock expiration.
3389 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
3392 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
3394 * Per_commitment_point is the dynamic point corresponding to the channel state
3395 * detected onchain. It has been generated by our counterparty and is used to derive
3396 * channel state keys, which are then included in the witness script and committed to in the
3397 * BIP 143 signature.
3399 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);
3401 * Create a signature for a (proposed) closing transaction.
3403 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
3404 * chosen to forgo their output as dust.
3406 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, struct LDKTransaction closing_tx);
3408 * Signs a channel announcement message with our funding key, proving it comes from one
3409 * of the channel participants.
3411 * Note that if this fails or is rejected, the channel will not be publicly announced and
3412 * our counterparty may (though likely will not) close the channel on us for violating the
3415 struct LDKCResult_SignatureNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
3417 * Set the counterparty static channel data, including basepoints,
3418 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
3419 * This is done as soon as the funding outpoint is known. Since these are static channel data,
3420 * they MUST NOT be allowed to change to different values once set.
3422 * channel_parameters.is_populated() MUST be true.
3424 * We bind holder_selected_contest_delay late here for API convenience.
3426 * Will be called before any signatures are applied.
3428 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
3430 * Frees any resources associated with this object given its this_arg pointer.
3431 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3433 void (*free)(void *this_arg);
3437 * A cloneable signer.
3439 * Although we require signers to be cloneable, it may be useful for developers to be able to use
3440 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
3441 * which implies Sized, into this derived trait.
3443 typedef struct LDKSign {
3445 * An opaque pointer which is passed to your function implementations as an argument.
3446 * This has no meaning in the LDK, and can be NULL or any other value.
3450 * Implementation of BaseSign for this object.
3452 struct LDKBaseSign BaseSign;
3454 * Serialize the object into a byte array
3456 struct LDKCVec_u8Z (*write)(const void *this_arg);
3458 * Called, if set, after this Sign has been cloned into a duplicate object.
3459 * The new Sign is provided, and should be mutated as needed to perform a
3460 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
3462 void (*cloned)(struct LDKSign *NONNULL_PTR new_Sign);
3464 * Frees any resources associated with this object given its this_arg pointer.
3465 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3467 void (*free)(void *this_arg);
3471 * The contents of CResult_SignDecodeErrorZ
3473 typedef union LDKCResult_SignDecodeErrorZPtr {
3475 * A pointer to the contents in the success state.
3476 * Reading from this pointer when `result_ok` is not set is undefined.
3478 struct LDKSign *result;
3480 * A pointer to the contents in the error state.
3481 * Reading from this pointer when `result_ok` is set is undefined.
3483 struct LDKDecodeError *err;
3484 } LDKCResult_SignDecodeErrorZPtr;
3487 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
3488 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
3489 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3491 typedef struct LDKCResult_SignDecodeErrorZ {
3493 * The contents of this CResult_SignDecodeErrorZ, accessible via either
3494 * `err` or `result` depending on the state of `result_ok`.
3496 union LDKCResult_SignDecodeErrorZPtr contents;
3498 * Whether this CResult_SignDecodeErrorZ represents a success state.
3501 } LDKCResult_SignDecodeErrorZ;
3504 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
3505 * allows recovering the exact public key which created the signature given the message.
3507 typedef struct LDKRecoverableSignature {
3509 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
3512 uint8_t serialized_form[68];
3513 } LDKRecoverableSignature;
3516 * The contents of CResult_RecoverableSignatureNoneZ
3518 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
3520 * A pointer to the contents in the success state.
3521 * Reading from this pointer when `result_ok` is not set is undefined.
3523 struct LDKRecoverableSignature *result;
3525 * Note that this value is always NULL, as there are no contents in the Err variant
3528 } LDKCResult_RecoverableSignatureNoneZPtr;
3531 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
3532 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
3533 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3535 typedef struct LDKCResult_RecoverableSignatureNoneZ {
3537 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
3538 * `err` or `result` depending on the state of `result_ok`.
3540 union LDKCResult_RecoverableSignatureNoneZPtr contents;
3542 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
3545 } LDKCResult_RecoverableSignatureNoneZ;
3548 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
3549 * This corresponds to std::vector in C++
3551 typedef struct LDKCVec_CVec_u8ZZ {
3553 * The elements in the array.
3554 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3556 struct LDKCVec_u8Z *data;
3558 * The number of elements pointed to by `data`.
3561 } LDKCVec_CVec_u8ZZ;
3564 * The contents of CResult_CVec_CVec_u8ZZNoneZ
3566 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
3568 * A pointer to the contents in the success state.
3569 * Reading from this pointer when `result_ok` is not set is undefined.
3571 struct LDKCVec_CVec_u8ZZ *result;
3573 * Note that this value is always NULL, as there are no contents in the Err variant
3576 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
3579 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
3580 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
3581 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3583 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
3585 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
3586 * `err` or `result` depending on the state of `result_ok`.
3588 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
3590 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
3593 } LDKCResult_CVec_CVec_u8ZZNoneZ;
3598 * A simple implementation of Sign that just keeps the private keys in memory.
3600 * This implementation performs no policy checks and is insufficient by itself as
3601 * a secure external signer.
3603 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
3605 * A pointer to the opaque Rust object.
3606 * Nearly everywhere, inner must be non-null, however in places where
3607 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3609 LDKnativeInMemorySigner *inner;
3611 * Indicates that this is the only struct which contains the same pointer.
3612 * Rust functions which take ownership of an object provided via an argument require
3613 * this to be true and invalidate the object pointed to by inner.
3616 } LDKInMemorySigner;
3619 * The contents of CResult_InMemorySignerDecodeErrorZ
3621 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
3623 * A pointer to the contents in the success state.
3624 * Reading from this pointer when `result_ok` is not set is undefined.
3626 struct LDKInMemorySigner *result;
3628 * A pointer to the contents in the error state.
3629 * Reading from this pointer when `result_ok` is set is undefined.
3631 struct LDKDecodeError *err;
3632 } LDKCResult_InMemorySignerDecodeErrorZPtr;
3635 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
3636 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3637 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3639 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
3641 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
3642 * `err` or `result` depending on the state of `result_ok`.
3644 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
3646 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
3649 } LDKCResult_InMemorySignerDecodeErrorZ;
3652 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
3653 * This corresponds to std::vector in C++
3655 typedef struct LDKCVec_TxOutZ {
3657 * The elements in the array.
3658 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3660 struct LDKTxOut *data;
3662 * The number of elements pointed to by `data`.
3668 * The contents of CResult_TransactionNoneZ
3670 typedef union LDKCResult_TransactionNoneZPtr {
3672 * A pointer to the contents in the success state.
3673 * Reading from this pointer when `result_ok` is not set is undefined.
3675 struct LDKTransaction *result;
3677 * Note that this value is always NULL, as there are no contents in the Err variant
3680 } LDKCResult_TransactionNoneZPtr;
3683 * A CResult_TransactionNoneZ represents the result of a fallible operation,
3684 * containing a crate::c_types::Transaction on success and a () on failure.
3685 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3687 typedef struct LDKCResult_TransactionNoneZ {
3689 * The contents of this CResult_TransactionNoneZ, accessible via either
3690 * `err` or `result` depending on the state of `result_ok`.
3692 union LDKCResult_TransactionNoneZPtr contents;
3694 * Whether this CResult_TransactionNoneZ represents a success state.
3697 } LDKCResult_TransactionNoneZ;
3702 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
3703 * on-chain transactions to ensure no loss of funds occurs.
3705 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
3706 * information and are actively monitoring the chain.
3708 * Pending Events or updated HTLCs which have not yet been read out by
3709 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
3710 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
3711 * gotten are fully handled before re-serializing the new state.
3713 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
3714 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
3715 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
3716 * returned block hash and the the current chain and then reconnecting blocks to get to the
3717 * best chain) upon deserializing the object!
3719 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
3721 * A pointer to the opaque Rust object.
3722 * Nearly everywhere, inner must be non-null, however in places where
3723 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3725 LDKnativeChannelMonitor *inner;
3727 * Indicates that this is the only struct which contains the same pointer.
3728 * Rust functions which take ownership of an object provided via an argument require
3729 * this to be true and invalidate the object pointed to by inner.
3732 } LDKChannelMonitor;
3735 * A tuple of 2 elements. See the individual fields for the types contained.
3737 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
3739 * The element at position 0
3741 struct LDKThirtyTwoBytes a;
3743 * The element at position 1
3745 struct LDKChannelMonitor b;
3746 } LDKC2Tuple_BlockHashChannelMonitorZ;
3749 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
3750 * This corresponds to std::vector in C++
3752 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
3754 * The elements in the array.
3755 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3757 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
3759 * The number of elements pointed to by `data`.
3762 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
3765 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
3767 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
3769 * A pointer to the contents in the success state.
3770 * Reading from this pointer when `result_ok` is not set is undefined.
3772 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
3774 * A pointer to the contents in the error state.
3775 * Reading from this pointer when `result_ok` is set is undefined.
3777 enum LDKIOError *err;
3778 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
3781 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
3782 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
3783 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3785 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
3787 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
3788 * `err` or `result` depending on the state of `result_ok`.
3790 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
3792 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
3795 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
3798 * An enum which can either contain a u16 or not
3800 typedef enum LDKCOption_u16Z_Tag {
3802 * When we're in this state, this COption_u16Z contains a u16
3804 LDKCOption_u16Z_Some,
3806 * When we're in this state, this COption_u16Z contains nothing
3808 LDKCOption_u16Z_None,
3810 * Must be last for serialization purposes
3812 LDKCOption_u16Z_Sentinel,
3813 } LDKCOption_u16Z_Tag;
3815 typedef struct LDKCOption_u16Z {
3816 LDKCOption_u16Z_Tag tag;
3825 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
3828 typedef enum LDKAPIError_Tag {
3830 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
3831 * are documented, but generally indicates some precondition of a function was violated.
3833 LDKAPIError_APIMisuseError,
3835 * Due to a high feerate, we were unable to complete the request.
3836 * For example, this may be returned if the feerate implies we cannot open a channel at the
3837 * requested value, but opening a larger channel would succeed.
3839 LDKAPIError_FeeRateTooHigh,
3841 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
3842 * too-many-hops, etc).
3844 LDKAPIError_RouteError,
3846 * We were unable to complete the request as the Channel required to do so is unable to
3847 * complete the request (or was not found). This can take many forms, including disconnected
3848 * peer, channel at capacity, channel shutting down, etc.
3850 LDKAPIError_ChannelUnavailable,
3852 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
3853 * attempted action to fail.
3855 LDKAPIError_MonitorUpdateFailed,
3857 * [`KeysInterface::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
3858 * with the channel counterparty as negotiated in [`InitFeatures`].
3860 * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
3861 * a channel or cooperatively close one with this peer (and will have to force-close instead).
3863 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
3864 * [`InitFeatures`]: crate::ln::features::InitFeatures
3866 LDKAPIError_IncompatibleShutdownScript,
3868 * Must be last for serialization purposes
3870 LDKAPIError_Sentinel,
3873 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
3875 * A human-readable error message
3878 } LDKAPIError_LDKAPIMisuseError_Body;
3880 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
3882 * A human-readable error message
3886 * The feerate which was too high.
3889 } LDKAPIError_LDKFeeRateTooHigh_Body;
3891 typedef struct LDKAPIError_LDKRouteError_Body {
3893 * A human-readable error message
3896 } LDKAPIError_LDKRouteError_Body;
3898 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
3900 * A human-readable error message
3903 } LDKAPIError_LDKChannelUnavailable_Body;
3905 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
3907 * The incompatible shutdown script.
3909 struct LDKShutdownScript script;
3910 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
3912 typedef struct MUST_USE_STRUCT LDKAPIError {
3913 LDKAPIError_Tag tag;
3915 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
3916 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
3917 LDKAPIError_LDKRouteError_Body route_error;
3918 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
3919 LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
3924 * The contents of CResult_NoneAPIErrorZ
3926 typedef union LDKCResult_NoneAPIErrorZPtr {
3928 * Note that this value is always NULL, as there are no contents in the OK variant
3932 * A pointer to the contents in the error state.
3933 * Reading from this pointer when `result_ok` is set is undefined.
3935 struct LDKAPIError *err;
3936 } LDKCResult_NoneAPIErrorZPtr;
3939 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
3940 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
3941 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3943 typedef struct LDKCResult_NoneAPIErrorZ {
3945 * The contents of this CResult_NoneAPIErrorZ, accessible via either
3946 * `err` or `result` depending on the state of `result_ok`.
3948 union LDKCResult_NoneAPIErrorZPtr contents;
3950 * Whether this CResult_NoneAPIErrorZ represents a success state.
3953 } LDKCResult_NoneAPIErrorZ;
3956 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
3957 * This corresponds to std::vector in C++
3959 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
3961 * The elements in the array.
3962 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3964 struct LDKCResult_NoneAPIErrorZ *data;
3966 * The number of elements pointed to by `data`.
3969 } LDKCVec_CResult_NoneAPIErrorZZ;
3972 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
3973 * This corresponds to std::vector in C++
3975 typedef struct LDKCVec_APIErrorZ {
3977 * The elements in the array.
3978 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3980 struct LDKAPIError *data;
3982 * The number of elements pointed to by `data`.
3985 } LDKCVec_APIErrorZ;
3988 * If a payment fails to send, it can be in one of several states. This enum is returned as the
3989 * Err() type describing which state the payment is in, see the description of individual enum
3992 typedef enum LDKPaymentSendFailure_Tag {
3994 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
3995 * send the payment at all. No channel state has been changed or messages sent to peers, and
3996 * once you've changed the parameter at error, you can freely retry the payment in full.
3998 LDKPaymentSendFailure_ParameterError,
4000 * A parameter in a single path which was passed to send_payment was invalid, preventing us
4001 * from attempting to send the payment at all. No channel state has been changed or messages
4002 * sent to peers, and once you've changed the parameter at error, you can freely retry the
4005 * The results here are ordered the same as the paths in the route object which was passed to
4008 LDKPaymentSendFailure_PathParameterError,
4010 * All paths which were attempted failed to send, with no channel state change taking place.
4011 * You can freely retry the payment in full (though you probably want to do so over different
4012 * paths than the ones selected).
4014 LDKPaymentSendFailure_AllFailedRetrySafe,
4016 * Some paths which were attempted failed to send, though possibly not all. At least some
4017 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
4018 * in over-/re-payment.
4020 * The results here are ordered the same as the paths in the route object which was passed to
4021 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
4022 * retried (though there is currently no API with which to do so).
4024 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
4025 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
4026 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
4027 * with the latest update_id.
4029 LDKPaymentSendFailure_PartialFailure,
4031 * Must be last for serialization purposes
4033 LDKPaymentSendFailure_Sentinel,
4034 } LDKPaymentSendFailure_Tag;
4036 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
4037 LDKPaymentSendFailure_Tag tag;
4040 struct LDKAPIError parameter_error;
4043 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
4046 struct LDKCVec_APIErrorZ all_failed_retry_safe;
4049 struct LDKCVec_CResult_NoneAPIErrorZZ partial_failure;
4052 } LDKPaymentSendFailure;
4055 * The contents of CResult_NonePaymentSendFailureZ
4057 typedef union LDKCResult_NonePaymentSendFailureZPtr {
4059 * Note that this value is always NULL, as there are no contents in the OK variant
4063 * A pointer to the contents in the error state.
4064 * Reading from this pointer when `result_ok` is set is undefined.
4066 struct LDKPaymentSendFailure *err;
4067 } LDKCResult_NonePaymentSendFailureZPtr;
4070 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
4071 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
4072 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4074 typedef struct LDKCResult_NonePaymentSendFailureZ {
4076 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
4077 * `err` or `result` depending on the state of `result_ok`.
4079 union LDKCResult_NonePaymentSendFailureZPtr contents;
4081 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
4084 } LDKCResult_NonePaymentSendFailureZ;
4087 * The contents of CResult_PaymentHashPaymentSendFailureZ
4089 typedef union LDKCResult_PaymentHashPaymentSendFailureZPtr {
4091 * A pointer to the contents in the success state.
4092 * Reading from this pointer when `result_ok` is not set is undefined.
4094 struct LDKThirtyTwoBytes *result;
4096 * A pointer to the contents in the error state.
4097 * Reading from this pointer when `result_ok` is set is undefined.
4099 struct LDKPaymentSendFailure *err;
4100 } LDKCResult_PaymentHashPaymentSendFailureZPtr;
4103 * A CResult_PaymentHashPaymentSendFailureZ represents the result of a fallible operation,
4104 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
4105 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4107 typedef struct LDKCResult_PaymentHashPaymentSendFailureZ {
4109 * The contents of this CResult_PaymentHashPaymentSendFailureZ, accessible via either
4110 * `err` or `result` depending on the state of `result_ok`.
4112 union LDKCResult_PaymentHashPaymentSendFailureZPtr contents;
4114 * Whether this CResult_PaymentHashPaymentSendFailureZ represents a success state.
4117 } LDKCResult_PaymentHashPaymentSendFailureZ;
4120 * A 4-byte byte array.
4122 typedef struct LDKFourBytes {
4130 * A 16-byte byte array.
4132 typedef struct LDKSixteenBytes {
4140 * A 10-byte byte array.
4142 typedef struct LDKTenBytes {
4150 * An address which can be used to connect to a remote peer
4152 typedef enum LDKNetAddress_Tag {
4154 * An IPv4 address/port on which the peer is listening.
4158 * An IPv6 address/port on which the peer is listening.
4162 * An old-style Tor onion address/port on which the peer is listening.
4164 LDKNetAddress_OnionV2,
4166 * A new-style Tor onion address/port on which the peer is listening.
4167 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
4168 * wrap as base32 and append \".onion\".
4170 LDKNetAddress_OnionV3,
4172 * Must be last for serialization purposes
4174 LDKNetAddress_Sentinel,
4175 } LDKNetAddress_Tag;
4177 typedef struct LDKNetAddress_LDKIPv4_Body {
4179 * The 4-byte IPv4 address
4181 struct LDKFourBytes addr;
4183 * The port on which the node is listening
4186 } LDKNetAddress_LDKIPv4_Body;
4188 typedef struct LDKNetAddress_LDKIPv6_Body {
4190 * The 16-byte IPv6 address
4192 struct LDKSixteenBytes addr;
4194 * The port on which the node is listening
4197 } LDKNetAddress_LDKIPv6_Body;
4199 typedef struct LDKNetAddress_LDKOnionV2_Body {
4201 * The bytes (usually encoded in base32 with \".onion\" appended)
4203 struct LDKTenBytes addr;
4205 * The port on which the node is listening
4208 } LDKNetAddress_LDKOnionV2_Body;
4210 typedef struct LDKNetAddress_LDKOnionV3_Body {
4212 * The ed25519 long-term public key of the peer
4214 struct LDKThirtyTwoBytes ed25519_pubkey;
4216 * The checksum of the pubkey and version, as included in the onion address
4220 * The version byte, as defined by the Tor Onion v3 spec.
4224 * The port on which the node is listening
4227 } LDKNetAddress_LDKOnionV3_Body;
4229 typedef struct MUST_USE_STRUCT LDKNetAddress {
4230 LDKNetAddress_Tag tag;
4232 LDKNetAddress_LDKIPv4_Body i_pv4;
4233 LDKNetAddress_LDKIPv6_Body i_pv6;
4234 LDKNetAddress_LDKOnionV2_Body onion_v2;
4235 LDKNetAddress_LDKOnionV3_Body onion_v3;
4240 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
4241 * This corresponds to std::vector in C++
4243 typedef struct LDKCVec_NetAddressZ {
4245 * The elements in the array.
4246 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4248 struct LDKNetAddress *data;
4250 * The number of elements pointed to by `data`.
4253 } LDKCVec_NetAddressZ;
4256 * A tuple of 2 elements. See the individual fields for the types contained.
4258 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
4260 * The element at position 0
4262 struct LDKThirtyTwoBytes a;
4264 * The element at position 1
4266 struct LDKThirtyTwoBytes b;
4267 } LDKC2Tuple_PaymentHashPaymentSecretZ;
4270 * The contents of CResult_PaymentSecretAPIErrorZ
4272 typedef union LDKCResult_PaymentSecretAPIErrorZPtr {
4274 * A pointer to the contents in the success state.
4275 * Reading from this pointer when `result_ok` is not set is undefined.
4277 struct LDKThirtyTwoBytes *result;
4279 * A pointer to the contents in the error state.
4280 * Reading from this pointer when `result_ok` is set is undefined.
4282 struct LDKAPIError *err;
4283 } LDKCResult_PaymentSecretAPIErrorZPtr;
4286 * A CResult_PaymentSecretAPIErrorZ represents the result of a fallible operation,
4287 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
4288 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4290 typedef struct LDKCResult_PaymentSecretAPIErrorZ {
4292 * The contents of this CResult_PaymentSecretAPIErrorZ, accessible via either
4293 * `err` or `result` depending on the state of `result_ok`.
4295 union LDKCResult_PaymentSecretAPIErrorZPtr contents;
4297 * Whether this CResult_PaymentSecretAPIErrorZ represents a success state.
4300 } LDKCResult_PaymentSecretAPIErrorZ;
4303 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
4304 * This corresponds to std::vector in C++
4306 typedef struct LDKCVec_ChannelMonitorZ {
4308 * The elements in the array.
4309 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4311 struct LDKChannelMonitor *data;
4313 * The number of elements pointed to by `data`.
4316 } LDKCVec_ChannelMonitorZ;
4321 * An update generated by the underlying Channel itself which contains some new information the
4322 * ChannelMonitor should be made aware of.
4324 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
4326 * A pointer to the opaque Rust object.
4327 * Nearly everywhere, inner must be non-null, however in places where
4328 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4330 LDKnativeChannelMonitorUpdate *inner;
4332 * Indicates that this is the only struct which contains the same pointer.
4333 * Rust functions which take ownership of an object provided via an argument require
4334 * this to be true and invalidate the object pointed to by inner.
4337 } LDKChannelMonitorUpdate;
4340 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
4341 * blocks are connected and disconnected.
4343 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
4344 * responsible for maintaining a set of monitors such that they can be updated accordingly as
4345 * channel state changes and HTLCs are resolved. See method documentation for specific
4348 * Implementations **must** ensure that updates are successfully applied and persisted upon method
4349 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
4350 * without taking any further action such as persisting the current state.
4352 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
4353 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
4354 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
4355 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
4356 * multiple instances.
4358 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
4359 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
4360 * [`PermanentFailure`]: channelmonitor::ChannelMonitorUpdateErr::PermanentFailure
4362 typedef struct LDKWatch {
4364 * An opaque pointer which is passed to your function implementations as an argument.
4365 * This has no meaning in the LDK, and can be NULL or any other value.
4369 * Watches a channel identified by `funding_txo` using `monitor`.
4371 * Implementations are responsible for watching the chain for the funding transaction along
4372 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
4373 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
4375 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
4376 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
4377 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
4379 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
4381 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
4383 * Implementations must call [`update_monitor`] with the given update. See
4384 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
4386 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
4387 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
4389 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
4391 * Returns any monitor events since the last call. Subsequent calls must only return new
4394 struct LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
4396 * Frees any resources associated with this object given its this_arg pointer.
4397 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4399 void (*free)(void *this_arg);
4403 * An interface to send a transaction to the Bitcoin network.
4405 typedef struct LDKBroadcasterInterface {
4407 * An opaque pointer which is passed to your function implementations as an argument.
4408 * This has no meaning in the LDK, and can be NULL or any other value.
4412 * Sends a transaction out to (hopefully) be mined.
4414 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
4416 * Frees any resources associated with this object given its this_arg pointer.
4417 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4419 void (*free)(void *this_arg);
4420 } LDKBroadcasterInterface;
4423 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
4424 * own the memory pointed to by data.
4426 typedef struct LDKu8slice {
4428 * A pointer to the byte buffer
4430 const uint8_t *data;
4432 * The number of bytes pointed to by `data`.
4438 * A trait to describe an object which can get user secrets and key material.
4440 typedef struct LDKKeysInterface {
4442 * An opaque pointer which is passed to your function implementations as an argument.
4443 * This has no meaning in the LDK, and can be NULL or any other value.
4447 * Get node secret key (aka node_id or network_key).
4449 * This method must return the same value each time it is called.
4451 struct LDKSecretKey (*get_node_secret)(const void *this_arg);
4453 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
4455 * This method should return a different value each time it is called, to avoid linking
4456 * on-chain funds across channels as controlled to the same user.
4458 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
4460 * Get a script pubkey which we will send funds to when closing a channel.
4462 * This method should return a different value each time it is called, to avoid linking
4463 * on-chain funds across channels as controlled to the same user.
4465 struct LDKShutdownScript (*get_shutdown_scriptpubkey)(const void *this_arg);
4467 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
4468 * restarted with some stale data!
4470 * This method must return a different value each time it is called.
4472 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
4474 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
4475 * onion packets and for temporary channel IDs. There is no requirement that these be
4476 * persisted anywhere, though they must be unique across restarts.
4478 * This method must return a different value each time it is called.
4480 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
4482 * Reads a `Signer` for this `KeysInterface` from the given input stream.
4483 * This is only called during deserialization of other objects which contain
4484 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
4485 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
4486 * contain no versioning scheme. You may wish to include your own version prefix and ensure
4487 * you've read all of the provided bytes to ensure no corruption occurred.
4489 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
4491 * Sign an invoice's preimage (note that this is the preimage of the invoice, not the HTLC's
4492 * preimage). By parameterizing by the preimage instead of the hash, we allow implementors of
4493 * this trait to parse the invoice and make sure they're signing what they expect, rather than
4494 * blindly signing the hash.
4496 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKCVec_u8Z invoice_preimage);
4498 * Frees any resources associated with this object given its this_arg pointer.
4499 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4501 void (*free)(void *this_arg);
4505 * A trait which should be implemented to provide feerate information on a number of time
4508 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
4509 * called from inside the library in response to chain events, P2P events, or timer events).
4511 typedef struct LDKFeeEstimator {
4513 * An opaque pointer which is passed to your function implementations as an argument.
4514 * This has no meaning in the LDK, and can be NULL or any other value.
4518 * Gets estimated satoshis of fee required per 1000 Weight-Units.
4520 * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
4521 * don't put us below 1 satoshi-per-byte).
4523 * This translates to:
4524 * * satoshis-per-byte * 250
4525 * * ceil(satoshis-per-kbyte / 4)
4527 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
4529 * Frees any resources associated with this object given its this_arg pointer.
4530 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4532 void (*free)(void *this_arg);
4536 * A trait encapsulating the operations required of a logger
4538 typedef struct LDKLogger {
4540 * An opaque pointer which is passed to your function implementations as an argument.
4541 * This has no meaning in the LDK, and can be NULL or any other value.
4547 void (*log)(const void *this_arg, const char *record);
4549 * Frees any resources associated with this object given its this_arg pointer.
4550 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4552 void (*free)(void *this_arg);
4558 * Manager which keeps track of a number of channels and sends messages to the appropriate
4559 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
4561 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
4562 * to individual Channels.
4564 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
4565 * all peers during write/read (though does not modify this instance, only the instance being
4566 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
4567 * called funding_transaction_generated for outbound channels).
4569 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
4570 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
4571 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
4572 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
4573 * the serialization process). If the deserialized version is out-of-date compared to the
4574 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
4575 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
4577 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
4578 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
4579 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
4580 * block_connected() to step towards your best block) upon deserialization before using the
4583 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
4584 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
4585 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
4586 * offline for a full minute. In order to track this, you must call
4587 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
4589 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
4590 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
4591 * essentially you should default to using a SimpleRefChannelManager, and use a
4592 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
4593 * you're using lightning-net-tokio.
4595 typedef struct MUST_USE_STRUCT LDKChannelManager {
4597 * A pointer to the opaque Rust object.
4598 * Nearly everywhere, inner must be non-null, however in places where
4599 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4601 LDKnativeChannelManager *inner;
4603 * Indicates that this is the only struct which contains the same pointer.
4604 * Rust functions which take ownership of an object provided via an argument require
4605 * this to be true and invalidate the object pointed to by inner.
4608 } LDKChannelManager;
4611 * A tuple of 2 elements. See the individual fields for the types contained.
4613 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
4615 * The element at position 0
4617 struct LDKThirtyTwoBytes a;
4619 * The element at position 1
4621 struct LDKChannelManager b;
4622 } LDKC2Tuple_BlockHashChannelManagerZ;
4625 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
4627 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
4629 * A pointer to the contents in the success state.
4630 * Reading from this pointer when `result_ok` is not set is undefined.
4632 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
4634 * A pointer to the contents in the error state.
4635 * Reading from this pointer when `result_ok` is set is undefined.
4637 struct LDKDecodeError *err;
4638 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
4641 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
4642 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
4643 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4645 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
4647 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
4648 * `err` or `result` depending on the state of `result_ok`.
4650 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
4652 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
4655 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
4660 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
4661 * with our counterparty.
4663 typedef struct MUST_USE_STRUCT LDKChannelConfig {
4665 * A pointer to the opaque Rust object.
4666 * Nearly everywhere, inner must be non-null, however in places where
4667 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4669 LDKnativeChannelConfig *inner;
4671 * Indicates that this is the only struct which contains the same pointer.
4672 * Rust functions which take ownership of an object provided via an argument require
4673 * this to be true and invalidate the object pointed to by inner.
4679 * The contents of CResult_ChannelConfigDecodeErrorZ
4681 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
4683 * A pointer to the contents in the success state.
4684 * Reading from this pointer when `result_ok` is not set is undefined.
4686 struct LDKChannelConfig *result;
4688 * A pointer to the contents in the error state.
4689 * Reading from this pointer when `result_ok` is set is undefined.
4691 struct LDKDecodeError *err;
4692 } LDKCResult_ChannelConfigDecodeErrorZPtr;
4695 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
4696 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
4697 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4699 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
4701 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
4702 * `err` or `result` depending on the state of `result_ok`.
4704 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
4706 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
4709 } LDKCResult_ChannelConfigDecodeErrorZ;
4712 * The contents of CResult_OutPointDecodeErrorZ
4714 typedef union LDKCResult_OutPointDecodeErrorZPtr {
4716 * A pointer to the contents in the success state.
4717 * Reading from this pointer when `result_ok` is not set is undefined.
4719 struct LDKOutPoint *result;
4721 * A pointer to the contents in the error state.
4722 * Reading from this pointer when `result_ok` is set is undefined.
4724 struct LDKDecodeError *err;
4725 } LDKCResult_OutPointDecodeErrorZPtr;
4728 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
4729 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
4730 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4732 typedef struct LDKCResult_OutPointDecodeErrorZ {
4734 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
4735 * `err` or `result` depending on the state of `result_ok`.
4737 union LDKCResult_OutPointDecodeErrorZPtr contents;
4739 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
4742 } LDKCResult_OutPointDecodeErrorZ;
4745 * The contents of CResult_SiPrefixNoneZ
4747 typedef union LDKCResult_SiPrefixNoneZPtr {
4749 * A pointer to the contents in the success state.
4750 * Reading from this pointer when `result_ok` is not set is undefined.
4752 enum LDKSiPrefix *result;
4754 * Note that this value is always NULL, as there are no contents in the Err variant
4757 } LDKCResult_SiPrefixNoneZPtr;
4760 * A CResult_SiPrefixNoneZ represents the result of a fallible operation,
4761 * containing a crate::lightning_invoice::SiPrefix on success and a () on failure.
4762 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4764 typedef struct LDKCResult_SiPrefixNoneZ {
4766 * The contents of this CResult_SiPrefixNoneZ, accessible via either
4767 * `err` or `result` depending on the state of `result_ok`.
4769 union LDKCResult_SiPrefixNoneZPtr contents;
4771 * Whether this CResult_SiPrefixNoneZ represents a success state.
4774 } LDKCResult_SiPrefixNoneZ;
4779 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
4781 * There are three ways to construct an `Invoice`:
4782 * 1. using `InvoiceBuilder`
4783 * 2. using `Invoice::from_signed(SignedRawInvoice)`
4784 * 3. using `str::parse::<Invoice>(&str)`
4786 typedef struct MUST_USE_STRUCT LDKInvoice {
4788 * A pointer to the opaque Rust object.
4789 * Nearly everywhere, inner must be non-null, however in places where
4790 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4792 LDKnativeInvoice *inner;
4794 * Indicates that this is the only struct which contains the same pointer.
4795 * Rust functions which take ownership of an object provided via an argument require
4796 * this to be true and invalidate the object pointed to by inner.
4802 * The contents of CResult_InvoiceNoneZ
4804 typedef union LDKCResult_InvoiceNoneZPtr {
4806 * A pointer to the contents in the success state.
4807 * Reading from this pointer when `result_ok` is not set is undefined.
4809 struct LDKInvoice *result;
4811 * Note that this value is always NULL, as there are no contents in the Err variant
4814 } LDKCResult_InvoiceNoneZPtr;
4817 * A CResult_InvoiceNoneZ represents the result of a fallible operation,
4818 * containing a crate::lightning_invoice::Invoice on success and a () on failure.
4819 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4821 typedef struct LDKCResult_InvoiceNoneZ {
4823 * The contents of this CResult_InvoiceNoneZ, accessible via either
4824 * `err` or `result` depending on the state of `result_ok`.
4826 union LDKCResult_InvoiceNoneZPtr contents;
4828 * Whether this CResult_InvoiceNoneZ represents a success state.
4831 } LDKCResult_InvoiceNoneZ;
4836 * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be
4840 * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`.
4842 typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
4844 * A pointer to the opaque Rust object.
4845 * Nearly everywhere, inner must be non-null, however in places where
4846 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4848 LDKnativeSignedRawInvoice *inner;
4850 * Indicates that this is the only struct which contains the same pointer.
4851 * Rust functions which take ownership of an object provided via an argument require
4852 * this to be true and invalidate the object pointed to by inner.
4855 } LDKSignedRawInvoice;
4858 * The contents of CResult_SignedRawInvoiceNoneZ
4860 typedef union LDKCResult_SignedRawInvoiceNoneZPtr {
4862 * A pointer to the contents in the success state.
4863 * Reading from this pointer when `result_ok` is not set is undefined.
4865 struct LDKSignedRawInvoice *result;
4867 * Note that this value is always NULL, as there are no contents in the Err variant
4870 } LDKCResult_SignedRawInvoiceNoneZPtr;
4873 * A CResult_SignedRawInvoiceNoneZ represents the result of a fallible operation,
4874 * containing a crate::lightning_invoice::SignedRawInvoice on success and a () on failure.
4875 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4877 typedef struct LDKCResult_SignedRawInvoiceNoneZ {
4879 * The contents of this CResult_SignedRawInvoiceNoneZ, accessible via either
4880 * `err` or `result` depending on the state of `result_ok`.
4882 union LDKCResult_SignedRawInvoiceNoneZPtr contents;
4884 * Whether this CResult_SignedRawInvoiceNoneZ represents a success state.
4887 } LDKCResult_SignedRawInvoiceNoneZ;
4892 * Represents an syntactically correct Invoice for a payment on the lightning network,
4893 * but without the signature information.
4894 * De- and encoding should not lead to information loss but may lead to different hashes.
4896 * For methods without docs see the corresponding methods in `Invoice`.
4898 typedef struct MUST_USE_STRUCT LDKRawInvoice {
4900 * A pointer to the opaque Rust object.
4901 * Nearly everywhere, inner must be non-null, however in places where
4902 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4904 LDKnativeRawInvoice *inner;
4906 * Indicates that this is the only struct which contains the same pointer.
4907 * Rust functions which take ownership of an object provided via an argument require
4908 * this to be true and invalidate the object pointed to by inner.
4916 * Recoverable signature
4918 typedef struct MUST_USE_STRUCT LDKInvoiceSignature {
4920 * A pointer to the opaque Rust object.
4921 * Nearly everywhere, inner must be non-null, however in places where
4922 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4924 LDKnativeInvoiceSignature *inner;
4926 * Indicates that this is the only struct which contains the same pointer.
4927 * Rust functions which take ownership of an object provided via an argument require
4928 * this to be true and invalidate the object pointed to by inner.
4931 } LDKInvoiceSignature;
4934 * A tuple of 3 elements. See the individual fields for the types contained.
4936 typedef struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ {
4938 * The element at position 0
4940 struct LDKRawInvoice a;
4942 * The element at position 1
4944 struct LDKThirtyTwoBytes b;
4946 * The element at position 2
4948 struct LDKInvoiceSignature c;
4949 } LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ;
4956 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
4958 * A pointer to the opaque Rust object.
4959 * Nearly everywhere, inner must be non-null, however in places where
4960 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4962 LDKnativePayeePubKey *inner;
4964 * Indicates that this is the only struct which contains the same pointer.
4965 * Rust functions which take ownership of an object provided via an argument require
4966 * this to be true and invalidate the object pointed to by inner.
4972 * The contents of CResult_PayeePubKeyErrorZ
4974 typedef union LDKCResult_PayeePubKeyErrorZPtr {
4976 * A pointer to the contents in the success state.
4977 * Reading from this pointer when `result_ok` is not set is undefined.
4979 struct LDKPayeePubKey *result;
4981 * A pointer to the contents in the error state.
4982 * Reading from this pointer when `result_ok` is set is undefined.
4984 enum LDKSecp256k1Error *err;
4985 } LDKCResult_PayeePubKeyErrorZPtr;
4988 * A CResult_PayeePubKeyErrorZ represents the result of a fallible operation,
4989 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
4990 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4992 typedef struct LDKCResult_PayeePubKeyErrorZ {
4994 * The contents of this CResult_PayeePubKeyErrorZ, accessible via either
4995 * `err` or `result` depending on the state of `result_ok`.
4997 union LDKCResult_PayeePubKeyErrorZPtr contents;
4999 * Whether this CResult_PayeePubKeyErrorZ represents a success state.
5002 } LDKCResult_PayeePubKeyErrorZ;
5007 * Private routing information
5010 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
5013 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
5015 * A pointer to the opaque Rust object.
5016 * Nearly everywhere, inner must be non-null, however in places where
5017 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5019 LDKnativePrivateRoute *inner;
5021 * Indicates that this is the only struct which contains the same pointer.
5022 * Rust functions which take ownership of an object provided via an argument require
5023 * this to be true and invalidate the object pointed to by inner.
5029 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
5030 * This corresponds to std::vector in C++
5032 typedef struct LDKCVec_PrivateRouteZ {
5034 * The elements in the array.
5035 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5037 struct LDKPrivateRoute *data;
5039 * The number of elements pointed to by `data`.
5042 } LDKCVec_PrivateRouteZ;
5047 * A timestamp that refers to a date after 1 January 1970 which means its representation as UNIX
5048 * timestamp is positive.
5051 * The UNIX timestamp representing the stored time has to be positive and small enough so that
5052 * a `EpiryTime` can be added to it without an overflow.
5054 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
5056 * A pointer to the opaque Rust object.
5057 * Nearly everywhere, inner must be non-null, however in places where
5058 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5060 LDKnativePositiveTimestamp *inner;
5062 * Indicates that this is the only struct which contains the same pointer.
5063 * Rust functions which take ownership of an object provided via an argument require
5064 * this to be true and invalidate the object pointed to by inner.
5067 } LDKPositiveTimestamp;
5070 * The contents of CResult_PositiveTimestampCreationErrorZ
5072 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
5074 * A pointer to the contents in the success state.
5075 * Reading from this pointer when `result_ok` is not set is undefined.
5077 struct LDKPositiveTimestamp *result;
5079 * A pointer to the contents in the error state.
5080 * Reading from this pointer when `result_ok` is set is undefined.
5082 enum LDKCreationError *err;
5083 } LDKCResult_PositiveTimestampCreationErrorZPtr;
5086 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
5087 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
5088 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5090 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
5092 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
5093 * `err` or `result` depending on the state of `result_ok`.
5095 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
5097 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
5100 } LDKCResult_PositiveTimestampCreationErrorZ;
5103 * The contents of CResult_NoneSemanticErrorZ
5105 typedef union LDKCResult_NoneSemanticErrorZPtr {
5107 * Note that this value is always NULL, as there are no contents in the OK variant
5111 * A pointer to the contents in the error state.
5112 * Reading from this pointer when `result_ok` is set is undefined.
5114 enum LDKSemanticError *err;
5115 } LDKCResult_NoneSemanticErrorZPtr;
5118 * A CResult_NoneSemanticErrorZ represents the result of a fallible operation,
5119 * containing a () on success and a crate::lightning_invoice::SemanticError on failure.
5120 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5122 typedef struct LDKCResult_NoneSemanticErrorZ {
5124 * The contents of this CResult_NoneSemanticErrorZ, accessible via either
5125 * `err` or `result` depending on the state of `result_ok`.
5127 union LDKCResult_NoneSemanticErrorZPtr contents;
5129 * Whether this CResult_NoneSemanticErrorZ represents a success state.
5132 } LDKCResult_NoneSemanticErrorZ;
5135 * The contents of CResult_InvoiceSemanticErrorZ
5137 typedef union LDKCResult_InvoiceSemanticErrorZPtr {
5139 * A pointer to the contents in the success state.
5140 * Reading from this pointer when `result_ok` is not set is undefined.
5142 struct LDKInvoice *result;
5144 * A pointer to the contents in the error state.
5145 * Reading from this pointer when `result_ok` is set is undefined.
5147 enum LDKSemanticError *err;
5148 } LDKCResult_InvoiceSemanticErrorZPtr;
5151 * A CResult_InvoiceSemanticErrorZ represents the result of a fallible operation,
5152 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SemanticError on failure.
5153 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5155 typedef struct LDKCResult_InvoiceSemanticErrorZ {
5157 * The contents of this CResult_InvoiceSemanticErrorZ, accessible via either
5158 * `err` or `result` depending on the state of `result_ok`.
5160 union LDKCResult_InvoiceSemanticErrorZPtr contents;
5162 * Whether this CResult_InvoiceSemanticErrorZ represents a success state.
5165 } LDKCResult_InvoiceSemanticErrorZ;
5170 * Description string
5173 * The description can be at most 639 __bytes__ long
5175 typedef struct MUST_USE_STRUCT LDKDescription {
5177 * A pointer to the opaque Rust object.
5178 * Nearly everywhere, inner must be non-null, however in places where
5179 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5181 LDKnativeDescription *inner;
5183 * Indicates that this is the only struct which contains the same pointer.
5184 * Rust functions which take ownership of an object provided via an argument require
5185 * this to be true and invalidate the object pointed to by inner.
5191 * The contents of CResult_DescriptionCreationErrorZ
5193 typedef union LDKCResult_DescriptionCreationErrorZPtr {
5195 * A pointer to the contents in the success state.
5196 * Reading from this pointer when `result_ok` is not set is undefined.
5198 struct LDKDescription *result;
5200 * A pointer to the contents in the error state.
5201 * Reading from this pointer when `result_ok` is set is undefined.
5203 enum LDKCreationError *err;
5204 } LDKCResult_DescriptionCreationErrorZPtr;
5207 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
5208 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
5209 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5211 typedef struct LDKCResult_DescriptionCreationErrorZ {
5213 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
5214 * `err` or `result` depending on the state of `result_ok`.
5216 union LDKCResult_DescriptionCreationErrorZPtr contents;
5218 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
5221 } LDKCResult_DescriptionCreationErrorZ;
5226 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
5230 * The number of seconds this expiry time represents has to be in the range
5231 * `0...(SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME)` to avoid overflows when adding it to a
5234 typedef struct MUST_USE_STRUCT LDKExpiryTime {
5236 * A pointer to the opaque Rust object.
5237 * Nearly everywhere, inner must be non-null, however in places where
5238 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5240 LDKnativeExpiryTime *inner;
5242 * Indicates that this is the only struct which contains the same pointer.
5243 * Rust functions which take ownership of an object provided via an argument require
5244 * this to be true and invalidate the object pointed to by inner.
5250 * The contents of CResult_ExpiryTimeCreationErrorZ
5252 typedef union LDKCResult_ExpiryTimeCreationErrorZPtr {
5254 * A pointer to the contents in the success state.
5255 * Reading from this pointer when `result_ok` is not set is undefined.
5257 struct LDKExpiryTime *result;
5259 * A pointer to the contents in the error state.
5260 * Reading from this pointer when `result_ok` is set is undefined.
5262 enum LDKCreationError *err;
5263 } LDKCResult_ExpiryTimeCreationErrorZPtr;
5266 * A CResult_ExpiryTimeCreationErrorZ represents the result of a fallible operation,
5267 * containing a crate::lightning_invoice::ExpiryTime on success and a crate::lightning_invoice::CreationError on failure.
5268 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5270 typedef struct LDKCResult_ExpiryTimeCreationErrorZ {
5272 * The contents of this CResult_ExpiryTimeCreationErrorZ, accessible via either
5273 * `err` or `result` depending on the state of `result_ok`.
5275 union LDKCResult_ExpiryTimeCreationErrorZPtr contents;
5277 * Whether this CResult_ExpiryTimeCreationErrorZ represents a success state.
5280 } LDKCResult_ExpiryTimeCreationErrorZ;
5283 * The contents of CResult_PrivateRouteCreationErrorZ
5285 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
5287 * A pointer to the contents in the success state.
5288 * Reading from this pointer when `result_ok` is not set is undefined.
5290 struct LDKPrivateRoute *result;
5292 * A pointer to the contents in the error state.
5293 * Reading from this pointer when `result_ok` is set is undefined.
5295 enum LDKCreationError *err;
5296 } LDKCResult_PrivateRouteCreationErrorZPtr;
5299 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
5300 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
5301 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5303 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
5305 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
5306 * `err` or `result` depending on the state of `result_ok`.
5308 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
5310 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
5313 } LDKCResult_PrivateRouteCreationErrorZ;
5316 * The contents of CResult_StringErrorZ
5318 typedef union LDKCResult_StringErrorZPtr {
5320 * A pointer to the contents in the success state.
5321 * Reading from this pointer when `result_ok` is not set is undefined.
5323 struct LDKStr *result;
5325 * A pointer to the contents in the error state.
5326 * Reading from this pointer when `result_ok` is set is undefined.
5328 enum LDKSecp256k1Error *err;
5329 } LDKCResult_StringErrorZPtr;
5332 * A CResult_StringErrorZ represents the result of a fallible operation,
5333 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
5334 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5336 typedef struct LDKCResult_StringErrorZ {
5338 * The contents of this CResult_StringErrorZ, accessible via either
5339 * `err` or `result` depending on the state of `result_ok`.
5341 union LDKCResult_StringErrorZPtr contents;
5343 * Whether this CResult_StringErrorZ represents a success state.
5346 } LDKCResult_StringErrorZ;
5349 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
5351 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
5353 * A pointer to the contents in the success state.
5354 * Reading from this pointer when `result_ok` is not set is undefined.
5356 struct LDKChannelMonitorUpdate *result;
5358 * A pointer to the contents in the error state.
5359 * Reading from this pointer when `result_ok` is set is undefined.
5361 struct LDKDecodeError *err;
5362 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
5365 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
5366 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
5367 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5369 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
5371 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
5372 * `err` or `result` depending on the state of `result_ok`.
5374 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
5376 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
5379 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
5382 * The contents of CResult_HTLCUpdateDecodeErrorZ
5384 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
5386 * A pointer to the contents in the success state.
5387 * Reading from this pointer when `result_ok` is not set is undefined.
5389 struct LDKHTLCUpdate *result;
5391 * A pointer to the contents in the error state.
5392 * Reading from this pointer when `result_ok` is set is undefined.
5394 struct LDKDecodeError *err;
5395 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
5398 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
5399 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
5400 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5402 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
5404 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
5405 * `err` or `result` depending on the state of `result_ok`.
5407 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
5409 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
5412 } LDKCResult_HTLCUpdateDecodeErrorZ;
5417 * General Err type for ChannelMonitor actions. Generally, this implies that the data provided is
5418 * inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this
5419 * means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was
5421 * Contains a developer-readable error message.
5423 typedef struct MUST_USE_STRUCT LDKMonitorUpdateError {
5425 * A pointer to the opaque Rust object.
5426 * Nearly everywhere, inner must be non-null, however in places where
5427 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5429 LDKnativeMonitorUpdateError *inner;
5431 * Indicates that this is the only struct which contains the same pointer.
5432 * Rust functions which take ownership of an object provided via an argument require
5433 * this to be true and invalidate the object pointed to by inner.
5436 } LDKMonitorUpdateError;
5439 * The contents of CResult_NoneMonitorUpdateErrorZ
5441 typedef union LDKCResult_NoneMonitorUpdateErrorZPtr {
5443 * Note that this value is always NULL, as there are no contents in the OK variant
5447 * A pointer to the contents in the error state.
5448 * Reading from this pointer when `result_ok` is set is undefined.
5450 struct LDKMonitorUpdateError *err;
5451 } LDKCResult_NoneMonitorUpdateErrorZPtr;
5454 * A CResult_NoneMonitorUpdateErrorZ represents the result of a fallible operation,
5455 * containing a () on success and a crate::lightning::chain::channelmonitor::MonitorUpdateError on failure.
5456 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5458 typedef struct LDKCResult_NoneMonitorUpdateErrorZ {
5460 * The contents of this CResult_NoneMonitorUpdateErrorZ, accessible via either
5461 * `err` or `result` depending on the state of `result_ok`.
5463 union LDKCResult_NoneMonitorUpdateErrorZPtr contents;
5465 * Whether this CResult_NoneMonitorUpdateErrorZ represents a success state.
5468 } LDKCResult_NoneMonitorUpdateErrorZ;
5471 * A tuple of 2 elements. See the individual fields for the types contained.
5473 typedef struct LDKC2Tuple_OutPointScriptZ {
5475 * The element at position 0
5477 struct LDKOutPoint a;
5479 * The element at position 1
5481 struct LDKCVec_u8Z b;
5482 } LDKC2Tuple_OutPointScriptZ;
5485 * A tuple of 2 elements. See the individual fields for the types contained.
5487 typedef struct LDKC2Tuple_u32ScriptZ {
5489 * The element at position 0
5493 * The element at position 1
5495 struct LDKCVec_u8Z b;
5496 } LDKC2Tuple_u32ScriptZ;
5499 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
5500 * This corresponds to std::vector in C++
5502 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
5504 * The elements in the array.
5505 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5507 struct LDKC2Tuple_u32ScriptZ *data;
5509 * The number of elements pointed to by `data`.
5512 } LDKCVec_C2Tuple_u32ScriptZZ;
5515 * A tuple of 2 elements. See the individual fields for the types contained.
5517 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
5519 * The element at position 0
5521 struct LDKThirtyTwoBytes a;
5523 * The element at position 1
5525 struct LDKCVec_C2Tuple_u32ScriptZZ b;
5526 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
5529 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
5530 * This corresponds to std::vector in C++
5532 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
5534 * The elements in the array.
5535 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5537 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
5539 * The number of elements pointed to by `data`.
5542 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
5545 * Some information provided on receipt of payment depends on whether the payment received is a
5546 * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
5548 typedef enum LDKPaymentPurpose_Tag {
5550 * Information for receiving a payment that we generated an invoice for.
5552 LDKPaymentPurpose_InvoicePayment,
5554 * Because this is a spontaneous payment, the payer generated their own preimage rather than us
5555 * (the payee) providing a preimage.
5557 LDKPaymentPurpose_SpontaneousPayment,
5559 * Must be last for serialization purposes
5561 LDKPaymentPurpose_Sentinel,
5562 } LDKPaymentPurpose_Tag;
5564 typedef struct LDKPaymentPurpose_LDKInvoicePayment_Body {
5566 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
5567 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
5568 * [`ChannelManager::claim_funds`].
5570 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
5571 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
5573 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
5575 struct LDKThirtyTwoBytes payment_preimage;
5577 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
5578 * number of deanonymization attacks during the routing process.
5579 * It is provided here for your reference, however its accuracy is enforced directly by
5580 * [`ChannelManager`] using the values you previously provided to
5581 * [`ChannelManager::create_inbound_payment`] or
5582 * [`ChannelManager::create_inbound_payment_for_hash`].
5584 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
5585 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
5586 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
5588 struct LDKThirtyTwoBytes payment_secret;
5590 * This is the `user_payment_id` which was provided to
5591 * [`ChannelManager::create_inbound_payment_for_hash`] or
5592 * [`ChannelManager::create_inbound_payment`]. It has no meaning inside of LDK and is
5593 * simply copied here. It may be used to correlate PaymentReceived events with invoice
5594 * metadata stored elsewhere.
5596 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
5597 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
5599 uint64_t user_payment_id;
5600 } LDKPaymentPurpose_LDKInvoicePayment_Body;
5602 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
5603 LDKPaymentPurpose_Tag tag;
5605 LDKPaymentPurpose_LDKInvoicePayment_Body invoice_payment;
5607 struct LDKThirtyTwoBytes spontaneous_payment;
5610 } LDKPaymentPurpose;
5613 * An Event which you should probably take some action in response to.
5615 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
5616 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
5617 * written as it makes no sense to respond to it after reconnecting to peers).
5619 typedef enum LDKEvent_Tag {
5621 * Used to indicate that the client should generate a funding transaction with the given
5622 * parameters and then call ChannelManager::funding_transaction_generated.
5623 * Generated in ChannelManager message handling.
5624 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
5625 * counterparty can steal your funds!
5627 LDKEvent_FundingGenerationReady,
5629 * Indicates we've received money! Just gotta dig out that payment preimage and feed it to
5630 * ChannelManager::claim_funds to get it....
5631 * Note that if the preimage is not known or the amount paid is incorrect, you should call
5632 * ChannelManager::fail_htlc_backwards to free up resources for this HTLC and avoid
5633 * network congestion.
5634 * The amount paid should be considered 'incorrect' when it is less than or more than twice
5635 * the amount expected.
5636 * If you fail to call either ChannelManager::claim_funds or
5637 * ChannelManager::fail_htlc_backwards within the HTLC's timeout, the HTLC will be
5638 * automatically failed.
5640 LDKEvent_PaymentReceived,
5642 * Indicates an outbound payment we made succeeded (ie it made it all the way to its target
5643 * and we got back the payment preimage for it).
5645 LDKEvent_PaymentSent,
5647 * Indicates an outbound payment we made failed. Probably some intermediary node dropped
5648 * something. You may wish to retry with a different route.
5650 LDKEvent_PaymentFailed,
5652 * Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
5653 * time in the future.
5655 LDKEvent_PendingHTLCsForwardable,
5657 * Used to indicate that an output which you should know how to spend was confirmed on chain
5658 * and is now spendable.
5659 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
5660 * counterparty spending them due to some kind of timeout. Thus, you need to store them
5661 * somewhere and spend them when you create on-chain transactions.
5663 LDKEvent_SpendableOutputs,
5665 * This event is generated when a payment has been successfully forwarded through us and a
5666 * forwarding fee earned.
5668 LDKEvent_PaymentForwarded,
5670 * Must be last for serialization purposes
5675 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
5677 * The random channel_id we picked which you'll need to pass into
5678 * ChannelManager::funding_transaction_generated.
5680 struct LDKThirtyTwoBytes temporary_channel_id;
5682 * The value, in satoshis, that the output should have.
5684 uint64_t channel_value_satoshis;
5686 * The script which should be used in the transaction output.
5688 struct LDKCVec_u8Z output_script;
5690 * The value passed in to ChannelManager::create_channel
5692 uint64_t user_channel_id;
5693 } LDKEvent_LDKFundingGenerationReady_Body;
5695 typedef struct LDKEvent_LDKPaymentReceived_Body {
5697 * The hash for which the preimage should be handed to the ChannelManager.
5699 struct LDKThirtyTwoBytes payment_hash;
5701 * The value, in thousandths of a satoshi, that this payment is for. Note that you must
5702 * compare this to the expected value before accepting the payment (as otherwise you are
5703 * providing proof-of-payment for less than the value you expected!).
5707 * Information for claiming this received payment, based on whether the purpose of the
5708 * payment is to pay an invoice or to send a spontaneous payment.
5710 struct LDKPaymentPurpose purpose;
5711 } LDKEvent_LDKPaymentReceived_Body;
5713 typedef struct LDKEvent_LDKPaymentSent_Body {
5715 * The preimage to the hash given to ChannelManager::send_payment.
5716 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
5719 struct LDKThirtyTwoBytes payment_preimage;
5720 } LDKEvent_LDKPaymentSent_Body;
5722 typedef struct LDKEvent_LDKPaymentFailed_Body {
5724 * The hash which was given to ChannelManager::send_payment.
5726 struct LDKThirtyTwoBytes payment_hash;
5728 * Indicates the payment was rejected for some reason by the recipient. This implies that
5729 * the payment has failed, not just the route in question. If this is not set, you may
5730 * retry the payment via a different route.
5732 bool rejected_by_dest;
5733 } LDKEvent_LDKPaymentFailed_Body;
5735 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
5737 * The minimum amount of time that should be waited prior to calling
5738 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
5739 * you should wait a random amount of time in roughly the range (now + time_forwardable,
5740 * now + 5*time_forwardable).
5742 uint64_t time_forwardable;
5743 } LDKEvent_LDKPendingHTLCsForwardable_Body;
5745 typedef struct LDKEvent_LDKSpendableOutputs_Body {
5747 * The outputs which you should store as spendable by you.
5749 struct LDKCVec_SpendableOutputDescriptorZ outputs;
5750 } LDKEvent_LDKSpendableOutputs_Body;
5752 typedef struct LDKEvent_LDKPaymentForwarded_Body {
5754 * The fee, in milli-satoshis, which was earned as a result of the payment.
5756 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
5757 * was pending, the amount the next hop claimed will have been rounded down to the nearest
5758 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
5759 * claimed the full value in millisatoshis from the source. In this case,
5760 * `claim_from_onchain_tx` will be set.
5762 * If the channel which sent us the payment has been force-closed, we will claim the funds
5763 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
5764 * fees which we will spend and will instead set this to `None`. It is possible duplicate
5765 * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
5768 struct LDKCOption_u64Z fee_earned_msat;
5770 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
5773 bool claim_from_onchain_tx;
5774 } LDKEvent_LDKPaymentForwarded_Body;
5776 typedef struct MUST_USE_STRUCT LDKEvent {
5779 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
5780 LDKEvent_LDKPaymentReceived_Body payment_received;
5781 LDKEvent_LDKPaymentSent_Body payment_sent;
5782 LDKEvent_LDKPaymentFailed_Body payment_failed;
5783 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
5784 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
5785 LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
5790 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
5791 * This corresponds to std::vector in C++
5793 typedef struct LDKCVec_EventZ {
5795 * The elements in the array.
5796 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5798 struct LDKEvent *data;
5800 * The number of elements pointed to by `data`.
5806 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
5807 * This corresponds to std::vector in C++
5809 typedef struct LDKCVec_TransactionZ {
5811 * The elements in the array.
5812 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5814 struct LDKTransaction *data;
5816 * The number of elements pointed to by `data`.
5819 } LDKCVec_TransactionZ;
5822 * A tuple of 2 elements. See the individual fields for the types contained.
5824 typedef struct LDKC2Tuple_u32TxOutZ {
5826 * The element at position 0
5830 * The element at position 1
5833 } LDKC2Tuple_u32TxOutZ;
5836 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
5837 * This corresponds to std::vector in C++
5839 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
5841 * The elements in the array.
5842 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5844 struct LDKC2Tuple_u32TxOutZ *data;
5846 * The number of elements pointed to by `data`.
5849 } LDKCVec_C2Tuple_u32TxOutZZ;
5852 * A tuple of 2 elements. See the individual fields for the types contained.
5854 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
5856 * The element at position 0
5858 struct LDKThirtyTwoBytes a;
5860 * The element at position 1
5862 struct LDKCVec_C2Tuple_u32TxOutZZ b;
5863 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
5866 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
5867 * This corresponds to std::vector in C++
5869 typedef struct LDKCVec_TransactionOutputsZ {
5871 * The elements in the array.
5872 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5874 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
5876 * The number of elements pointed to by `data`.
5879 } LDKCVec_TransactionOutputsZ;
5882 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
5884 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
5886 * A pointer to the contents in the success state.
5887 * Reading from this pointer when `result_ok` is not set is undefined.
5889 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
5891 * A pointer to the contents in the error state.
5892 * Reading from this pointer when `result_ok` is set is undefined.
5894 struct LDKDecodeError *err;
5895 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
5898 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
5899 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
5900 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5902 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
5904 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
5905 * `err` or `result` depending on the state of `result_ok`.
5907 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
5909 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
5912 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
5915 * The contents of CResult_boolLightningErrorZ
5917 typedef union LDKCResult_boolLightningErrorZPtr {
5919 * A pointer to the contents in the success state.
5920 * Reading from this pointer when `result_ok` is not set is undefined.
5924 * A pointer to the contents in the error state.
5925 * Reading from this pointer when `result_ok` is set is undefined.
5927 struct LDKLightningError *err;
5928 } LDKCResult_boolLightningErrorZPtr;
5931 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
5932 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
5933 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5935 typedef struct LDKCResult_boolLightningErrorZ {
5937 * The contents of this CResult_boolLightningErrorZ, accessible via either
5938 * `err` or `result` depending on the state of `result_ok`.
5940 union LDKCResult_boolLightningErrorZPtr contents;
5942 * Whether this CResult_boolLightningErrorZ represents a success state.
5945 } LDKCResult_boolLightningErrorZ;
5948 * A tuple of 3 elements. See the individual fields for the types contained.
5950 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
5952 * The element at position 0
5954 struct LDKChannelAnnouncement a;
5956 * The element at position 1
5958 struct LDKChannelUpdate b;
5960 * The element at position 2
5962 struct LDKChannelUpdate c;
5963 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
5966 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
5967 * This corresponds to std::vector in C++
5969 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
5971 * The elements in the array.
5972 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5974 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
5976 * The number of elements pointed to by `data`.
5979 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
5982 * A dynamically-allocated array of crate::lightning::ln::msgs::NodeAnnouncements of arbitrary size.
5983 * This corresponds to std::vector in C++
5985 typedef struct LDKCVec_NodeAnnouncementZ {
5987 * The elements in the array.
5988 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5990 struct LDKNodeAnnouncement *data;
5992 * The number of elements pointed to by `data`.
5995 } LDKCVec_NodeAnnouncementZ;
5998 * The contents of CResult_NoneLightningErrorZ
6000 typedef union LDKCResult_NoneLightningErrorZPtr {
6002 * Note that this value is always NULL, as there are no contents in the OK variant
6006 * A pointer to the contents in the error state.
6007 * Reading from this pointer when `result_ok` is set is undefined.
6009 struct LDKLightningError *err;
6010 } LDKCResult_NoneLightningErrorZPtr;
6013 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
6014 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
6015 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6017 typedef struct LDKCResult_NoneLightningErrorZ {
6019 * The contents of this CResult_NoneLightningErrorZ, accessible via either
6020 * `err` or `result` depending on the state of `result_ok`.
6022 union LDKCResult_NoneLightningErrorZPtr contents;
6024 * Whether this CResult_NoneLightningErrorZ represents a success state.
6027 } LDKCResult_NoneLightningErrorZ;
6030 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
6031 * This corresponds to std::vector in C++
6033 typedef struct LDKCVec_PublicKeyZ {
6035 * The elements in the array.
6036 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6038 struct LDKPublicKey *data;
6040 * The number of elements pointed to by `data`.
6043 } LDKCVec_PublicKeyZ;
6048 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
6049 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
6052 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
6054 * A pointer to the opaque Rust object.
6055 * Nearly everywhere, inner must be non-null, however in places where
6056 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6058 LDKnativePeerHandleError *inner;
6060 * Indicates that this is the only struct which contains the same pointer.
6061 * Rust functions which take ownership of an object provided via an argument require
6062 * this to be true and invalidate the object pointed to by inner.
6065 } LDKPeerHandleError;
6068 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
6070 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
6072 * A pointer to the contents in the success state.
6073 * Reading from this pointer when `result_ok` is not set is undefined.
6075 struct LDKCVec_u8Z *result;
6077 * A pointer to the contents in the error state.
6078 * Reading from this pointer when `result_ok` is set is undefined.
6080 struct LDKPeerHandleError *err;
6081 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
6084 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
6085 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
6086 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6088 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
6090 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
6091 * `err` or `result` depending on the state of `result_ok`.
6093 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
6095 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
6098 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
6101 * The contents of CResult_NonePeerHandleErrorZ
6103 typedef union LDKCResult_NonePeerHandleErrorZPtr {
6105 * Note that this value is always NULL, as there are no contents in the OK variant
6109 * A pointer to the contents in the error state.
6110 * Reading from this pointer when `result_ok` is set is undefined.
6112 struct LDKPeerHandleError *err;
6113 } LDKCResult_NonePeerHandleErrorZPtr;
6116 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
6117 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
6118 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6120 typedef struct LDKCResult_NonePeerHandleErrorZ {
6122 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
6123 * `err` or `result` depending on the state of `result_ok`.
6125 union LDKCResult_NonePeerHandleErrorZPtr contents;
6127 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
6130 } LDKCResult_NonePeerHandleErrorZ;
6133 * The contents of CResult_boolPeerHandleErrorZ
6135 typedef union LDKCResult_boolPeerHandleErrorZPtr {
6137 * A pointer to the contents in the success state.
6138 * Reading from this pointer when `result_ok` is not set is undefined.
6142 * A pointer to the contents in the error state.
6143 * Reading from this pointer when `result_ok` is set is undefined.
6145 struct LDKPeerHandleError *err;
6146 } LDKCResult_boolPeerHandleErrorZPtr;
6149 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
6150 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
6151 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6153 typedef struct LDKCResult_boolPeerHandleErrorZ {
6155 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
6156 * `err` or `result` depending on the state of `result_ok`.
6158 union LDKCResult_boolPeerHandleErrorZPtr contents;
6160 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
6163 } LDKCResult_boolPeerHandleErrorZ;
6168 * Details about one direction of a channel. Received
6169 * within a channel update.
6171 typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
6173 * A pointer to the opaque Rust object.
6174 * Nearly everywhere, inner must be non-null, however in places where
6175 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6177 LDKnativeDirectionalChannelInfo *inner;
6179 * Indicates that this is the only struct which contains the same pointer.
6180 * Rust functions which take ownership of an object provided via an argument require
6181 * this to be true and invalidate the object pointed to by inner.
6184 } LDKDirectionalChannelInfo;
6187 * The contents of CResult_DirectionalChannelInfoDecodeErrorZ
6189 typedef union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr {
6191 * A pointer to the contents in the success state.
6192 * Reading from this pointer when `result_ok` is not set is undefined.
6194 struct LDKDirectionalChannelInfo *result;
6196 * A pointer to the contents in the error state.
6197 * Reading from this pointer when `result_ok` is set is undefined.
6199 struct LDKDecodeError *err;
6200 } LDKCResult_DirectionalChannelInfoDecodeErrorZPtr;
6203 * A CResult_DirectionalChannelInfoDecodeErrorZ represents the result of a fallible operation,
6204 * containing a crate::lightning::routing::network_graph::DirectionalChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6205 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6207 typedef struct LDKCResult_DirectionalChannelInfoDecodeErrorZ {
6209 * The contents of this CResult_DirectionalChannelInfoDecodeErrorZ, accessible via either
6210 * `err` or `result` depending on the state of `result_ok`.
6212 union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr contents;
6214 * Whether this CResult_DirectionalChannelInfoDecodeErrorZ represents a success state.
6217 } LDKCResult_DirectionalChannelInfoDecodeErrorZ;
6222 * Details about a channel (both directions).
6223 * Received within a channel announcement.
6225 typedef struct MUST_USE_STRUCT LDKChannelInfo {
6227 * A pointer to the opaque Rust object.
6228 * Nearly everywhere, inner must be non-null, however in places where
6229 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6231 LDKnativeChannelInfo *inner;
6233 * Indicates that this is the only struct which contains the same pointer.
6234 * Rust functions which take ownership of an object provided via an argument require
6235 * this to be true and invalidate the object pointed to by inner.
6241 * The contents of CResult_ChannelInfoDecodeErrorZ
6243 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
6245 * A pointer to the contents in the success state.
6246 * Reading from this pointer when `result_ok` is not set is undefined.
6248 struct LDKChannelInfo *result;
6250 * A pointer to the contents in the error state.
6251 * Reading from this pointer when `result_ok` is set is undefined.
6253 struct LDKDecodeError *err;
6254 } LDKCResult_ChannelInfoDecodeErrorZPtr;
6257 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
6258 * containing a crate::lightning::routing::network_graph::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6259 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6261 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
6263 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
6264 * `err` or `result` depending on the state of `result_ok`.
6266 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
6268 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
6271 } LDKCResult_ChannelInfoDecodeErrorZ;
6276 * Fees for routing via a given channel or a node
6278 typedef struct MUST_USE_STRUCT LDKRoutingFees {
6280 * A pointer to the opaque Rust object.
6281 * Nearly everywhere, inner must be non-null, however in places where
6282 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6284 LDKnativeRoutingFees *inner;
6286 * Indicates that this is the only struct which contains the same pointer.
6287 * Rust functions which take ownership of an object provided via an argument require
6288 * this to be true and invalidate the object pointed to by inner.
6294 * The contents of CResult_RoutingFeesDecodeErrorZ
6296 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
6298 * A pointer to the contents in the success state.
6299 * Reading from this pointer when `result_ok` is not set is undefined.
6301 struct LDKRoutingFees *result;
6303 * A pointer to the contents in the error state.
6304 * Reading from this pointer when `result_ok` is set is undefined.
6306 struct LDKDecodeError *err;
6307 } LDKCResult_RoutingFeesDecodeErrorZPtr;
6310 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
6311 * containing a crate::lightning::routing::network_graph::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
6312 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6314 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
6316 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
6317 * `err` or `result` depending on the state of `result_ok`.
6319 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
6321 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
6324 } LDKCResult_RoutingFeesDecodeErrorZ;
6329 * Information received in the latest node_announcement from this node.
6331 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
6333 * A pointer to the opaque Rust object.
6334 * Nearly everywhere, inner must be non-null, however in places where
6335 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6337 LDKnativeNodeAnnouncementInfo *inner;
6339 * Indicates that this is the only struct which contains the same pointer.
6340 * Rust functions which take ownership of an object provided via an argument require
6341 * this to be true and invalidate the object pointed to by inner.
6344 } LDKNodeAnnouncementInfo;
6347 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
6349 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
6351 * A pointer to the contents in the success state.
6352 * Reading from this pointer when `result_ok` is not set is undefined.
6354 struct LDKNodeAnnouncementInfo *result;
6356 * A pointer to the contents in the error state.
6357 * Reading from this pointer when `result_ok` is set is undefined.
6359 struct LDKDecodeError *err;
6360 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
6363 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
6364 * containing a crate::lightning::routing::network_graph::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6365 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6367 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
6369 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
6370 * `err` or `result` depending on the state of `result_ok`.
6372 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
6374 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
6377 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
6380 * A dynamically-allocated array of u64s of arbitrary size.
6381 * This corresponds to std::vector in C++
6383 typedef struct LDKCVec_u64Z {
6385 * The elements in the array.
6386 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6390 * The number of elements pointed to by `data`.
6398 * Details about a node in the network, known from the network announcement.
6400 typedef struct MUST_USE_STRUCT LDKNodeInfo {
6402 * A pointer to the opaque Rust object.
6403 * Nearly everywhere, inner must be non-null, however in places where
6404 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6406 LDKnativeNodeInfo *inner;
6408 * Indicates that this is the only struct which contains the same pointer.
6409 * Rust functions which take ownership of an object provided via an argument require
6410 * this to be true and invalidate the object pointed to by inner.
6416 * The contents of CResult_NodeInfoDecodeErrorZ
6418 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
6420 * A pointer to the contents in the success state.
6421 * Reading from this pointer when `result_ok` is not set is undefined.
6423 struct LDKNodeInfo *result;
6425 * A pointer to the contents in the error state.
6426 * Reading from this pointer when `result_ok` is set is undefined.
6428 struct LDKDecodeError *err;
6429 } LDKCResult_NodeInfoDecodeErrorZPtr;
6432 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
6433 * containing a crate::lightning::routing::network_graph::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6434 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6436 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
6438 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
6439 * `err` or `result` depending on the state of `result_ok`.
6441 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
6443 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
6446 } LDKCResult_NodeInfoDecodeErrorZ;
6451 * Represents the network as nodes and channels between them
6453 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
6455 * A pointer to the opaque Rust object.
6456 * Nearly everywhere, inner must be non-null, however in places where
6457 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6459 LDKnativeNetworkGraph *inner;
6461 * Indicates that this is the only struct which contains the same pointer.
6462 * Rust functions which take ownership of an object provided via an argument require
6463 * this to be true and invalidate the object pointed to by inner.
6469 * The contents of CResult_NetworkGraphDecodeErrorZ
6471 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
6473 * A pointer to the contents in the success state.
6474 * Reading from this pointer when `result_ok` is not set is undefined.
6476 struct LDKNetworkGraph *result;
6478 * A pointer to the contents in the error state.
6479 * Reading from this pointer when `result_ok` is set is undefined.
6481 struct LDKDecodeError *err;
6482 } LDKCResult_NetworkGraphDecodeErrorZPtr;
6485 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
6486 * containing a crate::lightning::routing::network_graph::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
6487 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6489 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
6491 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
6492 * `err` or `result` depending on the state of `result_ok`.
6494 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
6496 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
6499 } LDKCResult_NetworkGraphDecodeErrorZ;
6502 * The contents of CResult_NetAddressu8Z
6504 typedef union LDKCResult_NetAddressu8ZPtr {
6506 * A pointer to the contents in the success state.
6507 * Reading from this pointer when `result_ok` is not set is undefined.
6509 struct LDKNetAddress *result;
6511 * A pointer to the contents in the error state.
6512 * Reading from this pointer when `result_ok` is set is undefined.
6515 } LDKCResult_NetAddressu8ZPtr;
6518 * A CResult_NetAddressu8Z represents the result of a fallible operation,
6519 * containing a crate::lightning::ln::msgs::NetAddress on success and a u8 on failure.
6520 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6522 typedef struct LDKCResult_NetAddressu8Z {
6524 * The contents of this CResult_NetAddressu8Z, accessible via either
6525 * `err` or `result` depending on the state of `result_ok`.
6527 union LDKCResult_NetAddressu8ZPtr contents;
6529 * Whether this CResult_NetAddressu8Z represents a success state.
6532 } LDKCResult_NetAddressu8Z;
6535 * The contents of CResult_CResult_NetAddressu8ZDecodeErrorZ
6537 typedef union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr {
6539 * A pointer to the contents in the success state.
6540 * Reading from this pointer when `result_ok` is not set is undefined.
6542 struct LDKCResult_NetAddressu8Z *result;
6544 * A pointer to the contents in the error state.
6545 * Reading from this pointer when `result_ok` is set is undefined.
6547 struct LDKDecodeError *err;
6548 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr;
6551 * A CResult_CResult_NetAddressu8ZDecodeErrorZ represents the result of a fallible operation,
6552 * containing a crate::c_types::derived::CResult_NetAddressu8Z on success and a crate::lightning::ln::msgs::DecodeError on failure.
6553 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6555 typedef struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ {
6557 * The contents of this CResult_CResult_NetAddressu8ZDecodeErrorZ, accessible via either
6558 * `err` or `result` depending on the state of `result_ok`.
6560 union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr contents;
6562 * Whether this CResult_CResult_NetAddressu8ZDecodeErrorZ represents a success state.
6565 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZ;
6568 * The contents of CResult_NetAddressDecodeErrorZ
6570 typedef union LDKCResult_NetAddressDecodeErrorZPtr {
6572 * A pointer to the contents in the success state.
6573 * Reading from this pointer when `result_ok` is not set is undefined.
6575 struct LDKNetAddress *result;
6577 * A pointer to the contents in the error state.
6578 * Reading from this pointer when `result_ok` is set is undefined.
6580 struct LDKDecodeError *err;
6581 } LDKCResult_NetAddressDecodeErrorZPtr;
6584 * A CResult_NetAddressDecodeErrorZ represents the result of a fallible operation,
6585 * containing a crate::lightning::ln::msgs::NetAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
6586 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6588 typedef struct LDKCResult_NetAddressDecodeErrorZ {
6590 * The contents of this CResult_NetAddressDecodeErrorZ, accessible via either
6591 * `err` or `result` depending on the state of `result_ok`.
6593 union LDKCResult_NetAddressDecodeErrorZPtr contents;
6595 * Whether this CResult_NetAddressDecodeErrorZ represents a success state.
6598 } LDKCResult_NetAddressDecodeErrorZ;
6603 * An update_add_htlc message to be sent or received from a peer
6605 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
6607 * A pointer to the opaque Rust object.
6608 * Nearly everywhere, inner must be non-null, however in places where
6609 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6611 LDKnativeUpdateAddHTLC *inner;
6613 * Indicates that this is the only struct which contains the same pointer.
6614 * Rust functions which take ownership of an object provided via an argument require
6615 * this to be true and invalidate the object pointed to by inner.
6621 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
6622 * This corresponds to std::vector in C++
6624 typedef struct LDKCVec_UpdateAddHTLCZ {
6626 * The elements in the array.
6627 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6629 struct LDKUpdateAddHTLC *data;
6631 * The number of elements pointed to by `data`.
6634 } LDKCVec_UpdateAddHTLCZ;
6639 * An update_fulfill_htlc message to be sent or received from a peer
6641 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
6643 * A pointer to the opaque Rust object.
6644 * Nearly everywhere, inner must be non-null, however in places where
6645 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6647 LDKnativeUpdateFulfillHTLC *inner;
6649 * Indicates that this is the only struct which contains the same pointer.
6650 * Rust functions which take ownership of an object provided via an argument require
6651 * this to be true and invalidate the object pointed to by inner.
6654 } LDKUpdateFulfillHTLC;
6657 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
6658 * This corresponds to std::vector in C++
6660 typedef struct LDKCVec_UpdateFulfillHTLCZ {
6662 * The elements in the array.
6663 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6665 struct LDKUpdateFulfillHTLC *data;
6667 * The number of elements pointed to by `data`.
6670 } LDKCVec_UpdateFulfillHTLCZ;
6675 * An update_fail_htlc message to be sent or received from a peer
6677 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
6679 * A pointer to the opaque Rust object.
6680 * Nearly everywhere, inner must be non-null, however in places where
6681 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6683 LDKnativeUpdateFailHTLC *inner;
6685 * Indicates that this is the only struct which contains the same pointer.
6686 * Rust functions which take ownership of an object provided via an argument require
6687 * this to be true and invalidate the object pointed to by inner.
6690 } LDKUpdateFailHTLC;
6693 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
6694 * This corresponds to std::vector in C++
6696 typedef struct LDKCVec_UpdateFailHTLCZ {
6698 * The elements in the array.
6699 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6701 struct LDKUpdateFailHTLC *data;
6703 * The number of elements pointed to by `data`.
6706 } LDKCVec_UpdateFailHTLCZ;
6711 * An update_fail_malformed_htlc message to be sent or received from a peer
6713 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
6715 * A pointer to the opaque Rust object.
6716 * Nearly everywhere, inner must be non-null, however in places where
6717 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6719 LDKnativeUpdateFailMalformedHTLC *inner;
6721 * Indicates that this is the only struct which contains the same pointer.
6722 * Rust functions which take ownership of an object provided via an argument require
6723 * this to be true and invalidate the object pointed to by inner.
6726 } LDKUpdateFailMalformedHTLC;
6729 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
6730 * This corresponds to std::vector in C++
6732 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
6734 * The elements in the array.
6735 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6737 struct LDKUpdateFailMalformedHTLC *data;
6739 * The number of elements pointed to by `data`.
6742 } LDKCVec_UpdateFailMalformedHTLCZ;
6745 * The contents of CResult_AcceptChannelDecodeErrorZ
6747 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
6749 * A pointer to the contents in the success state.
6750 * Reading from this pointer when `result_ok` is not set is undefined.
6752 struct LDKAcceptChannel *result;
6754 * A pointer to the contents in the error state.
6755 * Reading from this pointer when `result_ok` is set is undefined.
6757 struct LDKDecodeError *err;
6758 } LDKCResult_AcceptChannelDecodeErrorZPtr;
6761 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
6762 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
6763 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6765 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
6767 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
6768 * `err` or `result` depending on the state of `result_ok`.
6770 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
6772 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
6775 } LDKCResult_AcceptChannelDecodeErrorZ;
6778 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
6780 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
6782 * A pointer to the contents in the success state.
6783 * Reading from this pointer when `result_ok` is not set is undefined.
6785 struct LDKAnnouncementSignatures *result;
6787 * A pointer to the contents in the error state.
6788 * Reading from this pointer when `result_ok` is set is undefined.
6790 struct LDKDecodeError *err;
6791 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
6794 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
6795 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6796 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6798 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
6800 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
6801 * `err` or `result` depending on the state of `result_ok`.
6803 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
6805 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
6808 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
6811 * The contents of CResult_ChannelReestablishDecodeErrorZ
6813 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
6815 * A pointer to the contents in the success state.
6816 * Reading from this pointer when `result_ok` is not set is undefined.
6818 struct LDKChannelReestablish *result;
6820 * A pointer to the contents in the error state.
6821 * Reading from this pointer when `result_ok` is set is undefined.
6823 struct LDKDecodeError *err;
6824 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
6827 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
6828 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
6829 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6831 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
6833 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
6834 * `err` or `result` depending on the state of `result_ok`.
6836 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
6838 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
6841 } LDKCResult_ChannelReestablishDecodeErrorZ;
6844 * The contents of CResult_ClosingSignedDecodeErrorZ
6846 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
6848 * A pointer to the contents in the success state.
6849 * Reading from this pointer when `result_ok` is not set is undefined.
6851 struct LDKClosingSigned *result;
6853 * A pointer to the contents in the error state.
6854 * Reading from this pointer when `result_ok` is set is undefined.
6856 struct LDKDecodeError *err;
6857 } LDKCResult_ClosingSignedDecodeErrorZPtr;
6860 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
6861 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
6862 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6864 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
6866 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
6867 * `err` or `result` depending on the state of `result_ok`.
6869 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
6871 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
6874 } LDKCResult_ClosingSignedDecodeErrorZ;
6879 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
6880 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
6883 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
6885 * A pointer to the opaque Rust object.
6886 * Nearly everywhere, inner must be non-null, however in places where
6887 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6889 LDKnativeClosingSignedFeeRange *inner;
6891 * Indicates that this is the only struct which contains the same pointer.
6892 * Rust functions which take ownership of an object provided via an argument require
6893 * this to be true and invalidate the object pointed to by inner.
6896 } LDKClosingSignedFeeRange;
6899 * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
6901 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
6903 * A pointer to the contents in the success state.
6904 * Reading from this pointer when `result_ok` is not set is undefined.
6906 struct LDKClosingSignedFeeRange *result;
6908 * A pointer to the contents in the error state.
6909 * Reading from this pointer when `result_ok` is set is undefined.
6911 struct LDKDecodeError *err;
6912 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
6915 * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
6916 * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
6917 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6919 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
6921 * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
6922 * `err` or `result` depending on the state of `result_ok`.
6924 union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
6926 * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
6929 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
6934 * A commitment_signed message to be sent or received from a peer
6936 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
6938 * A pointer to the opaque Rust object.
6939 * Nearly everywhere, inner must be non-null, however in places where
6940 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6942 LDKnativeCommitmentSigned *inner;
6944 * Indicates that this is the only struct which contains the same pointer.
6945 * Rust functions which take ownership of an object provided via an argument require
6946 * this to be true and invalidate the object pointed to by inner.
6949 } LDKCommitmentSigned;
6952 * The contents of CResult_CommitmentSignedDecodeErrorZ
6954 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
6956 * A pointer to the contents in the success state.
6957 * Reading from this pointer when `result_ok` is not set is undefined.
6959 struct LDKCommitmentSigned *result;
6961 * A pointer to the contents in the error state.
6962 * Reading from this pointer when `result_ok` is set is undefined.
6964 struct LDKDecodeError *err;
6965 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
6968 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
6969 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
6970 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6972 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
6974 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
6975 * `err` or `result` depending on the state of `result_ok`.
6977 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
6979 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
6982 } LDKCResult_CommitmentSignedDecodeErrorZ;
6985 * The contents of CResult_FundingCreatedDecodeErrorZ
6987 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
6989 * A pointer to the contents in the success state.
6990 * Reading from this pointer when `result_ok` is not set is undefined.
6992 struct LDKFundingCreated *result;
6994 * A pointer to the contents in the error state.
6995 * Reading from this pointer when `result_ok` is set is undefined.
6997 struct LDKDecodeError *err;
6998 } LDKCResult_FundingCreatedDecodeErrorZPtr;
7001 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
7002 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
7003 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7005 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
7007 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
7008 * `err` or `result` depending on the state of `result_ok`.
7010 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
7012 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
7015 } LDKCResult_FundingCreatedDecodeErrorZ;
7018 * The contents of CResult_FundingSignedDecodeErrorZ
7020 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
7022 * A pointer to the contents in the success state.
7023 * Reading from this pointer when `result_ok` is not set is undefined.
7025 struct LDKFundingSigned *result;
7027 * A pointer to the contents in the error state.
7028 * Reading from this pointer when `result_ok` is set is undefined.
7030 struct LDKDecodeError *err;
7031 } LDKCResult_FundingSignedDecodeErrorZPtr;
7034 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
7035 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
7036 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7038 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
7040 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
7041 * `err` or `result` depending on the state of `result_ok`.
7043 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
7045 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
7048 } LDKCResult_FundingSignedDecodeErrorZ;
7051 * The contents of CResult_FundingLockedDecodeErrorZ
7053 typedef union LDKCResult_FundingLockedDecodeErrorZPtr {
7055 * A pointer to the contents in the success state.
7056 * Reading from this pointer when `result_ok` is not set is undefined.
7058 struct LDKFundingLocked *result;
7060 * A pointer to the contents in the error state.
7061 * Reading from this pointer when `result_ok` is set is undefined.
7063 struct LDKDecodeError *err;
7064 } LDKCResult_FundingLockedDecodeErrorZPtr;
7067 * A CResult_FundingLockedDecodeErrorZ represents the result of a fallible operation,
7068 * containing a crate::lightning::ln::msgs::FundingLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
7069 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7071 typedef struct LDKCResult_FundingLockedDecodeErrorZ {
7073 * The contents of this CResult_FundingLockedDecodeErrorZ, accessible via either
7074 * `err` or `result` depending on the state of `result_ok`.
7076 union LDKCResult_FundingLockedDecodeErrorZPtr contents;
7078 * Whether this CResult_FundingLockedDecodeErrorZ represents a success state.
7081 } LDKCResult_FundingLockedDecodeErrorZ;
7086 * An init message to be sent or received from a peer
7088 typedef struct MUST_USE_STRUCT LDKInit {
7090 * A pointer to the opaque Rust object.
7091 * Nearly everywhere, inner must be non-null, however in places where
7092 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7094 LDKnativeInit *inner;
7096 * Indicates that this is the only struct which contains the same pointer.
7097 * Rust functions which take ownership of an object provided via an argument require
7098 * this to be true and invalidate the object pointed to by inner.
7104 * The contents of CResult_InitDecodeErrorZ
7106 typedef union LDKCResult_InitDecodeErrorZPtr {
7108 * A pointer to the contents in the success state.
7109 * Reading from this pointer when `result_ok` is not set is undefined.
7111 struct LDKInit *result;
7113 * A pointer to the contents in the error state.
7114 * Reading from this pointer when `result_ok` is set is undefined.
7116 struct LDKDecodeError *err;
7117 } LDKCResult_InitDecodeErrorZPtr;
7120 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
7121 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
7122 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7124 typedef struct LDKCResult_InitDecodeErrorZ {
7126 * The contents of this CResult_InitDecodeErrorZ, accessible via either
7127 * `err` or `result` depending on the state of `result_ok`.
7129 union LDKCResult_InitDecodeErrorZPtr contents;
7131 * Whether this CResult_InitDecodeErrorZ represents a success state.
7134 } LDKCResult_InitDecodeErrorZ;
7137 * The contents of CResult_OpenChannelDecodeErrorZ
7139 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
7141 * A pointer to the contents in the success state.
7142 * Reading from this pointer when `result_ok` is not set is undefined.
7144 struct LDKOpenChannel *result;
7146 * A pointer to the contents in the error state.
7147 * Reading from this pointer when `result_ok` is set is undefined.
7149 struct LDKDecodeError *err;
7150 } LDKCResult_OpenChannelDecodeErrorZPtr;
7153 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
7154 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
7155 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7157 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
7159 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
7160 * `err` or `result` depending on the state of `result_ok`.
7162 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
7164 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
7167 } LDKCResult_OpenChannelDecodeErrorZ;
7170 * The contents of CResult_RevokeAndACKDecodeErrorZ
7172 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
7174 * A pointer to the contents in the success state.
7175 * Reading from this pointer when `result_ok` is not set is undefined.
7177 struct LDKRevokeAndACK *result;
7179 * A pointer to the contents in the error state.
7180 * Reading from this pointer when `result_ok` is set is undefined.
7182 struct LDKDecodeError *err;
7183 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
7186 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
7187 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
7188 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7190 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
7192 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
7193 * `err` or `result` depending on the state of `result_ok`.
7195 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
7197 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
7200 } LDKCResult_RevokeAndACKDecodeErrorZ;
7203 * The contents of CResult_ShutdownDecodeErrorZ
7205 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
7207 * A pointer to the contents in the success state.
7208 * Reading from this pointer when `result_ok` is not set is undefined.
7210 struct LDKShutdown *result;
7212 * A pointer to the contents in the error state.
7213 * Reading from this pointer when `result_ok` is set is undefined.
7215 struct LDKDecodeError *err;
7216 } LDKCResult_ShutdownDecodeErrorZPtr;
7219 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
7220 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
7221 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7223 typedef struct LDKCResult_ShutdownDecodeErrorZ {
7225 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
7226 * `err` or `result` depending on the state of `result_ok`.
7228 union LDKCResult_ShutdownDecodeErrorZPtr contents;
7230 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
7233 } LDKCResult_ShutdownDecodeErrorZ;
7236 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
7238 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
7240 * A pointer to the contents in the success state.
7241 * Reading from this pointer when `result_ok` is not set is undefined.
7243 struct LDKUpdateFailHTLC *result;
7245 * A pointer to the contents in the error state.
7246 * Reading from this pointer when `result_ok` is set is undefined.
7248 struct LDKDecodeError *err;
7249 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
7252 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
7253 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
7254 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7256 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
7258 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
7259 * `err` or `result` depending on the state of `result_ok`.
7261 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
7263 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
7266 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
7269 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
7271 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
7273 * A pointer to the contents in the success state.
7274 * Reading from this pointer when `result_ok` is not set is undefined.
7276 struct LDKUpdateFailMalformedHTLC *result;
7278 * A pointer to the contents in the error state.
7279 * Reading from this pointer when `result_ok` is set is undefined.
7281 struct LDKDecodeError *err;
7282 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
7285 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
7286 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
7287 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7289 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
7291 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
7292 * `err` or `result` depending on the state of `result_ok`.
7294 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
7296 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
7299 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
7304 * An update_fee message to be sent or received from a peer
7306 typedef struct MUST_USE_STRUCT LDKUpdateFee {
7308 * A pointer to the opaque Rust object.
7309 * Nearly everywhere, inner must be non-null, however in places where
7310 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7312 LDKnativeUpdateFee *inner;
7314 * Indicates that this is the only struct which contains the same pointer.
7315 * Rust functions which take ownership of an object provided via an argument require
7316 * this to be true and invalidate the object pointed to by inner.
7322 * The contents of CResult_UpdateFeeDecodeErrorZ
7324 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
7326 * A pointer to the contents in the success state.
7327 * Reading from this pointer when `result_ok` is not set is undefined.
7329 struct LDKUpdateFee *result;
7331 * A pointer to the contents in the error state.
7332 * Reading from this pointer when `result_ok` is set is undefined.
7334 struct LDKDecodeError *err;
7335 } LDKCResult_UpdateFeeDecodeErrorZPtr;
7338 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
7339 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
7340 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7342 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
7344 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
7345 * `err` or `result` depending on the state of `result_ok`.
7347 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
7349 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
7352 } LDKCResult_UpdateFeeDecodeErrorZ;
7355 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
7357 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
7359 * A pointer to the contents in the success state.
7360 * Reading from this pointer when `result_ok` is not set is undefined.
7362 struct LDKUpdateFulfillHTLC *result;
7364 * A pointer to the contents in the error state.
7365 * Reading from this pointer when `result_ok` is set is undefined.
7367 struct LDKDecodeError *err;
7368 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
7371 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
7372 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
7373 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7375 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
7377 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
7378 * `err` or `result` depending on the state of `result_ok`.
7380 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
7382 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
7385 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
7388 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
7390 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
7392 * A pointer to the contents in the success state.
7393 * Reading from this pointer when `result_ok` is not set is undefined.
7395 struct LDKUpdateAddHTLC *result;
7397 * A pointer to the contents in the error state.
7398 * Reading from this pointer when `result_ok` is set is undefined.
7400 struct LDKDecodeError *err;
7401 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
7404 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
7405 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
7406 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7408 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
7410 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
7411 * `err` or `result` depending on the state of `result_ok`.
7413 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
7415 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
7418 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
7423 * A ping message to be sent or received from a peer
7425 typedef struct MUST_USE_STRUCT LDKPing {
7427 * A pointer to the opaque Rust object.
7428 * Nearly everywhere, inner must be non-null, however in places where
7429 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7431 LDKnativePing *inner;
7433 * Indicates that this is the only struct which contains the same pointer.
7434 * Rust functions which take ownership of an object provided via an argument require
7435 * this to be true and invalidate the object pointed to by inner.
7441 * The contents of CResult_PingDecodeErrorZ
7443 typedef union LDKCResult_PingDecodeErrorZPtr {
7445 * A pointer to the contents in the success state.
7446 * Reading from this pointer when `result_ok` is not set is undefined.
7448 struct LDKPing *result;
7450 * A pointer to the contents in the error state.
7451 * Reading from this pointer when `result_ok` is set is undefined.
7453 struct LDKDecodeError *err;
7454 } LDKCResult_PingDecodeErrorZPtr;
7457 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
7458 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
7459 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7461 typedef struct LDKCResult_PingDecodeErrorZ {
7463 * The contents of this CResult_PingDecodeErrorZ, accessible via either
7464 * `err` or `result` depending on the state of `result_ok`.
7466 union LDKCResult_PingDecodeErrorZPtr contents;
7468 * Whether this CResult_PingDecodeErrorZ represents a success state.
7471 } LDKCResult_PingDecodeErrorZ;
7476 * A pong message to be sent or received from a peer
7478 typedef struct MUST_USE_STRUCT LDKPong {
7480 * A pointer to the opaque Rust object.
7481 * Nearly everywhere, inner must be non-null, however in places where
7482 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7484 LDKnativePong *inner;
7486 * Indicates that this is the only struct which contains the same pointer.
7487 * Rust functions which take ownership of an object provided via an argument require
7488 * this to be true and invalidate the object pointed to by inner.
7494 * The contents of CResult_PongDecodeErrorZ
7496 typedef union LDKCResult_PongDecodeErrorZPtr {
7498 * A pointer to the contents in the success state.
7499 * Reading from this pointer when `result_ok` is not set is undefined.
7501 struct LDKPong *result;
7503 * A pointer to the contents in the error state.
7504 * Reading from this pointer when `result_ok` is set is undefined.
7506 struct LDKDecodeError *err;
7507 } LDKCResult_PongDecodeErrorZPtr;
7510 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
7511 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
7512 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7514 typedef struct LDKCResult_PongDecodeErrorZ {
7516 * The contents of this CResult_PongDecodeErrorZ, accessible via either
7517 * `err` or `result` depending on the state of `result_ok`.
7519 union LDKCResult_PongDecodeErrorZPtr contents;
7521 * Whether this CResult_PongDecodeErrorZ represents a success state.
7524 } LDKCResult_PongDecodeErrorZ;
7527 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
7529 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
7531 * A pointer to the contents in the success state.
7532 * Reading from this pointer when `result_ok` is not set is undefined.
7534 struct LDKUnsignedChannelAnnouncement *result;
7536 * A pointer to the contents in the error state.
7537 * Reading from this pointer when `result_ok` is set is undefined.
7539 struct LDKDecodeError *err;
7540 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
7543 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
7544 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
7545 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7547 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
7549 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
7550 * `err` or `result` depending on the state of `result_ok`.
7552 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
7554 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
7557 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
7560 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
7562 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
7564 * A pointer to the contents in the success state.
7565 * Reading from this pointer when `result_ok` is not set is undefined.
7567 struct LDKChannelAnnouncement *result;
7569 * A pointer to the contents in the error state.
7570 * Reading from this pointer when `result_ok` is set is undefined.
7572 struct LDKDecodeError *err;
7573 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
7576 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
7577 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
7578 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7580 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
7582 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
7583 * `err` or `result` depending on the state of `result_ok`.
7585 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
7587 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
7590 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
7595 * The unsigned part of a channel_update
7597 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
7599 * A pointer to the opaque Rust object.
7600 * Nearly everywhere, inner must be non-null, however in places where
7601 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7603 LDKnativeUnsignedChannelUpdate *inner;
7605 * Indicates that this is the only struct which contains the same pointer.
7606 * Rust functions which take ownership of an object provided via an argument require
7607 * this to be true and invalidate the object pointed to by inner.
7610 } LDKUnsignedChannelUpdate;
7613 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
7615 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
7617 * A pointer to the contents in the success state.
7618 * Reading from this pointer when `result_ok` is not set is undefined.
7620 struct LDKUnsignedChannelUpdate *result;
7622 * A pointer to the contents in the error state.
7623 * Reading from this pointer when `result_ok` is set is undefined.
7625 struct LDKDecodeError *err;
7626 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
7629 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
7630 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
7631 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7633 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
7635 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
7636 * `err` or `result` depending on the state of `result_ok`.
7638 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
7640 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
7643 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
7646 * The contents of CResult_ChannelUpdateDecodeErrorZ
7648 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
7650 * A pointer to the contents in the success state.
7651 * Reading from this pointer when `result_ok` is not set is undefined.
7653 struct LDKChannelUpdate *result;
7655 * A pointer to the contents in the error state.
7656 * Reading from this pointer when `result_ok` is set is undefined.
7658 struct LDKDecodeError *err;
7659 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
7662 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
7663 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
7664 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7666 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
7668 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
7669 * `err` or `result` depending on the state of `result_ok`.
7671 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
7673 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
7676 } LDKCResult_ChannelUpdateDecodeErrorZ;
7679 * The contents of CResult_ErrorMessageDecodeErrorZ
7681 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
7683 * A pointer to the contents in the success state.
7684 * Reading from this pointer when `result_ok` is not set is undefined.
7686 struct LDKErrorMessage *result;
7688 * A pointer to the contents in the error state.
7689 * Reading from this pointer when `result_ok` is set is undefined.
7691 struct LDKDecodeError *err;
7692 } LDKCResult_ErrorMessageDecodeErrorZPtr;
7695 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
7696 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
7697 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7699 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
7701 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
7702 * `err` or `result` depending on the state of `result_ok`.
7704 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
7706 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
7709 } LDKCResult_ErrorMessageDecodeErrorZ;
7714 * The unsigned part of a node_announcement
7716 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
7718 * A pointer to the opaque Rust object.
7719 * Nearly everywhere, inner must be non-null, however in places where
7720 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7722 LDKnativeUnsignedNodeAnnouncement *inner;
7724 * Indicates that this is the only struct which contains the same pointer.
7725 * Rust functions which take ownership of an object provided via an argument require
7726 * this to be true and invalidate the object pointed to by inner.
7729 } LDKUnsignedNodeAnnouncement;
7732 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
7734 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
7736 * A pointer to the contents in the success state.
7737 * Reading from this pointer when `result_ok` is not set is undefined.
7739 struct LDKUnsignedNodeAnnouncement *result;
7741 * A pointer to the contents in the error state.
7742 * Reading from this pointer when `result_ok` is set is undefined.
7744 struct LDKDecodeError *err;
7745 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
7748 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
7749 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
7750 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7752 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
7754 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
7755 * `err` or `result` depending on the state of `result_ok`.
7757 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
7759 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
7762 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
7765 * The contents of CResult_NodeAnnouncementDecodeErrorZ
7767 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
7769 * A pointer to the contents in the success state.
7770 * Reading from this pointer when `result_ok` is not set is undefined.
7772 struct LDKNodeAnnouncement *result;
7774 * A pointer to the contents in the error state.
7775 * Reading from this pointer when `result_ok` is set is undefined.
7777 struct LDKDecodeError *err;
7778 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
7781 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
7782 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
7783 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7785 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
7787 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
7788 * `err` or `result` depending on the state of `result_ok`.
7790 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
7792 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
7795 } LDKCResult_NodeAnnouncementDecodeErrorZ;
7798 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
7800 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
7802 * A pointer to the contents in the success state.
7803 * Reading from this pointer when `result_ok` is not set is undefined.
7805 struct LDKQueryShortChannelIds *result;
7807 * A pointer to the contents in the error state.
7808 * Reading from this pointer when `result_ok` is set is undefined.
7810 struct LDKDecodeError *err;
7811 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
7814 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
7815 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
7816 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7818 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
7820 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
7821 * `err` or `result` depending on the state of `result_ok`.
7823 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
7825 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
7828 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
7833 * A reply_short_channel_ids_end message is sent as a reply to a
7834 * query_short_channel_ids message. The query recipient makes a best
7835 * effort to respond based on their local network view which may not be
7836 * a perfect view of the network.
7838 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
7840 * A pointer to the opaque Rust object.
7841 * Nearly everywhere, inner must be non-null, however in places where
7842 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7844 LDKnativeReplyShortChannelIdsEnd *inner;
7846 * Indicates that this is the only struct which contains the same pointer.
7847 * Rust functions which take ownership of an object provided via an argument require
7848 * this to be true and invalidate the object pointed to by inner.
7851 } LDKReplyShortChannelIdsEnd;
7854 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
7856 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
7858 * A pointer to the contents in the success state.
7859 * Reading from this pointer when `result_ok` is not set is undefined.
7861 struct LDKReplyShortChannelIdsEnd *result;
7863 * A pointer to the contents in the error state.
7864 * Reading from this pointer when `result_ok` is set is undefined.
7866 struct LDKDecodeError *err;
7867 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
7870 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
7871 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
7872 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7874 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
7876 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
7877 * `err` or `result` depending on the state of `result_ok`.
7879 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
7881 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
7884 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
7887 * The contents of CResult_QueryChannelRangeDecodeErrorZ
7889 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
7891 * A pointer to the contents in the success state.
7892 * Reading from this pointer when `result_ok` is not set is undefined.
7894 struct LDKQueryChannelRange *result;
7896 * A pointer to the contents in the error state.
7897 * Reading from this pointer when `result_ok` is set is undefined.
7899 struct LDKDecodeError *err;
7900 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
7903 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
7904 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
7905 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7907 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
7909 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
7910 * `err` or `result` depending on the state of `result_ok`.
7912 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
7914 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
7917 } LDKCResult_QueryChannelRangeDecodeErrorZ;
7920 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
7922 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
7924 * A pointer to the contents in the success state.
7925 * Reading from this pointer when `result_ok` is not set is undefined.
7927 struct LDKReplyChannelRange *result;
7929 * A pointer to the contents in the error state.
7930 * Reading from this pointer when `result_ok` is set is undefined.
7932 struct LDKDecodeError *err;
7933 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
7936 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
7937 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
7938 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7940 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
7942 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
7943 * `err` or `result` depending on the state of `result_ok`.
7945 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
7947 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
7950 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
7955 * A gossip_timestamp_filter message is used by a node to request
7956 * gossip relay for messages in the requested time range when the
7957 * gossip_queries feature has been negotiated.
7959 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
7961 * A pointer to the opaque Rust object.
7962 * Nearly everywhere, inner must be non-null, however in places where
7963 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7965 LDKnativeGossipTimestampFilter *inner;
7967 * Indicates that this is the only struct which contains the same pointer.
7968 * Rust functions which take ownership of an object provided via an argument require
7969 * this to be true and invalidate the object pointed to by inner.
7972 } LDKGossipTimestampFilter;
7975 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
7977 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
7979 * A pointer to the contents in the success state.
7980 * Reading from this pointer when `result_ok` is not set is undefined.
7982 struct LDKGossipTimestampFilter *result;
7984 * A pointer to the contents in the error state.
7985 * Reading from this pointer when `result_ok` is set is undefined.
7987 struct LDKDecodeError *err;
7988 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
7991 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
7992 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
7993 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7995 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
7997 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
7998 * `err` or `result` depending on the state of `result_ok`.
8000 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
8002 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
8005 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
8008 * When signing using a fallible method either an user-supplied `SignError` or a `CreationError`
8011 typedef enum LDKSignOrCreationError_Tag {
8013 * An error occurred during signing
8015 LDKSignOrCreationError_SignError,
8017 * An error occurred while building the transaction
8019 LDKSignOrCreationError_CreationError,
8021 * Must be last for serialization purposes
8023 LDKSignOrCreationError_Sentinel,
8024 } LDKSignOrCreationError_Tag;
8026 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
8027 LDKSignOrCreationError_Tag tag;
8030 enum LDKCreationError creation_error;
8033 } LDKSignOrCreationError;
8036 * The contents of CResult_InvoiceSignOrCreationErrorZ
8038 typedef union LDKCResult_InvoiceSignOrCreationErrorZPtr {
8040 * A pointer to the contents in the success state.
8041 * Reading from this pointer when `result_ok` is not set is undefined.
8043 struct LDKInvoice *result;
8045 * A pointer to the contents in the error state.
8046 * Reading from this pointer when `result_ok` is set is undefined.
8048 struct LDKSignOrCreationError *err;
8049 } LDKCResult_InvoiceSignOrCreationErrorZPtr;
8052 * A CResult_InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
8053 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
8054 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8056 typedef struct LDKCResult_InvoiceSignOrCreationErrorZ {
8058 * The contents of this CResult_InvoiceSignOrCreationErrorZ, accessible via either
8059 * `err` or `result` depending on the state of `result_ok`.
8061 union LDKCResult_InvoiceSignOrCreationErrorZPtr contents;
8063 * Whether this CResult_InvoiceSignOrCreationErrorZ represents a success state.
8066 } LDKCResult_InvoiceSignOrCreationErrorZ;
8069 * A trait indicating an object may generate message send events
8071 typedef struct LDKMessageSendEventsProvider {
8073 * An opaque pointer which is passed to your function implementations as an argument.
8074 * This has no meaning in the LDK, and can be NULL or any other value.
8078 * Gets the list of pending events which were generated by previous actions, clearing the list
8081 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
8083 * Frees any resources associated with this object given its this_arg pointer.
8084 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8086 void (*free)(void *this_arg);
8087 } LDKMessageSendEventsProvider;
8090 * A trait implemented for objects handling events from [`EventsProvider`].
8092 typedef struct LDKEventHandler {
8094 * An opaque pointer which is passed to your function implementations as an argument.
8095 * This has no meaning in the LDK, and can be NULL or any other value.
8099 * Handles the given [`Event`].
8101 * See [`EventsProvider`] for details that must be considered when implementing this method.
8103 void (*handle_event)(const void *this_arg, struct LDKEvent event);
8105 * Frees any resources associated with this object given its this_arg pointer.
8106 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8108 void (*free)(void *this_arg);
8112 * A trait indicating an object may generate events.
8114 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
8118 * See [`process_pending_events`] for requirements around event processing.
8120 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
8121 * event since the last invocation. The handler must either act upon the event immediately
8122 * or preserve it for later handling.
8124 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
8125 * consult the provider's documentation on the implication of processing events and how a handler
8126 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
8127 * [`ChainMonitor::process_pending_events`]).
8129 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
8132 * [`process_pending_events`]: Self::process_pending_events
8133 * [`handle_event`]: EventHandler::handle_event
8134 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
8135 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
8137 typedef struct LDKEventsProvider {
8139 * An opaque pointer which is passed to your function implementations as an argument.
8140 * This has no meaning in the LDK, and can be NULL or any other value.
8144 * Processes any events generated since the last call using the given event handler.
8146 * Subsequent calls must only process new events. However, handlers must be capable of handling
8147 * duplicate events across process restarts. This may occur if the provider was recovered from
8148 * an old state (i.e., it hadn't been successfully persisted after processing pending events).
8150 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
8152 * Frees any resources associated with this object given its this_arg pointer.
8153 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8155 void (*free)(void *this_arg);
8156 } LDKEventsProvider;
8161 * Configuration we set when applicable.
8163 * Default::default() provides sane defaults.
8165 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
8167 * A pointer to the opaque Rust object.
8168 * Nearly everywhere, inner must be non-null, however in places where
8169 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8171 LDKnativeChannelHandshakeConfig *inner;
8173 * Indicates that this is the only struct which contains the same pointer.
8174 * Rust functions which take ownership of an object provided via an argument require
8175 * this to be true and invalidate the object pointed to by inner.
8178 } LDKChannelHandshakeConfig;
8183 * Optional channel limits which are applied during channel creation.
8185 * These limits are only applied to our counterparty's limits, not our own.
8187 * Use 0/<type>::max_value() as appropriate to skip checking.
8189 * Provides sane defaults for most configurations.
8191 * Most additional limits are disabled except those with which specify a default in individual
8192 * field documentation. Note that this may result in barely-usable channels, but since they
8193 * are applied mostly only to incoming channels that's not much of a problem.
8195 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
8197 * A pointer to the opaque Rust object.
8198 * Nearly everywhere, inner must be non-null, however in places where
8199 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8201 LDKnativeChannelHandshakeLimits *inner;
8203 * Indicates that this is the only struct which contains the same pointer.
8204 * Rust functions which take ownership of an object provided via an argument require
8205 * this to be true and invalidate the object pointed to by inner.
8208 } LDKChannelHandshakeLimits;
8213 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
8215 * Default::default() provides sane defaults for most configurations
8216 * (but currently with 0 relay fees!)
8218 typedef struct MUST_USE_STRUCT LDKUserConfig {
8220 * A pointer to the opaque Rust object.
8221 * Nearly everywhere, inner must be non-null, however in places where
8222 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8224 LDKnativeUserConfig *inner;
8226 * Indicates that this is the only struct which contains the same pointer.
8227 * Rust functions which take ownership of an object provided via an argument require
8228 * this to be true and invalidate the object pointed to by inner.
8236 * The best known block as identified by its hash and height.
8238 typedef struct MUST_USE_STRUCT LDKBestBlock {
8240 * A pointer to the opaque Rust object.
8241 * Nearly everywhere, inner must be non-null, however in places where
8242 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8244 LDKnativeBestBlock *inner;
8246 * Indicates that this is the only struct which contains the same pointer.
8247 * Rust functions which take ownership of an object provided via an argument require
8248 * this to be true and invalidate the object pointed to by inner.
8254 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
8257 typedef struct LDKAccess {
8259 * An opaque pointer which is passed to your function implementations as an argument.
8260 * This has no meaning in the LDK, and can be NULL or any other value.
8264 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
8265 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
8268 * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
8270 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
8272 * Frees any resources associated with this object given its this_arg pointer.
8273 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8275 void (*free)(void *this_arg);
8279 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
8282 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
8283 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
8284 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
8287 typedef struct LDKListen {
8289 * An opaque pointer which is passed to your function implementations as an argument.
8290 * This has no meaning in the LDK, and can be NULL or any other value.
8294 * Notifies the listener that a block was added at the given height.
8296 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
8298 * Notifies the listener that a block was removed at the given height.
8300 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
8302 * Frees any resources associated with this object given its this_arg pointer.
8303 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8305 void (*free)(void *this_arg);
8309 * The `Confirm` trait is used to notify when transactions have been confirmed on chain or
8310 * unconfirmed during a chain reorganization.
8312 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
8313 * [`Listen`]. For instance, an Electrum client may implement [`Filter`] by subscribing to activity
8314 * related to registered transactions and outputs. Upon notification, it would pass along the
8315 * matching transactions using this interface.
8319 * The intended use is as follows:
8320 * - Call [`transactions_confirmed`] to process any on-chain activity of interest.
8321 * - Call [`transaction_unconfirmed`] to process any transaction returned by [`get_relevant_txids`]
8322 * that has been reorganized out of the chain.
8323 * - Call [`best_block_updated`] whenever a new chain tip becomes available.
8327 * Clients must call these methods in chain order. Specifically:
8328 * - Transactions confirmed in a block must be given before transactions confirmed in a later
8330 * - Dependent transactions within the same block must be given in topological order, possibly in
8332 * - Unconfirmed transactions must be given after the original confirmations and before any
8335 * See individual method documentation for further details.
8337 * [`transactions_confirmed`]: Self::transactions_confirmed
8338 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
8339 * [`best_block_updated`]: Self::best_block_updated
8340 * [`get_relevant_txids`]: Self::get_relevant_txids
8342 typedef struct LDKConfirm {
8344 * An opaque pointer which is passed to your function implementations as an argument.
8345 * This has no meaning in the LDK, and can be NULL or any other value.
8349 * Processes transactions confirmed in a block with a given header and height.
8351 * Should be called for any transactions registered by [`Filter::register_tx`] or any
8352 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
8353 * appearing in the same block do not need to be included in the same call; instead, multiple
8354 * calls with additional transactions may be made so long as they are made in [chain order].
8356 * May be called before or after [`best_block_updated`] for the corresponding block. However,
8357 * in the event of a chain reorganization, it must not be called with a `header` that is no
8358 * longer in the chain as of the last call to [`best_block_updated`].
8360 * [chain order]: Confirm#Order
8361 * [`best_block_updated`]: Self::best_block_updated
8363 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
8365 * Processes a transaction that is no longer confirmed as result of a chain reorganization.
8367 * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
8368 * reorganized out of the best chain. Once called, the given transaction should not be returned
8369 * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`].
8371 * [`get_relevant_txids`]: Self::get_relevant_txids
8372 * [`transactions_confirmed`]: Self::transactions_confirmed
8374 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
8376 * Processes an update to the best header connected at the given height.
8378 * Should be called when a new header is available but may be skipped for intermediary blocks
8379 * if they become available at the same time.
8381 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
8383 * Returns transactions that should be monitored for reorganization out of the chain.
8385 * Should include any transactions passed to [`transactions_confirmed`] that have insufficient
8386 * confirmations to be safe from a chain reorganization. Should not include any transactions
8387 * passed to [`transaction_unconfirmed`] unless later reconfirmed.
8389 * May be called to determine the subset of transactions that must still be monitored for
8390 * reorganization. Will be idempotent between calls but may change as a result of calls to the
8391 * other interface methods. Thus, this is useful to determine which transactions may need to be
8392 * given to [`transaction_unconfirmed`].
8394 * [`transactions_confirmed`]: Self::transactions_confirmed
8395 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
8397 struct LDKCVec_TxidZ (*get_relevant_txids)(const void *this_arg);
8399 * Frees any resources associated with this object given its this_arg pointer.
8400 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8402 void (*free)(void *this_arg);
8408 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
8410 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
8411 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
8412 * the return value of [`Filter::register_output`].
8414 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
8415 * may have been spent there. See [`Filter::register_output`] for details.
8417 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
8418 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
8420 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
8422 * A pointer to the opaque Rust object.
8423 * Nearly everywhere, inner must be non-null, however in places where
8424 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8426 LDKnativeWatchedOutput *inner;
8428 * Indicates that this is the only struct which contains the same pointer.
8429 * Rust functions which take ownership of an object provided via an argument require
8430 * this to be true and invalidate the object pointed to by inner.
8436 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
8439 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
8440 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
8441 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
8442 * receiving full blocks from a chain source, any further filtering is unnecessary.
8444 * After an output has been registered, subsequent block retrievals from the chain source must not
8445 * exclude any transactions matching the new criteria nor any in-block descendants of such
8448 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
8449 * should not block on I/O. Implementations should instead queue the newly monitored data to be
8450 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
8451 * invocation that has called the `Filter` must return [`TemporaryFailure`].
8453 * [`TemporaryFailure`]: channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure
8454 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
8455 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
8457 typedef struct LDKFilter {
8459 * An opaque pointer which is passed to your function implementations as an argument.
8460 * This has no meaning in the LDK, and can be NULL or any other value.
8464 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
8465 * a spending condition.
8467 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
8469 * Registers interest in spends of a transaction output.
8471 * Optionally, when `output.block_hash` is set, should return any transaction spending the
8472 * output that is found in the corresponding block along with its index.
8474 * This return value is useful for Electrum clients in order to supply in-block descendant
8475 * transactions which otherwise were not included. This is not necessary for other clients if
8476 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
8479 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
8481 * Frees any resources associated with this object given its this_arg pointer.
8482 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8484 void (*free)(void *this_arg);
8488 * `Persist` defines behavior for persisting channel monitors: this could mean
8489 * writing once to disk, and/or uploading to one or more backup services.
8491 * Note that for every new monitor, you **must** persist the new `ChannelMonitor`
8492 * to disk/backups. And, on every update, you **must** persist either the
8493 * `ChannelMonitorUpdate` or the updated monitor itself. Otherwise, there is risk
8494 * of situations such as revoking a transaction, then crashing before this
8495 * revocation can be persisted, then unintentionally broadcasting a revoked
8496 * transaction and losing money. This is a risk because previous channel states
8497 * are toxic, so it's important that whatever channel state is persisted is
8500 typedef struct LDKPersist {
8502 * An opaque pointer which is passed to your function implementations as an argument.
8503 * This has no meaning in the LDK, and can be NULL or any other value.
8507 * Persist a new channel's data. The data can be stored any way you want, but
8508 * the identifier provided by Rust-Lightning is the channel's outpoint (and
8509 * it is up to you to maintain a correct mapping between the outpoint and the
8510 * stored channel data). Note that you **must** persist every new monitor to
8511 * disk. See the `Persist` trait documentation for more details.
8513 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
8514 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
8516 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data);
8518 * Update one channel's data. The provided `ChannelMonitor` has already
8519 * applied the given update.
8521 * Note that on every update, you **must** persist either the
8522 * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See
8523 * the `Persist` trait documentation for more details.
8525 * If an implementer chooses to persist the updates only, they need to make
8526 * sure that all the updates are applied to the `ChannelMonitors` *before*
8527 * the set of channel monitors is given to the `ChannelManager`
8528 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
8529 * applying a monitor update to a monitor. If full `ChannelMonitors` are
8530 * persisted, then there is no need to persist individual updates.
8532 * Note that there could be a performance tradeoff between persisting complete
8533 * channel monitors on every update vs. persisting only updates and applying
8534 * them in batches. The size of each monitor grows `O(number of state updates)`
8535 * whereas updates are small and `O(1)`.
8537 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
8538 * [`ChannelMonitorUpdate::write`] for writing out an update, and
8539 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
8541 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_persisted_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data);
8543 * Frees any resources associated with this object given its this_arg pointer.
8544 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8546 void (*free)(void *this_arg);
8552 * An implementation of [`chain::Watch`] for monitoring channels.
8554 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
8555 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
8556 * or used independently to monitor channels remotely. See the [module-level documentation] for
8559 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
8560 * [module-level documentation]: crate::chain::chainmonitor
8562 typedef struct MUST_USE_STRUCT LDKChainMonitor {
8564 * A pointer to the opaque Rust object.
8565 * Nearly everywhere, inner must be non-null, however in places where
8566 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8568 LDKnativeChainMonitor *inner;
8570 * Indicates that this is the only struct which contains the same pointer.
8571 * Rust functions which take ownership of an object provided via an argument require
8572 * this to be true and invalidate the object pointed to by inner.
8580 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
8581 * and derives keys from that.
8583 * Your node_id is seed/0'
8584 * ChannelMonitor closes may use seed/1'
8585 * Cooperative closes may use seed/2'
8586 * The two close keys may be needed to claim on-chain funds!
8588 typedef struct MUST_USE_STRUCT LDKKeysManager {
8590 * A pointer to the opaque Rust object.
8591 * Nearly everywhere, inner must be non-null, however in places where
8592 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8594 LDKnativeKeysManager *inner;
8596 * Indicates that this is the only struct which contains the same pointer.
8597 * Rust functions which take ownership of an object provided via an argument require
8598 * this to be true and invalidate the object pointed to by inner.
8606 * Chain-related parameters used to construct a new `ChannelManager`.
8608 * Typically, the block-specific parameters are derived from the best block hash for the network,
8609 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
8610 * are not needed when deserializing a previously constructed `ChannelManager`.
8612 typedef struct MUST_USE_STRUCT LDKChainParameters {
8614 * A pointer to the opaque Rust object.
8615 * Nearly everywhere, inner must be non-null, however in places where
8616 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8618 LDKnativeChainParameters *inner;
8620 * Indicates that this is the only struct which contains the same pointer.
8621 * Rust functions which take ownership of an object provided via an argument require
8622 * this to be true and invalidate the object pointed to by inner.
8625 } LDKChainParameters;
8630 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
8631 * to better separate parameters.
8633 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
8635 * A pointer to the opaque Rust object.
8636 * Nearly everywhere, inner must be non-null, however in places where
8637 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8639 LDKnativeChannelCounterparty *inner;
8641 * Indicates that this is the only struct which contains the same pointer.
8642 * Rust functions which take ownership of an object provided via an argument require
8643 * this to be true and invalidate the object pointed to by inner.
8646 } LDKChannelCounterparty;
8649 * A 3-byte byte array.
8651 typedef struct LDKThreeBytes {
8659 * A trait to describe an object which can receive channel messages.
8661 * Messages MAY be called in parallel when they originate from different their_node_ids, however
8662 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
8664 typedef struct LDKChannelMessageHandler {
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 * Handle an incoming open_channel message from the given peer.
8673 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
8675 * Handle an incoming accept_channel message from the given peer.
8677 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
8679 * Handle an incoming funding_created message from the given peer.
8681 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
8683 * Handle an incoming funding_signed message from the given peer.
8685 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
8687 * Handle an incoming funding_locked message from the given peer.
8689 void (*handle_funding_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg);
8691 * Handle an incoming shutdown message from the given peer.
8693 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);
8695 * Handle an incoming closing_signed message from the given peer.
8697 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
8699 * Handle an incoming update_add_htlc message from the given peer.
8701 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
8703 * Handle an incoming update_fulfill_htlc message from the given peer.
8705 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
8707 * Handle an incoming update_fail_htlc message from the given peer.
8709 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
8711 * Handle an incoming update_fail_malformed_htlc message from the given peer.
8713 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
8715 * Handle an incoming commitment_signed message from the given peer.
8717 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
8719 * Handle an incoming revoke_and_ack message from the given peer.
8721 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
8723 * Handle an incoming update_fee message from the given peer.
8725 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
8727 * Handle an incoming announcement_signatures message from the given peer.
8729 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
8731 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
8732 * is believed to be possible in the future (eg they're sending us messages we don't
8733 * understand or indicate they require unknown feature bits), no_connection_possible is set
8734 * and any outstanding channels should be failed.
8736 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
8738 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
8740 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
8742 * Handle an incoming channel_reestablish message from the given peer.
8744 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
8746 * Handle an incoming channel update from the given peer.
8748 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
8750 * Handle an incoming error message from the given peer.
8752 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
8754 * Implementation of MessageSendEventsProvider for this object.
8756 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
8758 * Frees any resources associated with this object given its this_arg pointer.
8759 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8761 void (*free)(void *this_arg);
8762 } LDKChannelMessageHandler;
8767 * Arguments for the creation of a ChannelManager that are not deserialized.
8769 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
8771 * 1) Deserialize all stored ChannelMonitors.
8772 * 2) Deserialize the ChannelManager by filling in this struct and calling:
8773 * <(BlockHash, ChannelManager)>::read(reader, args)
8774 * This may result in closing some Channels if the ChannelMonitor is newer than the stored
8775 * ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted.
8776 * 3) If you are not fetching full blocks, register all relevant ChannelMonitor outpoints the same
8777 * way you would handle a `chain::Filter` call using ChannelMonitor::get_outputs_to_watch() and
8778 * ChannelMonitor::get_funding_txo().
8779 * 4) Reconnect blocks on your ChannelMonitors.
8780 * 5) Disconnect/connect blocks on the ChannelManager.
8781 * 6) Move the ChannelMonitors into your local chain::Watch.
8783 * Note that the ordering of #4-6 is not of importance, however all three must occur before you
8784 * call any other methods on the newly-deserialized ChannelManager.
8786 * Note that because some channels may be closed during deserialization, it is critical that you
8787 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
8788 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
8789 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
8790 * not force-close the same channels but consider them live), you may end up revoking a state for
8791 * which you've already broadcasted the transaction.
8793 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
8795 * A pointer to the opaque Rust object.
8796 * Nearly everywhere, inner must be non-null, however in places where
8797 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8799 LDKnativeChannelManagerReadArgs *inner;
8801 * Indicates that this is the only struct which contains the same pointer.
8802 * Rust functions which take ownership of an object provided via an argument require
8803 * this to be true and invalidate the object pointed to by inner.
8806 } LDKChannelManagerReadArgs;
8811 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
8812 * This is used to convince the recipient that the channel is at a certain commitment
8813 * number even if they lost that data due to a local failure. Of course, the peer may lie
8814 * and even later commitments may have been revoked.
8816 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
8818 * A pointer to the opaque Rust object.
8819 * Nearly everywhere, inner must be non-null, however in places where
8820 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8822 LDKnativeDataLossProtect *inner;
8824 * Indicates that this is the only struct which contains the same pointer.
8825 * Rust functions which take ownership of an object provided via an argument require
8826 * this to be true and invalidate the object pointed to by inner.
8829 } LDKDataLossProtect;
8832 * A trait to describe an object which can receive routing messages.
8834 * # Implementor DoS Warnings
8836 * For `gossip_queries` messages there are potential DoS vectors when handling
8837 * inbound queries. Implementors using an on-disk network graph should be aware of
8838 * repeated disk I/O for queries accessing different parts of the network graph.
8840 typedef struct LDKRoutingMessageHandler {
8842 * An opaque pointer which is passed to your function implementations as an argument.
8843 * This has no meaning in the LDK, and can be NULL or any other value.
8847 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
8848 * false or returning an Err otherwise.
8850 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
8852 * Handle a channel_announcement message, returning true if it should be forwarded on, false
8853 * or returning an Err otherwise.
8855 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
8857 * Handle an incoming channel_update message, returning true if it should be forwarded on,
8858 * false or returning an Err otherwise.
8860 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
8862 * Handle some updates to the route graph that we learned due to an outbound failed payment.
8864 void (*handle_htlc_fail_channel_update)(const void *this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update);
8866 * Gets a subset of the channel announcements and updates required to dump our routing table
8867 * to a remote node, starting at the short_channel_id indicated by starting_point and
8868 * including the batch_amount entries immediately higher in numerical value than starting_point.
8870 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
8872 * Gets a subset of the node announcements required to dump our routing table to a remote node,
8873 * starting at the node *after* the provided publickey and including batch_amount entries
8874 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
8875 * If None is provided for starting_point, we start at the first node.
8877 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
8879 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
8881 * Called when a connection is established with a peer. This can be used to
8882 * perform routing table synchronization using a strategy defined by the
8885 void (*sync_routing_table)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
8887 * Handles the reply of a query we initiated to learn about channels
8888 * for a given range of blocks. We can expect to receive one or more
8889 * replies to a single query.
8891 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
8893 * Handles the reply of a query we initiated asking for routing gossip
8894 * messages for a list of channels. We should receive this message when
8895 * a node has completed its best effort to send us the pertaining routing
8898 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
8900 * Handles when a peer asks us to send a list of short_channel_ids
8901 * for the requested range of blocks.
8903 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
8905 * Handles when a peer asks us to send routing gossip messages for a
8906 * list of short_channel_ids.
8908 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
8910 * Implementation of MessageSendEventsProvider for this object.
8912 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
8914 * Frees any resources associated with this object given its this_arg pointer.
8915 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8917 void (*free)(void *this_arg);
8918 } LDKRoutingMessageHandler;
8923 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
8924 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
8926 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
8928 * A pointer to the opaque Rust object.
8929 * Nearly everywhere, inner must be non-null, however in places where
8930 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8932 LDKnativeIgnoringMessageHandler *inner;
8934 * Indicates that this is the only struct which contains the same pointer.
8935 * Rust functions which take ownership of an object provided via an argument require
8936 * this to be true and invalidate the object pointed to by inner.
8939 } LDKIgnoringMessageHandler;
8944 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
8945 * You can provide one of these as the route_handler in a MessageHandler.
8947 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
8949 * A pointer to the opaque Rust object.
8950 * Nearly everywhere, inner must be non-null, however in places where
8951 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8953 LDKnativeErroringMessageHandler *inner;
8955 * Indicates that this is the only struct which contains the same pointer.
8956 * Rust functions which take ownership of an object provided via an argument require
8957 * this to be true and invalidate the object pointed to by inner.
8960 } LDKErroringMessageHandler;
8965 * Provides references to trait impls which handle different types of messages.
8967 typedef struct MUST_USE_STRUCT LDKMessageHandler {
8969 * A pointer to the opaque Rust object.
8970 * Nearly everywhere, inner must be non-null, however in places where
8971 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8973 LDKnativeMessageHandler *inner;
8975 * Indicates that this is the only struct which contains the same pointer.
8976 * Rust functions which take ownership of an object provided via an argument require
8977 * this to be true and invalidate the object pointed to by inner.
8980 } LDKMessageHandler;
8983 * Provides an object which can be used to send data to and which uniquely identifies a connection
8984 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
8985 * implement Hash to meet the PeerManager API.
8987 * For efficiency, Clone should be relatively cheap for this type.
8989 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
8990 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
8991 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
8992 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
8993 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
8994 * to simply use another value which is guaranteed to be globally unique instead.
8996 typedef struct LDKSocketDescriptor {
8998 * An opaque pointer which is passed to your function implementations as an argument.
8999 * This has no meaning in the LDK, and can be NULL or any other value.
9003 * Attempts to send some data from the given slice to the peer.
9005 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
9006 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
9007 * called and further write attempts may occur until that time.
9009 * If the returned size is smaller than `data.len()`, a
9010 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
9011 * written. Additionally, until a `send_data` event completes fully, no further
9012 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
9013 * prevent denial-of-service issues, you should not read or buffer any data from the socket
9016 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
9017 * (indicating that read events should be paused to prevent DoS in the send buffer),
9018 * `resume_read` may be set indicating that read events on this descriptor should resume. A
9019 * `resume_read` of false carries no meaning, and should not cause any action.
9021 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
9023 * Disconnect the socket pointed to by this SocketDescriptor.
9025 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
9026 * call (doing so is a noop).
9028 void (*disconnect_socket)(void *this_arg);
9030 * Checks if two objects are equal given this object's this_arg pointer and another object.
9032 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
9034 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
9035 * This is used, for example, for inclusion of this object in a hash map.
9037 uint64_t (*hash)(const void *this_arg);
9039 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
9040 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
9041 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
9043 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
9045 * Frees any resources associated with this object given its this_arg pointer.
9046 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9048 void (*free)(void *this_arg);
9049 } LDKSocketDescriptor;
9054 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
9055 * socket events into messages which it passes on to its [`MessageHandler`].
9057 * Locks are taken internally, so you must never assume that reentrancy from a
9058 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
9060 * Calls to [`read_event`] will decode relevant messages and pass them to the
9061 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
9062 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
9063 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
9064 * calls only after previous ones have returned.
9066 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
9067 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
9068 * essentially you should default to using a SimpleRefPeerManager, and use a
9069 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
9070 * you're using lightning-net-tokio.
9072 * [`read_event`]: PeerManager::read_event
9074 typedef struct MUST_USE_STRUCT LDKPeerManager {
9076 * A pointer to the opaque Rust object.
9077 * Nearly everywhere, inner must be non-null, however in places where
9078 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9080 LDKnativePeerManager *inner;
9082 * Indicates that this is the only struct which contains the same pointer.
9083 * Rust functions which take ownership of an object provided via an argument require
9084 * this to be true and invalidate the object pointed to by inner.
9092 * Static channel fields used to build transactions given per-commitment fields, organized by
9093 * broadcaster/countersignatory.
9095 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
9096 * as_holder_broadcastable and as_counterparty_broadcastable functions.
9098 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
9100 * A pointer to the opaque Rust object.
9101 * Nearly everywhere, inner must be non-null, however in places where
9102 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9104 LDKnativeDirectedChannelTransactionParameters *inner;
9106 * Indicates that this is the only struct which contains the same pointer.
9107 * Rust functions which take ownership of an object provided via an argument require
9108 * this to be true and invalidate the object pointed to by inner.
9111 } LDKDirectedChannelTransactionParameters;
9116 * A channel descriptor for a hop along a payment path.
9118 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
9120 * A pointer to the opaque Rust object.
9121 * Nearly everywhere, inner must be non-null, however in places where
9122 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9124 LDKnativeRouteHintHop *inner;
9126 * Indicates that this is the only struct which contains the same pointer.
9127 * Rust functions which take ownership of an object provided via an argument require
9128 * this to be true and invalidate the object pointed to by inner.
9136 * A simple newtype for RwLockReadGuard<'a, NetworkGraph>.
9137 * This exists only to make accessing a RwLock<NetworkGraph> possible from
9138 * the C bindings, as it can be done directly in Rust code.
9140 typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
9142 * A pointer to the opaque Rust object.
9143 * Nearly everywhere, inner must be non-null, however in places where
9144 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9146 LDKnativeLockedNetworkGraph *inner;
9148 * Indicates that this is the only struct which contains the same pointer.
9149 * Rust functions which take ownership of an object provided via an argument require
9150 * this to be true and invalidate the object pointed to by inner.
9153 } LDKLockedNetworkGraph;
9158 * Receives and validates network updates from peers,
9159 * stores authentic and relevant data as a network graph.
9160 * This network graph is then used for routing payments.
9161 * Provides interface to help with initial routing sync by
9162 * serving historical announcements.
9164 typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
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 LDKnativeNetGraphMsgHandler *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 } LDKNetGraphMsgHandler;
9182 * FilesystemPersister persists channel data on disk, where each channel's
9183 * data is stored in a file named after its funding outpoint.
9185 * Warning: this module does the best it can with calls to persist data, but it
9186 * can only guarantee that the data is passed to the drive. It is up to the
9187 * drive manufacturers to do the actual persistence properly, which they often
9188 * don't (especially on consumer-grade hardware). Therefore, it is up to the
9189 * user to validate their entire storage stack, to ensure the writes are
9191 * Corollary: especially when dealing with larger amounts of money, it is best
9192 * practice to have multiple channel data backups and not rely only on one
9193 * FilesystemPersister.
9195 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
9197 * A pointer to the opaque Rust object.
9198 * Nearly everywhere, inner must be non-null, however in places where
9199 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9201 LDKnativeFilesystemPersister *inner;
9203 * Indicates that this is the only struct which contains the same pointer.
9204 * Rust functions which take ownership of an object provided via an argument require
9205 * this to be true and invalidate the object pointed to by inner.
9208 } LDKFilesystemPersister;
9213 * BackgroundProcessor takes care of tasks that (1) need to happen periodically to keep
9214 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
9215 * responsibilities are:
9216 * * Monitoring whether the ChannelManager needs to be re-persisted to disk, and if so,
9217 * writing it to disk/backups by invoking the callback given to it at startup.
9218 * ChannelManager persistence should be done in the background.
9219 * * Calling `ChannelManager::timer_tick_occurred()` and
9220 * `PeerManager::timer_tick_occurred()` every minute (can be done in the
9223 * Note that if ChannelManager persistence fails and the persisted manager becomes out-of-date,
9224 * then there is a risk of channels force-closing on startup when the manager realizes it's
9225 * outdated. However, as long as `ChannelMonitor` backups are sound, no funds besides those used
9226 * for unilateral chain closure fees are at risk.
9227 *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
9229 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
9231 * A pointer to the opaque Rust object.
9232 * Nearly everywhere, inner must be non-null, however in places where
9233 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9235 LDKnativeBackgroundProcessor *inner;
9237 * Indicates that this is the only struct which contains the same pointer.
9238 * Rust functions which take ownership of an object provided via an argument require
9239 * this to be true and invalidate the object pointed to by inner.
9242 } LDKBackgroundProcessor;
9245 * Trait which handles persisting a [`ChannelManager`] to disk.
9247 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
9249 typedef struct LDKChannelManagerPersister {
9251 * An opaque pointer which is passed to your function implementations as an argument.
9252 * This has no meaning in the LDK, and can be NULL or any other value.
9256 * Persist the given [`ChannelManager`] to disk, returning an error if persistence failed
9257 * (which will cause the [`BackgroundProcessor`] which called this method to exit.
9259 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
9261 struct LDKCResult_NoneErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
9263 * Frees any resources associated with this object given its this_arg pointer.
9264 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9266 void (*free)(void *this_arg);
9267 } LDKChannelManagerPersister;
9272 * Data of the `RawInvoice` that is encoded in the data part
9274 typedef struct MUST_USE_STRUCT LDKRawDataPart {
9276 * A pointer to the opaque Rust object.
9277 * Nearly everywhere, inner must be non-null, however in places where
9278 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9280 LDKnativeRawDataPart *inner;
9282 * Indicates that this is the only struct which contains the same pointer.
9283 * Rust functions which take ownership of an object provided via an argument require
9284 * this to be true and invalidate the object pointed to by inner.
9294 typedef struct MUST_USE_STRUCT LDKSha256 {
9296 * A pointer to the opaque Rust object.
9297 * Nearly everywhere, inner must be non-null, however in places where
9298 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9300 LDKnativeSha256 *inner;
9302 * Indicates that this is the only struct which contains the same pointer.
9303 * Rust functions which take ownership of an object provided via an argument require
9304 * this to be true and invalidate the object pointed to by inner.
9312 * `min_final_cltv_expiry` to use for the last HTLC in the route
9314 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiry {
9316 * A pointer to the opaque Rust object.
9317 * Nearly everywhere, inner must be non-null, however in places where
9318 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9320 LDKnativeMinFinalCltvExpiry *inner;
9322 * Indicates that this is the only struct which contains the same pointer.
9323 * Rust functions which take ownership of an object provided via an argument require
9324 * this to be true and invalidate the object pointed to by inner.
9327 } LDKMinFinalCltvExpiry;
9330 * Integer in the range `0..32`
9332 typedef struct LDKu5 {
9337 * A 20-byte byte array.
9339 typedef struct LDKTwentyBytes {
9347 * Fallback address in case no LN payment is possible
9349 typedef enum LDKFallback_Tag {
9350 LDKFallback_SegWitProgram,
9351 LDKFallback_PubKeyHash,
9352 LDKFallback_ScriptHash,
9354 * Must be last for serialization purposes
9356 LDKFallback_Sentinel,
9359 typedef struct LDKFallback_LDKSegWitProgram_Body {
9360 struct LDKu5 version;
9361 struct LDKCVec_u8Z program;
9362 } LDKFallback_LDKSegWitProgram_Body;
9364 typedef struct MUST_USE_STRUCT LDKFallback {
9365 LDKFallback_Tag tag;
9367 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
9369 struct LDKTwentyBytes pub_key_hash;
9372 struct LDKTwentyBytes script_hash;
9377 extern const uintptr_t MAX_BUF_SIZE;
9379 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
9381 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
9383 extern const uint32_t ANTI_REORG_DELAY;
9385 extern const uint16_t BREAKDOWN_TIMEOUT;
9387 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
9389 extern const uint32_t MIN_FINAL_CLTV_EXPIRY;
9391 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
9393 extern const uint64_t DEFAULT_EXPIRY_TIME;
9395 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY;
9397 extern const uint8_t TAG_PAYMENT_HASH;
9399 extern const uint8_t TAG_DESCRIPTION;
9401 extern const uint8_t TAG_PAYEE_PUB_KEY;
9403 extern const uint8_t TAG_DESCRIPTION_HASH;
9405 extern const uint8_t TAG_EXPIRY_TIME;
9407 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY;
9409 extern const uint8_t TAG_FALLBACK;
9411 extern const uint8_t TAG_PRIVATE_ROUTE;
9413 extern const uint8_t TAG_PAYMENT_SECRET;
9415 extern const uint8_t TAG_FEATURES;
9417 struct LDKStr _ldk_get_compiled_version(void);
9419 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
9422 * Frees the data buffer, if data_is_owned is set and datalen > 0.
9424 void Transaction_free(struct LDKTransaction _res);
9427 * Convenience function for constructing a new TxOut
9429 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
9432 * Frees the data pointed to by script_pubkey.
9434 void TxOut_free(struct LDKTxOut _res);
9437 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
9439 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
9442 * Frees the data buffer, if chars_is_owned is set and len > 0.
9444 void Str_free(struct LDKStr _res);
9447 * Creates a new CResult_SecretKeyErrorZ in the success state.
9449 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
9452 * Creates a new CResult_SecretKeyErrorZ in the error state.
9454 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
9457 * Frees any resources used by the CResult_SecretKeyErrorZ.
9459 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
9462 * Creates a new CResult_PublicKeyErrorZ in the success state.
9464 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
9467 * Creates a new CResult_PublicKeyErrorZ in the error state.
9469 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
9472 * Frees any resources used by the CResult_PublicKeyErrorZ.
9474 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
9477 * Creates a new CResult_PublicKeyErrorZ which has the same data as `orig`
9478 * but with all dynamically-allocated buffers duplicated in new buffers.
9480 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig);
9483 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
9485 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
9488 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
9490 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
9493 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
9495 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
9498 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
9499 * but with all dynamically-allocated buffers duplicated in new buffers.
9501 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
9504 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
9506 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
9509 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
9511 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
9514 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
9516 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
9519 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
9520 * but with all dynamically-allocated buffers duplicated in new buffers.
9522 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
9525 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
9527 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
9530 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
9532 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
9535 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
9537 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
9540 * Creates a new CResult_TxCreationKeysErrorZ which has the same data as `orig`
9541 * but with all dynamically-allocated buffers duplicated in new buffers.
9543 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_clone(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR orig);
9546 * Constructs a new COption_u32Z containing a u32
9548 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
9551 * Constructs a new COption_u32Z containing nothing
9553 struct LDKCOption_u32Z COption_u32Z_none(void);
9556 * Frees any resources associated with the u32, if we are in the Some state
9558 void COption_u32Z_free(struct LDKCOption_u32Z _res);
9561 * Creates a new COption_u32Z which has the same data as `orig`
9562 * but with all dynamically-allocated buffers duplicated in new buffers.
9564 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
9567 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
9569 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
9572 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
9574 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
9577 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
9579 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
9582 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
9583 * but with all dynamically-allocated buffers duplicated in new buffers.
9585 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
9588 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
9590 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
9593 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
9595 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
9598 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
9600 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
9603 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
9604 * but with all dynamically-allocated buffers duplicated in new buffers.
9606 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
9609 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
9611 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
9614 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
9616 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
9619 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
9621 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
9624 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
9625 * but with all dynamically-allocated buffers duplicated in new buffers.
9627 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
9630 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9632 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
9635 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
9637 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
9640 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
9642 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
9645 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
9647 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
9650 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
9651 * but with all dynamically-allocated buffers duplicated in new buffers.
9653 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
9656 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
9658 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
9661 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
9663 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
9666 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
9668 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
9671 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
9672 * but with all dynamically-allocated buffers duplicated in new buffers.
9674 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
9677 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
9679 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
9682 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
9684 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
9687 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
9689 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
9692 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
9693 * but with all dynamically-allocated buffers duplicated in new buffers.
9695 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
9698 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
9700 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
9703 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
9705 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
9708 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
9710 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
9713 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
9715 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
9718 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
9720 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
9723 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
9725 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
9728 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
9729 * but with all dynamically-allocated buffers duplicated in new buffers.
9731 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
9734 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
9736 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
9739 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
9741 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
9744 * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
9746 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
9749 * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
9750 * but with all dynamically-allocated buffers duplicated in new buffers.
9752 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
9755 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
9757 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
9760 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
9762 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
9765 * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
9767 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
9770 * Creates a new CResult_NoneErrorZ in the success state.
9772 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
9775 * Creates a new CResult_NoneErrorZ in the error state.
9777 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
9780 * Frees any resources used by the CResult_NoneErrorZ.
9782 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
9785 * Creates a new CResult_NoneErrorZ which has the same data as `orig`
9786 * but with all dynamically-allocated buffers duplicated in new buffers.
9788 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig);
9791 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
9793 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
9796 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
9798 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
9801 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
9803 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
9806 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
9807 * but with all dynamically-allocated buffers duplicated in new buffers.
9809 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
9812 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9814 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
9817 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9819 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
9822 * Creates a new CResult_RouteDecodeErrorZ in the success state.
9824 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
9827 * Creates a new CResult_RouteDecodeErrorZ in the error state.
9829 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
9832 * Frees any resources used by the CResult_RouteDecodeErrorZ.
9834 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
9837 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
9838 * but with all dynamically-allocated buffers duplicated in new buffers.
9840 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
9843 * Constructs a new COption_u64Z containing a u64
9845 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
9848 * Constructs a new COption_u64Z containing nothing
9850 struct LDKCOption_u64Z COption_u64Z_none(void);
9853 * Frees any resources associated with the u64, if we are in the Some state
9855 void COption_u64Z_free(struct LDKCOption_u64Z _res);
9858 * Creates a new COption_u64Z which has the same data as `orig`
9859 * but with all dynamically-allocated buffers duplicated in new buffers.
9861 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
9864 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9866 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
9869 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9871 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
9874 * Creates a new CResult_RouteLightningErrorZ in the success state.
9876 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
9879 * Creates a new CResult_RouteLightningErrorZ in the error state.
9881 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
9884 * Frees any resources used by the CResult_RouteLightningErrorZ.
9886 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
9889 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
9890 * but with all dynamically-allocated buffers duplicated in new buffers.
9892 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
9895 * Creates a new CResult_TxOutAccessErrorZ in the success state.
9897 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
9900 * Creates a new CResult_TxOutAccessErrorZ in the error state.
9902 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
9905 * Frees any resources used by the CResult_TxOutAccessErrorZ.
9907 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
9910 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
9911 * but with all dynamically-allocated buffers duplicated in new buffers.
9913 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
9916 * Creates a new tuple which has the same data as `orig`
9917 * but with all dynamically-allocated buffers duplicated in new buffers.
9919 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
9922 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
9924 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
9927 * Frees any resources used by the C2Tuple_usizeTransactionZ.
9929 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
9932 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9934 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
9937 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9939 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
9942 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
9944 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
9947 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
9949 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
9952 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
9954 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
9957 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
9958 * but with all dynamically-allocated buffers duplicated in new buffers.
9960 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
9963 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9965 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
9968 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ
9970 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
9973 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing
9975 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
9978 * Frees any resources associated with the crate::c_types::derived::C2Tuple_usizeTransactionZ, if we are in the Some state
9980 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
9983 * Creates a new COption_C2Tuple_usizeTransactionZZ which has the same data as `orig`
9984 * but with all dynamically-allocated buffers duplicated in new buffers.
9986 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_clone(const struct LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR orig);
9989 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9991 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
9994 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9996 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
9999 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
10001 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
10004 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
10006 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
10009 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
10011 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
10014 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
10016 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
10019 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
10021 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
10024 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
10026 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
10029 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
10031 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
10034 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
10036 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
10039 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
10041 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
10044 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
10046 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
10049 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
10051 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
10054 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
10056 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
10059 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
10061 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
10064 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
10066 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
10069 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
10071 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
10074 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
10075 * but with all dynamically-allocated buffers duplicated in new buffers.
10077 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
10080 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
10082 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
10085 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
10087 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
10090 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
10092 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
10095 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
10096 * but with all dynamically-allocated buffers duplicated in new buffers.
10098 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
10101 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
10103 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
10106 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
10108 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
10111 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
10113 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
10116 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
10117 * but with all dynamically-allocated buffers duplicated in new buffers.
10119 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
10122 * Creates a new tuple which has the same data as `orig`
10123 * but with all dynamically-allocated buffers duplicated in new buffers.
10125 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
10128 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
10130 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
10133 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
10135 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
10138 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
10140 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
10143 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
10145 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
10148 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
10150 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
10153 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
10154 * but with all dynamically-allocated buffers duplicated in new buffers.
10156 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
10159 * Creates a new CResult_SignatureNoneZ in the success state.
10161 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
10164 * Creates a new CResult_SignatureNoneZ in the error state.
10166 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
10169 * Frees any resources used by the CResult_SignatureNoneZ.
10171 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
10174 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
10175 * but with all dynamically-allocated buffers duplicated in new buffers.
10177 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
10180 * Creates a new CResult_SignDecodeErrorZ in the success state.
10182 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
10185 * Creates a new CResult_SignDecodeErrorZ in the error state.
10187 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
10190 * Frees any resources used by the CResult_SignDecodeErrorZ.
10192 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
10195 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
10196 * but with all dynamically-allocated buffers duplicated in new buffers.
10198 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
10201 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10203 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
10206 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
10208 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
10211 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
10213 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
10216 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
10218 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
10221 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
10222 * but with all dynamically-allocated buffers duplicated in new buffers.
10224 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
10227 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10229 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
10232 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
10234 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
10237 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
10239 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
10242 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
10244 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
10247 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
10248 * but with all dynamically-allocated buffers duplicated in new buffers.
10250 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
10253 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
10255 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
10258 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
10260 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
10263 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
10265 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
10268 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
10269 * but with all dynamically-allocated buffers duplicated in new buffers.
10271 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
10274 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10276 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
10279 * Creates a new CResult_TransactionNoneZ in the success state.
10281 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
10284 * Creates a new CResult_TransactionNoneZ in the error state.
10286 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
10289 * Frees any resources used by the CResult_TransactionNoneZ.
10291 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
10294 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
10295 * but with all dynamically-allocated buffers duplicated in new buffers.
10297 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
10300 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
10302 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
10305 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
10307 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
10310 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10312 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
10315 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
10317 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
10320 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
10322 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
10325 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
10327 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
10330 * Constructs a new COption_u16Z containing a u16
10332 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
10335 * Constructs a new COption_u16Z containing nothing
10337 struct LDKCOption_u16Z COption_u16Z_none(void);
10340 * Frees any resources associated with the u16, if we are in the Some state
10342 void COption_u16Z_free(struct LDKCOption_u16Z _res);
10345 * Creates a new COption_u16Z which has the same data as `orig`
10346 * but with all dynamically-allocated buffers duplicated in new buffers.
10348 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
10351 * Creates a new CResult_NoneAPIErrorZ in the success state.
10353 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
10356 * Creates a new CResult_NoneAPIErrorZ in the error state.
10358 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
10361 * Frees any resources used by the CResult_NoneAPIErrorZ.
10363 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
10366 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
10367 * but with all dynamically-allocated buffers duplicated in new buffers.
10369 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
10372 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10374 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
10377 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10379 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
10382 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
10384 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
10387 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
10389 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
10392 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
10394 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
10397 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
10398 * but with all dynamically-allocated buffers duplicated in new buffers.
10400 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
10403 * Creates a new CResult_PaymentHashPaymentSendFailureZ in the success state.
10405 struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
10408 * Creates a new CResult_PaymentHashPaymentSendFailureZ in the error state.
10410 struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
10413 * Frees any resources used by the CResult_PaymentHashPaymentSendFailureZ.
10415 void CResult_PaymentHashPaymentSendFailureZ_free(struct LDKCResult_PaymentHashPaymentSendFailureZ _res);
10418 * Creates a new CResult_PaymentHashPaymentSendFailureZ which has the same data as `orig`
10419 * but with all dynamically-allocated buffers duplicated in new buffers.
10421 struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_clone(const struct LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR orig);
10424 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10426 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
10429 * Creates a new tuple which has the same data as `orig`
10430 * but with all dynamically-allocated buffers duplicated in new buffers.
10432 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig);
10435 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
10437 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
10440 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
10442 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
10445 * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
10447 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
10450 * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
10452 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
10455 * Frees any resources used by the CResult_PaymentSecretAPIErrorZ.
10457 void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res);
10460 * Creates a new CResult_PaymentSecretAPIErrorZ which has the same data as `orig`
10461 * but with all dynamically-allocated buffers duplicated in new buffers.
10463 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig);
10466 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10468 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
10471 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
10473 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
10476 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
10478 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
10481 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
10483 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
10486 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
10488 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
10491 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
10493 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
10496 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
10498 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
10501 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
10503 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
10506 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
10508 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
10511 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
10512 * but with all dynamically-allocated buffers duplicated in new buffers.
10514 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
10517 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
10519 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
10522 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
10524 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
10527 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
10529 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
10532 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
10533 * but with all dynamically-allocated buffers duplicated in new buffers.
10535 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
10538 * Creates a new CResult_SiPrefixNoneZ in the success state.
10540 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_ok(enum LDKSiPrefix o);
10543 * Creates a new CResult_SiPrefixNoneZ in the error state.
10545 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_err(void);
10548 * Frees any resources used by the CResult_SiPrefixNoneZ.
10550 void CResult_SiPrefixNoneZ_free(struct LDKCResult_SiPrefixNoneZ _res);
10553 * Creates a new CResult_SiPrefixNoneZ which has the same data as `orig`
10554 * but with all dynamically-allocated buffers duplicated in new buffers.
10556 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_clone(const struct LDKCResult_SiPrefixNoneZ *NONNULL_PTR orig);
10559 * Creates a new CResult_InvoiceNoneZ in the success state.
10561 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_ok(struct LDKInvoice o);
10564 * Creates a new CResult_InvoiceNoneZ in the error state.
10566 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_err(void);
10569 * Frees any resources used by the CResult_InvoiceNoneZ.
10571 void CResult_InvoiceNoneZ_free(struct LDKCResult_InvoiceNoneZ _res);
10574 * Creates a new CResult_InvoiceNoneZ which has the same data as `orig`
10575 * but with all dynamically-allocated buffers duplicated in new buffers.
10577 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_clone(const struct LDKCResult_InvoiceNoneZ *NONNULL_PTR orig);
10580 * Creates a new CResult_SignedRawInvoiceNoneZ in the success state.
10582 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_ok(struct LDKSignedRawInvoice o);
10585 * Creates a new CResult_SignedRawInvoiceNoneZ in the error state.
10587 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_err(void);
10590 * Frees any resources used by the CResult_SignedRawInvoiceNoneZ.
10592 void CResult_SignedRawInvoiceNoneZ_free(struct LDKCResult_SignedRawInvoiceNoneZ _res);
10595 * Creates a new CResult_SignedRawInvoiceNoneZ which has the same data as `orig`
10596 * but with all dynamically-allocated buffers duplicated in new buffers.
10598 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_clone(const struct LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR orig);
10601 * Creates a new tuple which has the same data as `orig`
10602 * but with all dynamically-allocated buffers duplicated in new buffers.
10604 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig);
10607 * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements.
10609 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c);
10612 * Frees any resources used by the C3Tuple_RawInvoice_u832InvoiceSignatureZ.
10614 void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res);
10617 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
10619 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
10622 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
10624 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
10627 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
10629 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
10632 * Creates a new CResult_PayeePubKeyErrorZ which has the same data as `orig`
10633 * but with all dynamically-allocated buffers duplicated in new buffers.
10635 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig);
10638 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10640 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
10643 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
10645 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
10648 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
10650 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
10653 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
10655 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
10658 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
10659 * but with all dynamically-allocated buffers duplicated in new buffers.
10661 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
10664 * Creates a new CResult_NoneSemanticErrorZ in the success state.
10666 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void);
10669 * Creates a new CResult_NoneSemanticErrorZ in the error state.
10671 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e);
10674 * Frees any resources used by the CResult_NoneSemanticErrorZ.
10676 void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res);
10679 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
10680 * but with all dynamically-allocated buffers duplicated in new buffers.
10682 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig);
10685 * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
10687 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o);
10690 * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
10692 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e);
10695 * Frees any resources used by the CResult_InvoiceSemanticErrorZ.
10697 void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res);
10700 * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig`
10701 * but with all dynamically-allocated buffers duplicated in new buffers.
10703 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig);
10706 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
10708 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
10711 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
10713 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
10716 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
10718 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
10721 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
10722 * but with all dynamically-allocated buffers duplicated in new buffers.
10724 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
10727 * Creates a new CResult_ExpiryTimeCreationErrorZ in the success state.
10729 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_ok(struct LDKExpiryTime o);
10732 * Creates a new CResult_ExpiryTimeCreationErrorZ in the error state.
10734 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_err(enum LDKCreationError e);
10737 * Frees any resources used by the CResult_ExpiryTimeCreationErrorZ.
10739 void CResult_ExpiryTimeCreationErrorZ_free(struct LDKCResult_ExpiryTimeCreationErrorZ _res);
10742 * Creates a new CResult_ExpiryTimeCreationErrorZ which has the same data as `orig`
10743 * but with all dynamically-allocated buffers duplicated in new buffers.
10745 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_clone(const struct LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR orig);
10748 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
10750 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
10753 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
10755 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
10758 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
10760 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
10763 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
10764 * but with all dynamically-allocated buffers duplicated in new buffers.
10766 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
10769 * Creates a new CResult_StringErrorZ in the success state.
10771 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o);
10774 * Creates a new CResult_StringErrorZ in the error state.
10776 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
10779 * Frees any resources used by the CResult_StringErrorZ.
10781 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
10784 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
10786 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
10789 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
10791 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
10794 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
10796 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
10799 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
10800 * but with all dynamically-allocated buffers duplicated in new buffers.
10802 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
10805 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
10807 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
10810 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
10812 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
10815 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
10817 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
10820 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
10821 * but with all dynamically-allocated buffers duplicated in new buffers.
10823 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
10826 * Creates a new CResult_NoneMonitorUpdateErrorZ in the success state.
10828 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
10831 * Creates a new CResult_NoneMonitorUpdateErrorZ in the error state.
10833 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e);
10836 * Frees any resources used by the CResult_NoneMonitorUpdateErrorZ.
10838 void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res);
10841 * Creates a new CResult_NoneMonitorUpdateErrorZ which has the same data as `orig`
10842 * but with all dynamically-allocated buffers duplicated in new buffers.
10844 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig);
10847 * Creates a new tuple which has the same data as `orig`
10848 * but with all dynamically-allocated buffers duplicated in new buffers.
10850 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
10853 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
10855 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
10858 * Frees any resources used by the C2Tuple_OutPointScriptZ.
10860 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
10863 * Creates a new tuple which has the same data as `orig`
10864 * but with all dynamically-allocated buffers duplicated in new buffers.
10866 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
10869 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
10871 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
10874 * Frees any resources used by the C2Tuple_u32ScriptZ.
10876 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
10879 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10881 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
10884 * Creates a new tuple which has the same data as `orig`
10885 * but with all dynamically-allocated buffers duplicated in new buffers.
10887 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR orig);
10890 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
10892 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
10895 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
10897 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
10900 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10902 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
10905 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10907 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
10910 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10912 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
10915 * Creates a new tuple which has the same data as `orig`
10916 * but with all dynamically-allocated buffers duplicated in new buffers.
10918 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
10921 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
10923 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
10926 * Frees any resources used by the C2Tuple_u32TxOutZ.
10928 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
10931 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10933 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
10936 * Creates a new tuple which has the same data as `orig`
10937 * but with all dynamically-allocated buffers duplicated in new buffers.
10939 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
10942 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
10944 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
10947 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
10949 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
10952 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10954 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
10957 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
10959 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
10962 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
10964 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
10967 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
10969 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
10972 * Creates a new CResult_boolLightningErrorZ in the success state.
10974 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
10977 * Creates a new CResult_boolLightningErrorZ in the error state.
10979 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
10982 * Frees any resources used by the CResult_boolLightningErrorZ.
10984 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
10987 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
10988 * but with all dynamically-allocated buffers duplicated in new buffers.
10990 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
10993 * Creates a new tuple which has the same data as `orig`
10994 * but with all dynamically-allocated buffers duplicated in new buffers.
10996 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
10999 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
11001 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
11004 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
11006 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
11009 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11011 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
11014 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11016 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
11019 * Creates a new CResult_NoneLightningErrorZ in the success state.
11021 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
11024 * Creates a new CResult_NoneLightningErrorZ in the error state.
11026 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
11029 * Frees any resources used by the CResult_NoneLightningErrorZ.
11031 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
11034 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
11035 * but with all dynamically-allocated buffers duplicated in new buffers.
11037 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
11040 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11042 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
11045 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
11047 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
11050 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
11052 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
11055 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
11057 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
11060 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
11061 * but with all dynamically-allocated buffers duplicated in new buffers.
11063 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
11066 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
11068 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
11071 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
11073 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
11076 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
11078 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
11081 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
11082 * but with all dynamically-allocated buffers duplicated in new buffers.
11084 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
11087 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
11089 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
11092 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
11094 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
11097 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
11099 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
11102 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
11103 * but with all dynamically-allocated buffers duplicated in new buffers.
11105 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
11108 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the success state.
11110 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o);
11113 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the error state.
11115 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
11118 * Frees any resources used by the CResult_DirectionalChannelInfoDecodeErrorZ.
11120 void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res);
11123 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ which has the same data as `orig`
11124 * but with all dynamically-allocated buffers duplicated in new buffers.
11126 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig);
11129 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
11131 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
11134 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
11136 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
11139 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
11141 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
11144 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
11145 * but with all dynamically-allocated buffers duplicated in new buffers.
11147 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
11150 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
11152 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
11155 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
11157 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
11160 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
11162 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
11165 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
11166 * but with all dynamically-allocated buffers duplicated in new buffers.
11168 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
11171 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
11173 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
11176 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
11178 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
11181 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
11183 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
11186 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
11187 * but with all dynamically-allocated buffers duplicated in new buffers.
11189 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
11192 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11194 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
11197 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
11199 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
11202 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
11204 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
11207 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
11209 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
11212 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
11213 * but with all dynamically-allocated buffers duplicated in new buffers.
11215 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
11218 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
11220 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
11223 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
11225 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
11228 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
11230 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
11233 * Creates a new CResult_NetworkGraphDecodeErrorZ which has the same data as `orig`
11234 * but with all dynamically-allocated buffers duplicated in new buffers.
11236 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
11239 * Creates a new CResult_NetAddressu8Z in the success state.
11241 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
11244 * Creates a new CResult_NetAddressu8Z in the error state.
11246 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
11249 * Frees any resources used by the CResult_NetAddressu8Z.
11251 void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
11254 * Creates a new CResult_NetAddressu8Z which has the same data as `orig`
11255 * but with all dynamically-allocated buffers duplicated in new buffers.
11257 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
11260 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the success state.
11262 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
11265 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the error state.
11267 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
11270 * Frees any resources used by the CResult_CResult_NetAddressu8ZDecodeErrorZ.
11272 void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
11275 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ which has the same data as `orig`
11276 * but with all dynamically-allocated buffers duplicated in new buffers.
11278 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
11281 * Creates a new CResult_NetAddressDecodeErrorZ in the success state.
11283 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
11286 * Creates a new CResult_NetAddressDecodeErrorZ in the error state.
11288 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
11291 * Frees any resources used by the CResult_NetAddressDecodeErrorZ.
11293 void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
11296 * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig`
11297 * but with all dynamically-allocated buffers duplicated in new buffers.
11299 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
11302 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11304 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
11307 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11309 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
11312 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11314 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
11317 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11319 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
11322 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
11324 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
11327 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
11329 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
11332 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
11334 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
11337 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
11338 * but with all dynamically-allocated buffers duplicated in new buffers.
11340 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
11343 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
11345 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
11348 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
11350 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
11353 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
11355 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
11358 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
11359 * but with all dynamically-allocated buffers duplicated in new buffers.
11361 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
11364 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
11366 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
11369 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
11371 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
11374 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
11376 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
11379 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
11380 * but with all dynamically-allocated buffers duplicated in new buffers.
11382 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
11385 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
11387 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
11390 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
11392 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
11395 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
11397 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
11400 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
11401 * but with all dynamically-allocated buffers duplicated in new buffers.
11403 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
11406 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
11408 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
11411 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
11413 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
11416 * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
11418 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
11421 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
11422 * but with all dynamically-allocated buffers duplicated in new buffers.
11424 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
11427 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
11429 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
11432 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
11434 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
11437 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
11439 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
11442 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
11443 * but with all dynamically-allocated buffers duplicated in new buffers.
11445 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
11448 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
11450 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
11453 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
11455 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
11458 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
11460 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
11463 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
11464 * but with all dynamically-allocated buffers duplicated in new buffers.
11466 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
11469 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
11471 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
11474 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
11476 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
11479 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
11481 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
11484 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
11485 * but with all dynamically-allocated buffers duplicated in new buffers.
11487 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
11490 * Creates a new CResult_FundingLockedDecodeErrorZ in the success state.
11492 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o);
11495 * Creates a new CResult_FundingLockedDecodeErrorZ in the error state.
11497 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e);
11500 * Frees any resources used by the CResult_FundingLockedDecodeErrorZ.
11502 void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res);
11505 * Creates a new CResult_FundingLockedDecodeErrorZ which has the same data as `orig`
11506 * but with all dynamically-allocated buffers duplicated in new buffers.
11508 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig);
11511 * Creates a new CResult_InitDecodeErrorZ in the success state.
11513 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
11516 * Creates a new CResult_InitDecodeErrorZ in the error state.
11518 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
11521 * Frees any resources used by the CResult_InitDecodeErrorZ.
11523 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
11526 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
11527 * but with all dynamically-allocated buffers duplicated in new buffers.
11529 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
11532 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
11534 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
11537 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
11539 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
11542 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
11544 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
11547 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
11548 * but with all dynamically-allocated buffers duplicated in new buffers.
11550 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
11553 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
11555 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
11558 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
11560 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
11563 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
11565 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
11568 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
11569 * but with all dynamically-allocated buffers duplicated in new buffers.
11571 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
11574 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
11576 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
11579 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
11581 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
11584 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
11586 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
11589 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
11590 * but with all dynamically-allocated buffers duplicated in new buffers.
11592 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
11595 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
11597 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
11600 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
11602 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
11605 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
11607 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
11610 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
11611 * but with all dynamically-allocated buffers duplicated in new buffers.
11613 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
11616 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
11618 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
11621 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
11623 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
11626 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
11628 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
11631 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
11632 * but with all dynamically-allocated buffers duplicated in new buffers.
11634 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
11637 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
11639 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
11642 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
11644 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
11647 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
11649 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
11652 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
11653 * but with all dynamically-allocated buffers duplicated in new buffers.
11655 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
11658 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
11660 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
11663 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
11665 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
11668 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
11670 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
11673 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
11674 * but with all dynamically-allocated buffers duplicated in new buffers.
11676 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
11679 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
11681 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
11684 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
11686 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
11689 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
11691 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
11694 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
11695 * but with all dynamically-allocated buffers duplicated in new buffers.
11697 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
11700 * Creates a new CResult_PingDecodeErrorZ in the success state.
11702 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
11705 * Creates a new CResult_PingDecodeErrorZ in the error state.
11707 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
11710 * Frees any resources used by the CResult_PingDecodeErrorZ.
11712 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
11715 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
11716 * but with all dynamically-allocated buffers duplicated in new buffers.
11718 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
11721 * Creates a new CResult_PongDecodeErrorZ in the success state.
11723 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
11726 * Creates a new CResult_PongDecodeErrorZ in the error state.
11728 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
11731 * Frees any resources used by the CResult_PongDecodeErrorZ.
11733 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
11736 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
11737 * but with all dynamically-allocated buffers duplicated in new buffers.
11739 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
11742 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
11744 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
11747 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
11749 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
11752 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
11754 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
11757 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
11758 * but with all dynamically-allocated buffers duplicated in new buffers.
11760 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
11763 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
11765 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
11768 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
11770 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
11773 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
11775 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
11778 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
11779 * but with all dynamically-allocated buffers duplicated in new buffers.
11781 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
11784 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
11786 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
11789 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
11791 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
11794 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
11796 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
11799 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
11800 * but with all dynamically-allocated buffers duplicated in new buffers.
11802 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
11805 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
11807 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
11810 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
11812 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
11815 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
11817 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
11820 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
11821 * but with all dynamically-allocated buffers duplicated in new buffers.
11823 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
11826 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
11828 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
11831 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
11833 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
11836 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
11838 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
11841 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
11842 * but with all dynamically-allocated buffers duplicated in new buffers.
11844 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
11847 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
11849 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
11852 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
11854 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
11857 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
11859 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
11862 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
11863 * but with all dynamically-allocated buffers duplicated in new buffers.
11865 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
11868 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
11870 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
11873 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
11875 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
11878 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
11880 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
11883 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
11884 * but with all dynamically-allocated buffers duplicated in new buffers.
11886 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
11889 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
11891 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
11894 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
11896 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
11899 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
11901 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
11904 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
11905 * but with all dynamically-allocated buffers duplicated in new buffers.
11907 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
11910 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
11912 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
11915 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
11917 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
11920 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
11922 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
11925 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
11926 * but with all dynamically-allocated buffers duplicated in new buffers.
11928 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
11931 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
11933 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
11936 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
11938 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
11941 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
11943 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
11946 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
11947 * but with all dynamically-allocated buffers duplicated in new buffers.
11949 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
11952 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
11954 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
11957 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
11959 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
11962 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
11964 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
11967 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
11968 * but with all dynamically-allocated buffers duplicated in new buffers.
11970 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
11973 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
11975 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
11978 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
11980 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
11983 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
11985 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
11988 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
11989 * but with all dynamically-allocated buffers duplicated in new buffers.
11991 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
11994 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state.
11996 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o);
11999 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state.
12001 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
12004 * Frees any resources used by the CResult_InvoiceSignOrCreationErrorZ.
12006 void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res);
12009 * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig`
12010 * but with all dynamically-allocated buffers duplicated in new buffers.
12012 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
12015 * Frees any resources used by the PaymentPurpose
12017 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
12020 * Creates a copy of the PaymentPurpose
12022 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
12025 * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
12027 struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret, uint64_t user_payment_id);
12030 * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
12032 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
12035 * Frees any resources used by the Event
12037 void Event_free(struct LDKEvent this_ptr);
12040 * Creates a copy of the Event
12042 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
12045 * Utility method to constructs a new FundingGenerationReady-variant Event
12047 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);
12050 * Utility method to constructs a new PaymentReceived-variant Event
12052 struct LDKEvent Event_payment_received(struct LDKThirtyTwoBytes payment_hash, uint64_t amt, struct LDKPaymentPurpose purpose);
12055 * Utility method to constructs a new PaymentSent-variant Event
12057 struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_preimage);
12060 * Utility method to constructs a new PaymentFailed-variant Event
12062 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_hash, bool rejected_by_dest);
12065 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
12067 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
12070 * Utility method to constructs a new SpendableOutputs-variant Event
12072 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs);
12075 * Utility method to constructs a new PaymentForwarded-variant Event
12077 struct LDKEvent Event_payment_forwarded(struct LDKCOption_u64Z fee_earned_msat, bool claim_from_onchain_tx);
12080 * Serialize the Event object into a byte array which can be read by Event_read
12082 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
12085 * Frees any resources used by the MessageSendEvent
12087 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
12090 * Creates a copy of the MessageSendEvent
12092 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
12095 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
12097 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
12100 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
12102 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
12105 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
12107 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
12110 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
12112 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
12115 * Utility method to constructs a new SendFundingLocked-variant MessageSendEvent
12117 struct LDKMessageSendEvent MessageSendEvent_send_funding_locked(struct LDKPublicKey node_id, struct LDKFundingLocked msg);
12120 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
12122 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
12125 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
12127 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
12130 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
12132 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
12135 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
12137 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
12140 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
12142 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
12145 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
12147 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
12150 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
12152 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
12155 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
12157 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
12160 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
12162 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
12165 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
12167 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
12170 * Utility method to constructs a new HandleError-variant MessageSendEvent
12172 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
12175 * Utility method to constructs a new PaymentFailureNetworkUpdate-variant MessageSendEvent
12177 struct LDKMessageSendEvent MessageSendEvent_payment_failure_network_update(struct LDKHTLCFailChannelUpdate update);
12180 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
12182 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
12185 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
12187 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
12190 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
12192 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
12195 * Calls the free function if one is set
12197 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
12200 * Calls the free function if one is set
12202 void EventsProvider_free(struct LDKEventsProvider this_ptr);
12205 * Calls the free function if one is set
12207 void EventHandler_free(struct LDKEventHandler this_ptr);
12210 * Frees any resources used by the APIError
12212 void APIError_free(struct LDKAPIError this_ptr);
12215 * Creates a copy of the APIError
12217 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
12220 * Utility method to constructs a new APIMisuseError-variant APIError
12222 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
12225 * Utility method to constructs a new FeeRateTooHigh-variant APIError
12227 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
12230 * Utility method to constructs a new RouteError-variant APIError
12232 struct LDKAPIError APIError_route_error(struct LDKStr err);
12235 * Utility method to constructs a new ChannelUnavailable-variant APIError
12237 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
12240 * Utility method to constructs a new MonitorUpdateFailed-variant APIError
12242 struct LDKAPIError APIError_monitor_update_failed(void);
12245 * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
12247 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
12250 * Creates a digital signature of a message given a SecretKey, like the node's secret.
12251 * 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.
12252 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
12254 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
12257 * Recovers the PublicKey of the signer of the message given the message and the signature.
12259 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
12262 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
12263 * and the PublicKey.
12265 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
12268 * Creates a copy of the Level
12270 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
12273 * Utility method to constructs a new Trace-variant Level
12275 enum LDKLevel Level_trace(void);
12278 * Utility method to constructs a new Debug-variant Level
12280 enum LDKLevel Level_debug(void);
12283 * Utility method to constructs a new Info-variant Level
12285 enum LDKLevel Level_info(void);
12288 * Utility method to constructs a new Warn-variant Level
12290 enum LDKLevel Level_warn(void);
12293 * Utility method to constructs a new Error-variant Level
12295 enum LDKLevel Level_error(void);
12298 * Checks if two Levels contain equal inner contents.
12299 * This ignores pointers and is_owned flags and looks at the values in fields.
12301 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
12304 * Checks if two Levels contain equal inner contents.
12306 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
12309 * Returns the most verbose logging level.
12311 MUST_USE_RES enum LDKLevel Level_max(void);
12314 * Calls the free function if one is set
12316 void Logger_free(struct LDKLogger this_ptr);
12319 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
12321 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
12324 * Confirmations we will wait for before considering the channel locked in.
12325 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
12326 * equivalent limit applied to outbound channels).
12328 * Default value: 6.
12330 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
12333 * Confirmations we will wait for before considering the channel locked in.
12334 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
12335 * equivalent limit applied to outbound channels).
12337 * Default value: 6.
12339 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
12342 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
12343 * the number of blocks we have to punish our counterparty if they broadcast a revoked
12346 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
12347 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
12348 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
12349 * possibly with time in between to RBF the spending transaction).
12351 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
12352 * case of an honest unilateral channel close, which implicitly decrease the economic value of
12355 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
12356 * can tweak config to ask for more security, not less.
12358 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
12361 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
12362 * the number of blocks we have to punish our counterparty if they broadcast a revoked
12365 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
12366 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
12367 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
12368 * possibly with time in between to RBF the spending transaction).
12370 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
12371 * case of an honest unilateral channel close, which implicitly decrease the economic value of
12374 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
12375 * can tweak config to ask for more security, not less.
12377 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
12380 * Set to the smallest value HTLC we will accept to process.
12382 * This value is sent to our counterparty on channel-open and we close the channel any time
12383 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
12385 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
12388 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
12391 * Set to the smallest value HTLC we will accept to process.
12393 * This value is sent to our counterparty on channel-open and we close the channel any time
12394 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
12396 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
12399 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
12402 * Constructs a new ChannelHandshakeConfig given each field
12404 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);
12407 * Creates a copy of the ChannelHandshakeConfig
12409 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
12412 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
12414 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
12417 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
12419 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
12422 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
12423 * only applies to inbound channels.
12425 * Default value: 0.
12427 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
12430 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
12431 * only applies to inbound channels.
12433 * Default value: 0.
12435 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
12438 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
12439 * you to limit the maximum minimum-size they can require.
12441 * Default value: u64::max_value.
12443 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
12446 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
12447 * you to limit the maximum minimum-size they can require.
12449 * Default value: u64::max_value.
12451 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
12454 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
12455 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
12457 * Default value: 0.
12459 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
12462 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
12463 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
12465 * Default value: 0.
12467 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
12470 * The remote node will require we keep a certain amount in direct payment to ourselves at all
12471 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
12472 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
12474 * Default value: u64::max_value.
12476 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
12479 * The remote node will require we keep a certain amount in direct payment to ourselves at all
12480 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
12481 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
12483 * Default value: u64::max_value.
12485 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
12488 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
12489 * time. This allows you to set a minimum such value.
12491 * Default value: 0.
12493 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
12496 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
12497 * time. This allows you to set a minimum such value.
12499 * Default value: 0.
12501 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
12504 * Before a channel is usable the funding transaction will need to be confirmed by at least a
12505 * certain number of blocks, specified by the node which is not the funder (as the funder can
12506 * assume they aren't going to double-spend themselves).
12507 * This config allows you to set a limit on the maximum amount of time to wait.
12509 * Default value: 144, or roughly one day and only applies to outbound channels.
12511 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
12514 * Before a channel is usable the funding transaction will need to be confirmed by at least a
12515 * certain number of blocks, specified by the node which is not the funder (as the funder can
12516 * assume they aren't going to double-spend themselves).
12517 * This config allows you to set a limit on the maximum amount of time to wait.
12519 * Default value: 144, or roughly one day and only applies to outbound channels.
12521 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
12524 * Set to force an incoming channel to match our announced channel preference in
12525 * [`ChannelConfig::announced_channel`].
12527 * For a node which is not online reliably, this should be set to true and
12528 * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public)
12529 * channels will ever be opened.
12531 * Default value: true.
12533 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
12536 * Set to force an incoming channel to match our announced channel preference in
12537 * [`ChannelConfig::announced_channel`].
12539 * For a node which is not online reliably, this should be set to true and
12540 * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public)
12541 * channels will ever be opened.
12543 * Default value: true.
12545 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
12548 * Set to the amount of time we're willing to wait to claim money back to us.
12550 * Not checking this value would be a security issue, as our peer would be able to set it to
12551 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
12553 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
12554 * reduce the loss of having useless locked funds (if your peer accepts)
12556 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
12559 * Set to the amount of time we're willing to wait to claim money back to us.
12561 * Not checking this value would be a security issue, as our peer would be able to set it to
12562 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
12564 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
12565 * reduce the loss of having useless locked funds (if your peer accepts)
12567 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
12570 * Constructs a new ChannelHandshakeLimits given each field
12572 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);
12575 * Creates a copy of the ChannelHandshakeLimits
12577 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
12580 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
12582 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
12585 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
12587 void ChannelConfig_free(struct LDKChannelConfig this_obj);
12590 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
12591 * over the channel.
12592 * This may be allowed to change at runtime in a later update, however doing so must result in
12593 * update messages sent to notify all nodes of our updated relay fee.
12595 * Default value: 0.
12597 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
12600 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
12601 * over the channel.
12602 * This may be allowed to change at runtime in a later update, however doing so must result in
12603 * update messages sent to notify all nodes of our updated relay fee.
12605 * Default value: 0.
12607 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
12610 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
12611 * excess of [`forwarding_fee_proportional_millionths`].
12612 * This may be allowed to change at runtime in a later update, however doing so must result in
12613 * update messages sent to notify all nodes of our updated relay fee.
12615 * The default value of a single satoshi roughly matches the market rate on many routing nodes
12616 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
12619 * Default value: 1000.
12621 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
12623 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
12626 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
12627 * excess of [`forwarding_fee_proportional_millionths`].
12628 * This may be allowed to change at runtime in a later update, however doing so must result in
12629 * update messages sent to notify all nodes of our updated relay fee.
12631 * The default value of a single satoshi roughly matches the market rate on many routing nodes
12632 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
12635 * Default value: 1000.
12637 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
12639 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
12642 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
12643 * the channel this config applies to.
12645 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
12646 * HTLC balance when a channel appears on-chain whereas
12647 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
12648 * (non-HTLC-encumbered) balance.
12650 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
12651 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
12652 * commitment transaction at least once per this many blocks (minus some margin to allow us
12653 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
12654 * the spending transaction).
12656 * Default value: 72 (12 hours at an average of 6 blocks/hour).
12657 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
12658 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
12660 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
12662 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
12665 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
12666 * the channel this config applies to.
12668 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
12669 * HTLC balance when a channel appears on-chain whereas
12670 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
12671 * (non-HTLC-encumbered) balance.
12673 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
12674 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
12675 * commitment transaction at least once per this many blocks (minus some margin to allow us
12676 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
12677 * the spending transaction).
12679 * Default value: 72 (12 hours at an average of 6 blocks/hour).
12680 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
12681 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
12683 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
12685 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
12688 * Set to announce the channel publicly and notify all nodes that they can route via this
12691 * This should only be set to true for nodes which expect to be online reliably.
12693 * As the node which funds a channel picks this value this will only apply for new outbound
12694 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
12696 * This cannot be changed after the initial channel handshake.
12698 * Default value: false.
12700 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
12703 * Set to announce the channel publicly and notify all nodes that they can route via this
12706 * This should only be set to true for nodes which expect to be online reliably.
12708 * As the node which funds a channel picks this value this will only apply for new outbound
12709 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
12711 * This cannot be changed after the initial channel handshake.
12713 * Default value: false.
12715 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
12718 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
12719 * supports it, they will then enforce the mutual-close output to us matches what we provided
12720 * at intialization, preventing us from closing to an alternate pubkey.
12722 * This is set to true by default to provide a slight increase in security, though ultimately
12723 * any attacker who is able to take control of a channel can just as easily send the funds via
12724 * lightning payments, so we never require that our counterparties support this option.
12726 * This cannot be changed after a channel has been initialized.
12728 * Default value: true.
12730 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
12733 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
12734 * supports it, they will then enforce the mutual-close output to us matches what we provided
12735 * at intialization, preventing us from closing to an alternate pubkey.
12737 * This is set to true by default to provide a slight increase in security, though ultimately
12738 * any attacker who is able to take control of a channel can just as easily send the funds via
12739 * lightning payments, so we never require that our counterparties support this option.
12741 * This cannot be changed after a channel has been initialized.
12743 * Default value: true.
12745 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
12748 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
12749 * small to claim on-chain.
12751 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
12752 * not be claimable on-chain, instead being turned into additional miner fees if either
12753 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
12754 * to such payments may be sustantial if there are many dust HTLCs present when the
12755 * channel is force-closed.
12757 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
12758 * exposure across all three types per-channel. Setting this too low may prevent the
12759 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
12760 * important to prevent stealing of dust HTLCs by miners.
12762 * Default value: 5_000_000 msat.
12764 uint64_t ChannelConfig_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
12767 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
12768 * small to claim on-chain.
12770 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
12771 * not be claimable on-chain, instead being turned into additional miner fees if either
12772 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
12773 * to such payments may be sustantial if there are many dust HTLCs present when the
12774 * channel is force-closed.
12776 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
12777 * exposure across all three types per-channel. Setting this too low may prevent the
12778 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
12779 * important to prevent stealing of dust HTLCs by miners.
12781 * Default value: 5_000_000 msat.
12783 void ChannelConfig_set_max_dust_htlc_exposure_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
12786 * The additional fee we're willing to pay to avoid waiting for the counterparty's
12787 * `to_self_delay` to reclaim funds.
12789 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
12790 * closing transaction which both sides find acceptable, ultimately paid by the channel
12791 * funder/initiator.
12793 * When we are the funder, because we have to pay the channel closing fee, we bound the
12794 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
12795 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
12796 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
12797 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
12800 * When we are not the funder, we require the closing transaction fee pay at least our
12801 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
12802 * Thus, this value is ignored when we are not the funder.
12804 * Default value: 1000 satoshis.
12806 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
12807 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
12809 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
12812 * The additional fee we're willing to pay to avoid waiting for the counterparty's
12813 * `to_self_delay` to reclaim funds.
12815 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
12816 * closing transaction which both sides find acceptable, ultimately paid by the channel
12817 * funder/initiator.
12819 * When we are the funder, because we have to pay the channel closing fee, we bound the
12820 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
12821 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
12822 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
12823 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
12826 * When we are not the funder, we require the closing transaction fee pay at least our
12827 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
12828 * Thus, this value is ignored when we are not the funder.
12830 * Default value: 1000 satoshis.
12832 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
12833 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
12835 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
12838 * Constructs a new ChannelConfig given each field
12840 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);
12843 * Creates a copy of the ChannelConfig
12845 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
12848 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
12850 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
12853 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
12855 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
12858 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
12860 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
12863 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
12865 void UserConfig_free(struct LDKUserConfig this_obj);
12868 * Channel config that we propose to our counterparty.
12870 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
12873 * Channel config that we propose to our counterparty.
12875 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
12878 * Limits applied to our counterparty's proposed channel config settings.
12880 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
12883 * Limits applied to our counterparty's proposed channel config settings.
12885 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
12888 * Channel config which affects behavior during channel lifetime.
12890 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
12893 * Channel config which affects behavior during channel lifetime.
12895 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
12898 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
12899 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
12900 * node which is not online reliably.
12902 * For nodes which are not online reliably, you should set all channels to *not* be announced
12903 * (using [`ChannelConfig::announced_channel`] and
12904 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
12905 * ensure you are not exposed to any forwarding risk.
12907 * Note that because you cannot change a channel's announced state after creation, there is no
12908 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
12909 * from a publicly-announced forwarding node to a private non-forwarding node you must close
12910 * all your channels and open new ones. For privacy, you should also change your node_id
12911 * (swapping all private and public key material for new ones) at that time.
12913 * Default value: false.
12915 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
12918 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
12919 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
12920 * node which is not online reliably.
12922 * For nodes which are not online reliably, you should set all channels to *not* be announced
12923 * (using [`ChannelConfig::announced_channel`] and
12924 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
12925 * ensure you are not exposed to any forwarding risk.
12927 * Note that because you cannot change a channel's announced state after creation, there is no
12928 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
12929 * from a publicly-announced forwarding node to a private non-forwarding node you must close
12930 * all your channels and open new ones. For privacy, you should also change your node_id
12931 * (swapping all private and public key material for new ones) at that time.
12933 * Default value: false.
12935 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
12938 * Constructs a new UserConfig given each field
12940 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);
12943 * Creates a copy of the UserConfig
12945 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
12948 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
12950 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
12953 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
12955 void BestBlock_free(struct LDKBestBlock this_obj);
12958 * Creates a copy of the BestBlock
12960 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
12963 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
12966 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
12969 * Returns a `BestBlock` as identified by the given block hash and height.
12971 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
12974 * Returns the best block hash.
12976 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
12979 * Returns the best block height.
12981 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
12984 * Creates a copy of the AccessError
12986 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
12989 * Utility method to constructs a new UnknownChain-variant AccessError
12991 enum LDKAccessError AccessError_unknown_chain(void);
12994 * Utility method to constructs a new UnknownTx-variant AccessError
12996 enum LDKAccessError AccessError_unknown_tx(void);
12999 * Calls the free function if one is set
13001 void Access_free(struct LDKAccess this_ptr);
13004 * Calls the free function if one is set
13006 void Listen_free(struct LDKListen this_ptr);
13009 * Calls the free function if one is set
13011 void Confirm_free(struct LDKConfirm this_ptr);
13014 * Calls the free function if one is set
13016 void Watch_free(struct LDKWatch this_ptr);
13019 * Calls the free function if one is set
13021 void Filter_free(struct LDKFilter this_ptr);
13024 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
13026 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
13029 * First block where the transaction output may have been spent.
13031 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
13033 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
13036 * First block where the transaction output may have been spent.
13038 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
13040 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13043 * Outpoint identifying the transaction output.
13045 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
13048 * Outpoint identifying the transaction output.
13050 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
13053 * Spending condition of the transaction output.
13055 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
13058 * Spending condition of the transaction output.
13060 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
13063 * Constructs a new WatchedOutput given each field
13065 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
13068 * Creates a copy of the WatchedOutput
13070 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
13073 * Checks if two WatchedOutputs contain equal inner contents.
13075 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
13078 * Calls the free function if one is set
13080 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
13083 * Creates a copy of the ConfirmationTarget
13085 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
13088 * Utility method to constructs a new Background-variant ConfirmationTarget
13090 enum LDKConfirmationTarget ConfirmationTarget_background(void);
13093 * Utility method to constructs a new Normal-variant ConfirmationTarget
13095 enum LDKConfirmationTarget ConfirmationTarget_normal(void);
13098 * Utility method to constructs a new HighPriority-variant ConfirmationTarget
13100 enum LDKConfirmationTarget ConfirmationTarget_high_priority(void);
13103 * Checks if two ConfirmationTargets contain equal inner contents.
13104 * This ignores pointers and is_owned flags and looks at the values in fields.
13106 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
13109 * Calls the free function if one is set
13111 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
13114 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
13116 void ChainMonitor_free(struct LDKChainMonitor this_obj);
13119 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
13121 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
13122 * will call back to it indicating transactions and outputs of interest. This allows clients to
13123 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
13124 * always need to fetch full blocks absent another means for determining which blocks contain
13125 * transactions relevant to the watched channels.
13127 * Note that chain_source (or a relevant inner pointer) may be NULL or all-0s to represent None
13129 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
13132 * Constructs a new Listen which calls the relevant methods on this_arg.
13133 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
13135 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
13138 * Constructs a new Confirm which calls the relevant methods on this_arg.
13139 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
13141 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
13144 * Constructs a new Watch which calls the relevant methods on this_arg.
13145 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
13147 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
13150 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
13151 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
13153 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
13156 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
13158 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
13161 * The sequence number of this update. Updates *must* be replayed in-order according to this
13162 * sequence number (and updates may panic if they are not). The update_id values are strictly
13163 * increasing and increase by one for each new update, with one exception specified below.
13165 * This sequence number is also used to track up to which points updates which returned
13166 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
13167 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
13169 * The only instance where update_id values are not strictly increasing is the case where we
13170 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
13171 * its docs for more details.
13173 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
13176 * The sequence number of this update. Updates *must* be replayed in-order according to this
13177 * sequence number (and updates may panic if they are not). The update_id values are strictly
13178 * increasing and increase by one for each new update, with one exception specified below.
13180 * This sequence number is also used to track up to which points updates which returned
13181 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
13182 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
13184 * The only instance where update_id values are not strictly increasing is the case where we
13185 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
13186 * its docs for more details.
13188 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
13191 * Creates a copy of the ChannelMonitorUpdate
13193 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
13196 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
13198 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
13201 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
13203 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
13206 * Creates a copy of the ChannelMonitorUpdateErr
13208 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
13211 * Utility method to constructs a new TemporaryFailure-variant ChannelMonitorUpdateErr
13213 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_temporary_failure(void);
13216 * Utility method to constructs a new PermanentFailure-variant ChannelMonitorUpdateErr
13218 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_permanent_failure(void);
13221 * Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
13223 void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
13226 * Creates a copy of the MonitorUpdateError
13228 struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
13231 * Frees any resources used by the MonitorEvent
13233 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
13236 * Creates a copy of the MonitorEvent
13238 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
13241 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
13243 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
13246 * Utility method to constructs a new CommitmentTxBroadcasted-variant MonitorEvent
13248 struct LDKMonitorEvent MonitorEvent_commitment_tx_broadcasted(struct LDKOutPoint a);
13251 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
13253 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
13256 * Creates a copy of the HTLCUpdate
13258 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
13261 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
13263 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
13266 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
13268 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
13271 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
13273 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
13276 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
13278 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
13281 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
13284 * panics if the given update is not the next update by update_id.
13286 MUST_USE_RES struct LDKCResult_NoneMonitorUpdateErrorZ 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);
13289 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
13292 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
13295 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
13297 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
13300 * Gets a list of txids, with their output scripts (in the order they appear in the
13301 * transaction), which we must learn about spends of via block_connected().
13303 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
13306 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
13307 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
13308 * have been registered.
13310 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
13313 * Get the list of HTLCs who's status has been updated on chain. This should be called by
13314 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
13316 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
13319 * Gets the list of pending events which were generated by previous actions, clearing the list
13322 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
13323 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
13324 * no internal locking in ChannelMonitors.
13326 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
13329 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
13330 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
13331 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
13332 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
13333 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
13334 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
13335 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
13336 * out-of-band the other node operator to coordinate with him if option is available to you.
13337 * In any-case, choice is up to the user.
13339 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);
13342 * Processes transactions in a newly connected block, which may result in any of the following:
13343 * - update the monitor's state against resolved HTLCs
13344 * - punish the counterparty in the case of seeing a revoked commitment transaction
13345 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
13346 * - detect settled outputs for later spending
13347 * - schedule and bump any in-flight claims
13349 * Returns any new outputs to watch from `txdata`; after called, these are also included in
13350 * [`get_outputs_to_watch`].
13352 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
13354 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);
13357 * Determines if the disconnected block contained any transactions of interest and updates
13360 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);
13363 * Processes transactions confirmed in a block with the given header and height, returning new
13364 * outputs to watch. See [`block_connected`] for details.
13366 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
13367 * blocks. See [`chain::Confirm`] for calling expectations.
13369 * [`block_connected`]: Self::block_connected
13371 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);
13374 * Processes a transaction that was reorganized out of the chain.
13376 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
13377 * than blocks. See [`chain::Confirm`] for calling expectations.
13379 * [`block_disconnected`]: Self::block_disconnected
13381 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);
13384 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
13385 * [`block_connected`] for details.
13387 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
13388 * blocks. See [`chain::Confirm`] for calling expectations.
13390 * [`block_connected`]: Self::block_connected
13392 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);
13395 * Returns the set of txids that should be monitored for re-organization out of the chain.
13397 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
13400 * Gets the latest best block which was connected either via the [`chain::Listen`] or
13401 * [`chain::Confirm`] interfaces.
13403 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
13406 * Calls the free function if one is set
13408 void Persist_free(struct LDKPersist this_ptr);
13411 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
13413 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
13416 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
13418 void OutPoint_free(struct LDKOutPoint this_obj);
13421 * The referenced transaction's txid.
13423 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
13426 * The referenced transaction's txid.
13428 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13431 * The index of the referenced output in its transaction's vout.
13433 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
13436 * The index of the referenced output in its transaction's vout.
13438 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
13441 * Constructs a new OutPoint given each field
13443 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
13446 * Creates a copy of the OutPoint
13448 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
13451 * Checks if two OutPoints contain equal inner contents.
13452 * This ignores pointers and is_owned flags and looks at the values in fields.
13453 * Two objects with NULL inner values will be considered "equal" here.
13455 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
13458 * Checks if two OutPoints contain equal inner contents.
13460 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
13463 * Convert an `OutPoint` to a lightning channel id.
13465 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
13468 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
13470 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
13473 * Read a OutPoint from a byte array, created by OutPoint_write
13475 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
13478 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
13480 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
13483 * The outpoint which is spendable
13485 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
13488 * The outpoint which is spendable
13490 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
13493 * Per commitment point to derive delayed_payment_key by key holder
13495 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
13498 * Per commitment point to derive delayed_payment_key by key holder
13500 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13503 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
13504 * the witness_script.
13506 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
13509 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
13510 * the witness_script.
13512 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
13515 * The output which is referenced by the given outpoint
13517 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
13520 * The revocation point specific to the commitment transaction which was broadcast. Used to
13521 * derive the witnessScript for this output.
13523 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
13526 * The revocation point specific to the commitment transaction which was broadcast. Used to
13527 * derive the witnessScript for this output.
13529 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13532 * Arbitrary identification information returned by a call to
13533 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
13534 * the channel to spend the output.
13536 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
13539 * Arbitrary identification information returned by a call to
13540 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
13541 * the channel to spend the output.
13543 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13546 * The value of the channel which this output originated from, possibly indirectly.
13548 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
13551 * The value of the channel which this output originated from, possibly indirectly.
13553 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
13556 * Constructs a new DelayedPaymentOutputDescriptor given each field
13558 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);
13561 * Creates a copy of the DelayedPaymentOutputDescriptor
13563 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
13566 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
13568 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
13571 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
13573 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
13576 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
13578 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
13581 * The outpoint which is spendable
13583 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
13586 * The outpoint which is spendable
13588 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
13591 * The output which is referenced by the given outpoint
13593 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
13596 * Arbitrary identification information returned by a call to
13597 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
13598 * the channel to spend the output.
13600 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
13603 * Arbitrary identification information returned by a call to
13604 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
13605 * the channel to spend the output.
13607 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13610 * The value of the channel which this transactions spends.
13612 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
13615 * The value of the channel which this transactions spends.
13617 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
13620 * Constructs a new StaticPaymentOutputDescriptor given each field
13622 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);
13625 * Creates a copy of the StaticPaymentOutputDescriptor
13627 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
13630 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
13632 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
13635 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
13637 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
13640 * Frees any resources used by the SpendableOutputDescriptor
13642 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
13645 * Creates a copy of the SpendableOutputDescriptor
13647 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
13650 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
13652 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
13655 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
13657 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
13660 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
13662 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
13665 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
13667 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
13670 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
13672 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
13675 * Calls the free function if one is set
13677 void BaseSign_free(struct LDKBaseSign this_ptr);
13680 * Creates a copy of a Sign
13682 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
13685 * Calls the free function if one is set
13687 void Sign_free(struct LDKSign this_ptr);
13690 * Calls the free function if one is set
13692 void KeysInterface_free(struct LDKKeysInterface this_ptr);
13695 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
13697 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
13700 * Private key of anchor tx
13702 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
13705 * Private key of anchor tx
13707 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
13710 * Holder secret key for blinded revocation pubkey
13712 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
13715 * Holder secret key for blinded revocation pubkey
13717 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
13720 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
13722 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
13725 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
13727 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
13730 * Holder secret key used in HTLC tx
13732 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
13735 * Holder secret key used in HTLC tx
13737 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
13740 * Holder htlc secret key used in commitment tx htlc outputs
13742 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
13745 * Holder htlc secret key used in commitment tx htlc outputs
13747 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
13752 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
13757 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13760 * Creates a copy of the InMemorySigner
13762 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
13765 * Create a new InMemorySigner
13767 MUST_USE_RES struct LDKInMemorySigner InMemorySigner_new(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);
13770 * Counterparty pubkeys.
13771 * Will panic if ready_channel wasn't called.
13773 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13776 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
13777 * transactions, ie the amount of time that we have to wait to recover our funds if we
13778 * broadcast a transaction.
13779 * Will panic if ready_channel wasn't called.
13781 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13784 * The contest_delay value specified by us and applied on transactions broadcastable
13785 * by our counterparty, ie the amount of time that they have to wait to recover their funds
13786 * if they broadcast a transaction.
13787 * Will panic if ready_channel wasn't called.
13789 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13792 * Whether the holder is the initiator
13793 * Will panic if ready_channel wasn't called.
13795 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13799 * Will panic if ready_channel wasn't called.
13801 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13804 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
13805 * building transactions.
13807 * Will panic if ready_channel wasn't called.
13809 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13812 * Sign the single input of spend_tx at index `input_idx` which spends the output
13813 * described by descriptor, returning the witness stack for the input.
13815 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
13816 * or is not spending the outpoint described by `descriptor.outpoint`.
13818 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);
13821 * Sign the single input of spend_tx at index `input_idx` which spends the output
13822 * described by descriptor, returning the witness stack for the input.
13824 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
13825 * is not spending the outpoint described by `descriptor.outpoint`, or does not have a
13826 * sequence set to `descriptor.to_self_delay`.
13828 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);
13831 * Constructs a new BaseSign which calls the relevant methods on this_arg.
13832 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
13834 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13837 * Constructs a new Sign which calls the relevant methods on this_arg.
13838 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
13840 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
13843 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
13845 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
13848 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
13850 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
13853 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
13855 void KeysManager_free(struct LDKKeysManager this_obj);
13858 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
13859 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
13860 * starting_time isn't strictly required to actually be a time, but it must absolutely,
13861 * without a doubt, be unique to this instance. ie if you start multiple times with the same
13862 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
13863 * simply use the current time (with very high precision).
13865 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
13866 * obviously, starting_time should be unique every time you reload the library - it is only
13867 * used to generate new ephemeral key data (which will be stored by the individual channel if
13870 * Note that the seed is required to recover certain on-chain funds independent of
13871 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
13872 * channel, and some on-chain during-closing funds.
13874 * Note that until the 0.1 release there is no guarantee of backward compatibility between
13875 * versions. Once the library is more fully supported, the docs will be updated to include a
13876 * detailed description of the guarantee.
13878 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
13881 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
13883 * Key derivation parameters are accessible through a per-channel secrets
13884 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
13885 * onchain output detection for which a corresponding delayed_payment_key must be derived.
13887 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]);
13890 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
13891 * output to the given change destination (if sufficient change value remains). The
13892 * transaction will have a feerate, at least, of the given value.
13894 * Returns `Err(())` if the output value is greater than the input value minus required fee or
13895 * if a descriptor was duplicated.
13897 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
13899 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
13900 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
13902 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);
13905 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
13906 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
13908 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
13911 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
13913 void ChannelManager_free(struct LDKChannelManager this_obj);
13916 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
13918 void ChainParameters_free(struct LDKChainParameters this_obj);
13921 * The network for determining the `chain_hash` in Lightning messages.
13923 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
13926 * The network for determining the `chain_hash` in Lightning messages.
13928 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
13931 * The hash and height of the latest block successfully connected.
13933 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
13935 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
13938 * The hash and height of the latest block successfully connected.
13940 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
13942 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
13945 * Constructs a new ChainParameters given each field
13947 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
13950 * Creates a copy of the ChainParameters
13952 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
13955 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
13957 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
13960 * The node_id of our counterparty
13962 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
13965 * The node_id of our counterparty
13967 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13970 * The Features the channel counterparty provided upon last connection.
13971 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
13972 * many routing-relevant features are present in the init context.
13974 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
13977 * The Features the channel counterparty provided upon last connection.
13978 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
13979 * many routing-relevant features are present in the init context.
13981 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
13984 * The value, in satoshis, that must always be held in the channel for our counterparty. This
13985 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
13986 * claiming at least this value on chain.
13988 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
13990 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
13992 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
13995 * The value, in satoshis, that must always be held in the channel for our counterparty. This
13996 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
13997 * claiming at least this value on chain.
13999 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
14001 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
14003 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
14006 * Creates a copy of the ChannelCounterparty
14008 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
14011 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
14013 void ChannelDetails_free(struct LDKChannelDetails this_obj);
14016 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
14017 * thereafter this is the txid of the funding transaction xor the funding transaction output).
14018 * Note that this means this value is *not* persistent - it can change once during the
14019 * lifetime of the channel.
14021 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
14024 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
14025 * thereafter this is the txid of the funding transaction xor the funding transaction output).
14026 * Note that this means this value is *not* persistent - it can change once during the
14027 * lifetime of the channel.
14029 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14032 * Parameters which apply to our counterparty. See individual fields for more information.
14034 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
14037 * Parameters which apply to our counterparty. See individual fields for more information.
14039 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
14042 * The Channel's funding transaction output, if we've negotiated the funding transaction with
14043 * our counterparty already.
14045 * Note that, if this has been set, `channel_id` will be equivalent to
14046 * `funding_txo.unwrap().to_channel_id()`.
14048 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
14050 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
14053 * The Channel's funding transaction output, if we've negotiated the funding transaction with
14054 * our counterparty already.
14056 * Note that, if this has been set, `channel_id` will be equivalent to
14057 * `funding_txo.unwrap().to_channel_id()`.
14059 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
14061 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
14064 * The position of the funding transaction in the chain. None if the funding transaction has
14065 * not yet been confirmed and the channel fully opened.
14067 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
14070 * The position of the funding transaction in the chain. None if the funding transaction has
14071 * not yet been confirmed and the channel fully opened.
14073 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
14076 * The value, in satoshis, of this channel as appears in the funding output
14078 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
14081 * The value, in satoshis, of this channel as appears in the funding output
14083 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
14086 * The value, in satoshis, that must always be held in the channel for us. This value ensures
14087 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
14088 * this value on chain.
14090 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
14092 * This value will be `None` for outbound channels until the counterparty accepts the channel.
14094 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
14096 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
14099 * The value, in satoshis, that must always be held in the channel for us. This value ensures
14100 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
14101 * this value on chain.
14103 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
14105 * This value will be `None` for outbound channels until the counterparty accepts the channel.
14107 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
14109 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
14112 * The user_id passed in to create_channel, or 0 if the channel was inbound.
14114 uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
14117 * The user_id passed in to create_channel, or 0 if the channel was inbound.
14119 void ChannelDetails_set_user_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
14122 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
14123 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
14124 * available for inclusion in new outbound HTLCs). This further does not include any pending
14125 * outgoing HTLCs which are awaiting some other resolution to be sent.
14127 * This value is not exact. Due to various in-flight changes, feerate changes, and our
14128 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
14129 * should be able to spend nearly this amount.
14131 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
14134 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
14135 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
14136 * available for inclusion in new outbound HTLCs). This further does not include any pending
14137 * outgoing HTLCs which are awaiting some other resolution to be sent.
14139 * This value is not exact. Due to various in-flight changes, feerate changes, and our
14140 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
14141 * should be able to spend nearly this amount.
14143 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
14146 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
14147 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
14148 * available for inclusion in new inbound HTLCs).
14149 * Note that there are some corner cases not fully handled here, so the actual available
14150 * inbound capacity may be slightly higher than this.
14152 * This value is not exact. Due to various in-flight changes, feerate changes, and our
14153 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
14154 * However, our counterparty should be able to spend nearly this amount.
14156 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
14159 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
14160 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
14161 * available for inclusion in new inbound HTLCs).
14162 * Note that there are some corner cases not fully handled here, so the actual available
14163 * inbound capacity may be slightly higher than this.
14165 * This value is not exact. Due to various in-flight changes, feerate changes, and our
14166 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
14167 * However, our counterparty should be able to spend nearly this amount.
14169 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
14172 * The number of required confirmations on the funding transaction before the funding will be
14173 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
14174 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
14175 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
14176 * [`ChannelHandshakeLimits::max_minimum_depth`].
14178 * This value will be `None` for outbound channels until the counterparty accepts the channel.
14180 * [`is_outbound`]: ChannelDetails::is_outbound
14181 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
14182 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
14184 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
14187 * The number of required confirmations on the funding transaction before the funding will be
14188 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
14189 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
14190 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
14191 * [`ChannelHandshakeLimits::max_minimum_depth`].
14193 * This value will be `None` for outbound channels until the counterparty accepts the channel.
14195 * [`is_outbound`]: ChannelDetails::is_outbound
14196 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
14197 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
14199 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
14202 * The number of blocks (after our commitment transaction confirms) that we will need to wait
14203 * until we can claim our funds after we force-close the channel. During this time our
14204 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
14205 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
14206 * time to claim our non-HTLC-encumbered funds.
14208 * This value will be `None` for outbound channels until the counterparty accepts the channel.
14210 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
14213 * The number of blocks (after our commitment transaction confirms) that we will need to wait
14214 * until we can claim our funds after we force-close the channel. During this time our
14215 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
14216 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
14217 * time to claim our non-HTLC-encumbered funds.
14219 * This value will be `None` for outbound channels until the counterparty accepts the channel.
14221 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
14224 * True if the channel was initiated (and thus funded) by us.
14226 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
14229 * True if the channel was initiated (and thus funded) by us.
14231 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
14234 * True if the channel is confirmed, funding_locked messages have been exchanged, and the
14235 * channel is not currently being shut down. `funding_locked` message exchange implies the
14236 * required confirmation count has been reached (and we were connected to the peer at some
14237 * point after the funding transaction received enough confirmations). The required
14238 * confirmation count is provided in [`confirmations_required`].
14240 * [`confirmations_required`]: ChannelDetails::confirmations_required
14242 bool ChannelDetails_get_is_funding_locked(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
14245 * True if the channel is confirmed, funding_locked messages have been exchanged, and the
14246 * channel is not currently being shut down. `funding_locked` message exchange implies the
14247 * required confirmation count has been reached (and we were connected to the peer at some
14248 * point after the funding transaction received enough confirmations). The required
14249 * confirmation count is provided in [`confirmations_required`].
14251 * [`confirmations_required`]: ChannelDetails::confirmations_required
14253 void ChannelDetails_set_is_funding_locked(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
14256 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
14257 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
14259 * This is a strict superset of `is_funding_locked`.
14261 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
14264 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
14265 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
14267 * This is a strict superset of `is_funding_locked`.
14269 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
14272 * True if this channel is (or will be) publicly-announced.
14274 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
14277 * True if this channel is (or will be) publicly-announced.
14279 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
14282 * Constructs a new ChannelDetails given each field
14284 MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKCOption_u64Z short_channel_id_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, uint64_t user_id_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);
14287 * Creates a copy of the ChannelDetails
14289 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
14292 * Frees any resources used by the PaymentSendFailure
14294 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
14297 * Creates a copy of the PaymentSendFailure
14299 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
14302 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
14304 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
14307 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
14309 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
14312 * Utility method to constructs a new AllFailedRetrySafe-variant PaymentSendFailure
14314 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_retry_safe(struct LDKCVec_APIErrorZ a);
14317 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
14319 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ a);
14322 * Constructs a new ChannelManager to hold several channels and route between them.
14324 * This is the main \"logic hub\" for all channel-related actions, and implements
14325 * ChannelMessageHandler.
14327 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
14329 * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
14331 * Users need to notify the new ChannelManager when a new block is connected or
14332 * disconnected using its `block_connected` and `block_disconnected` methods, starting
14333 * from after `params.latest_hash`.
14335 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);
14338 * Gets the current configuration applied to all new channels, as
14340 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
14343 * Creates a new outbound channel to the given remote node and with the given value.
14345 * user_id will be provided back as user_channel_id in FundingGenerationReady events to allow
14346 * tracking of which events correspond with which create_channel call. Note that the
14347 * user_channel_id defaults to 0 for inbound channels, so you may wish to avoid using 0 for
14348 * user_id here. user_id has no meaning inside of LDK, it is simply copied to events and
14349 * otherwise ignored.
14351 * If successful, will generate a SendOpenChannel message event, so you should probably poll
14352 * PeerManager::process_events afterwards.
14354 * Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
14355 * greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
14357 * Note that we do not check if you are currently connected to the given peer. If no
14358 * connection is available, the outbound `open_channel` message may fail to send, resulting in
14359 * the channel eventually being silently forgotten.
14361 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
14363 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ 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_id, struct LDKUserConfig override_config);
14366 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
14367 * more information.
14369 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
14372 * Gets the list of usable channels, in random order. Useful as an argument to
14373 * get_route to ensure non-announced channels are used.
14375 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
14376 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
14379 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
14382 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
14383 * will be accepted on the given channel, and after additional timeout/the closing of all
14384 * pending HTLCs, the channel will be closed on chain.
14386 * * If we are the channel initiator, we will pay between our [`Background`] and
14387 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
14389 * * If our counterparty is the channel initiator, we will require a channel closing
14390 * transaction feerate of at least our [`Background`] feerate or the feerate which
14391 * would appear on a force-closure transaction, whichever is lower. We will allow our
14392 * counterparty to pay as much fee as they'd like, however.
14394 * May generate a SendShutdown message event on success, which should be relayed.
14396 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
14397 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
14398 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
14400 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
14403 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
14404 * will be accepted on the given channel, and after additional timeout/the closing of all
14405 * pending HTLCs, the channel will be closed on chain.
14407 * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
14408 * the channel being closed or not:
14409 * * If we are the channel initiator, we will pay at least this feerate on the closing
14410 * transaction. The upper-bound is set by
14411 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
14412 * estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
14413 * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
14414 * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
14415 * will appear on a force-closure transaction, whichever is lower).
14417 * May generate a SendShutdown message event on success, which should be relayed.
14419 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
14420 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
14421 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
14423 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);
14426 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
14427 * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
14429 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
14432 * Force close all channels, immediately broadcasting the latest local commitment transaction
14433 * for each to the chain and rejecting new HTLCs on each.
14435 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
14438 * Sends a payment along a given route.
14440 * Value parameters are provided via the last hop in route, see documentation for RouteHop
14441 * fields for more info.
14443 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
14444 * payment), we don't do anything to stop you! We always try to ensure that if the provided
14445 * next hop knows the preimage to payment_hash they can claim an additional amount as
14446 * specified in the last hop in the route! Thus, you should probably do your own
14447 * payment_preimage tracking (which you should already be doing as they represent \"proof of
14448 * payment\") and prevent double-sends yourself.
14450 * May generate SendHTLCs message(s) event on success, which should be relayed.
14452 * Each path may have a different return value, and PaymentSendValue may return a Vec with
14453 * each entry matching the corresponding-index entry in the route paths, see
14454 * PaymentSendFailure for more info.
14456 * In general, a path may raise:
14457 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
14458 * node public key) is specified.
14459 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
14460 * (including due to previous monitor update failure or new permanent monitor update
14462 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
14463 * relevant updates.
14465 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
14466 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
14467 * different route unless you intend to pay twice!
14469 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
14470 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
14471 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
14472 * must not contain multiple paths as multi-path payments require a recipient-provided
14474 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
14475 * bit set (either as required or as available). If multiple paths are present in the Route,
14476 * we assume the invoice had the basic_mpp feature set.
14478 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
14480 MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
14483 * Send a spontaneous payment, which is a payment that does not require the recipient to have
14484 * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
14485 * the preimage, it must be a cryptographically secure random value that no intermediate node
14486 * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
14487 * never reach the recipient.
14489 * See [`send_payment`] documentation for more details on the return value of this function.
14491 * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
14492 * [`send_payment`] for more information about the risks of duplicate preimage usage.
14494 * Note that `route` must have exactly one path.
14496 * [`send_payment`]: Self::send_payment
14498 * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
14500 MUST_USE_RES struct LDKCResult_PaymentHashPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage);
14503 * Call this upon creation of a funding transaction for the given channel.
14505 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
14506 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
14508 * Panics if a funding transaction has already been provided for this channel.
14510 * May panic if the output found in the funding transaction is duplicative with some other
14511 * channel (note that this should be trivially prevented by using unique funding transaction
14512 * keys per-channel).
14514 * Do NOT broadcast the funding transaction yourself. When we have safely received our
14515 * counterparty's signature the funding transaction will automatically be broadcast via the
14516 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
14518 * Note that this includes RBF or similar transaction replacement strategies - lightning does
14519 * not currently support replacing a funding transaction on an existing channel. Instead,
14520 * create a new channel with a conflicting funding transaction.
14522 * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
14524 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);
14527 * Regenerates channel_announcements and generates a signed node_announcement from the given
14528 * arguments, providing them in corresponding events via
14529 * [`get_and_clear_pending_msg_events`], if at least one public channel has been confirmed
14530 * on-chain. This effectively re-broadcasts all channel announcements and sends our node
14531 * announcement to ensure that the lightning P2P network is aware of the channels we have and
14532 * our network addresses.
14534 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
14535 * node to humans. They carry no in-protocol meaning.
14537 * `addresses` represent the set (possibly empty) of socket addresses on which this node
14538 * accepts incoming connections. These will be included in the node_announcement, publicly
14539 * tying these addresses together and to this node. If you wish to preserve user privacy,
14540 * addresses should likely contain only Tor Onion addresses.
14542 * Panics if `addresses` is absurdly large (more than 500).
14544 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
14546 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
14549 * Processes HTLCs which are pending waiting on random forward delay.
14551 * Should only really ever be called in response to a PendingHTLCsForwardable event.
14552 * Will likely generate further events.
14554 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
14557 * Performs actions which should happen on startup and roughly once per minute thereafter.
14559 * This currently includes:
14560 * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
14561 * * Broadcasting `ChannelUpdate` messages if we've been disconnected from our peer for more
14562 * than a minute, informing the network that they should no longer attempt to route over
14565 * Note that this may cause reentrancy through `chain::Watch::update_channel` calls or feerate
14566 * estimate fetches.
14568 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
14571 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
14572 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
14573 * along the path (including in our own channel on which we received it).
14574 * Returns false if no payment was found to fail backwards, true if the process of failing the
14575 * HTLC backwards has been started.
14577 MUST_USE_RES bool ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
14580 * Provides a payment preimage in response to a PaymentReceived event, returning true and
14581 * generating message events for the net layer to claim the payment, if possible. Thus, you
14582 * should probably kick the net layer to go send messages if this returns true!
14584 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
14585 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
14586 * event matches your expectation. If you fail to do so and call this method, you may provide
14587 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
14589 * May panic if called except in response to a PaymentReceived event.
14591 * [`create_inbound_payment`]: Self::create_inbound_payment
14592 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
14594 MUST_USE_RES bool ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
14597 * Gets the node_id held by this ChannelManager
14599 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
14602 * Restores a single, given channel to normal operation after a
14603 * ChannelMonitorUpdateErr::TemporaryFailure was returned from a channel monitor update
14606 * All ChannelMonitor updates up to and including highest_applied_update_id must have been
14607 * fully committed in every copy of the given channels' ChannelMonitors.
14609 * Note that there is no effect to calling with a highest_applied_update_id other than the
14610 * current latest ChannelMonitorUpdate and one call to this function after multiple
14611 * ChannelMonitorUpdateErr::TemporaryFailures is fine. The highest_applied_update_id field
14612 * exists largely only to prevent races between this and concurrent update_monitor calls.
14614 * Thus, the anticipated use is, at a high level:
14615 * 1) You register a chain::Watch with this ChannelManager,
14616 * 2) it stores each update to disk, and begins updating any remote (eg watchtower) copies of
14617 * said ChannelMonitors as it can, returning ChannelMonitorUpdateErr::TemporaryFailures
14618 * any time it cannot do so instantly,
14619 * 3) update(s) are applied to each remote copy of a ChannelMonitor,
14620 * 4) once all remote copies are updated, you call this function with the update_id that
14621 * completed, and once it is the latest the Channel will be re-enabled.
14623 void ChannelManager_channel_monitor_updated(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKOutPoint *NONNULL_PTR funding_txo, uint64_t highest_applied_update_id);
14626 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
14629 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
14630 * [`PaymentHash`] and [`PaymentPreimage`] for you, returning the first and storing the second.
14632 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
14633 * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
14634 * passed directly to [`claim_funds`].
14636 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
14638 * [`claim_funds`]: Self::claim_funds
14639 * [`PaymentReceived`]: events::Event::PaymentReceived
14640 * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
14641 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
14643 MUST_USE_RES struct LDKC2Tuple_PaymentHashPaymentSecretZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, uint64_t user_payment_id);
14646 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
14647 * stored external to LDK.
14649 * A [`PaymentReceived`] event will only be generated if the [`PaymentSecret`] matches a
14650 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
14651 * the `min_value_msat` provided here, if one is provided.
14653 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) must be globally unique. This
14654 * method may return an Err if another payment with the same payment_hash is still pending.
14656 * `user_payment_id` will be provided back in [`PaymentPurpose::InvoicePayment::user_payment_id`] events to
14657 * allow tracking of which events correspond with which calls to this and
14658 * [`create_inbound_payment`]. `user_payment_id` has no meaning inside of LDK, it is simply
14659 * copied to events and otherwise ignored. It may be used to correlate PaymentReceived events
14660 * with invoice metadata stored elsewhere.
14662 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
14663 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
14664 * before a [`PaymentReceived`] event will be generated, ensuring that we do not provide the
14665 * sender \"proof-of-payment\" unless they have paid the required amount.
14667 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
14668 * in excess of the current time. This should roughly match the expiry time set in the invoice.
14669 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
14670 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
14671 * invoices when no timeout is set.
14673 * Note that we use block header time to time-out pending inbound payments (with some margin
14674 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
14675 * accept a payment and generate a [`PaymentReceived`] event for some time after the expiry.
14676 * If you need exact expiry semantics, you should enforce them upon receipt of
14677 * [`PaymentReceived`].
14679 * Pending inbound payments are stored in memory and in serialized versions of this
14680 * [`ChannelManager`]. If potentially unbounded numbers of inbound payments may exist and
14681 * space is limited, you may wish to rate-limit inbound payment creation.
14683 * May panic if `invoice_expiry_delta_secs` is greater than one year.
14685 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
14686 * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
14688 * [`create_inbound_payment`]: Self::create_inbound_payment
14689 * [`PaymentReceived`]: events::Event::PaymentReceived
14690 * [`PaymentPurpose::InvoicePayment::user_payment_id`]: events::PaymentPurpose::InvoicePayment::user_payment_id
14692 MUST_USE_RES struct LDKCResult_PaymentSecretAPIErrorZ 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, uint64_t user_payment_id);
14695 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
14696 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
14698 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
14701 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
14702 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
14704 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
14707 * Constructs a new Listen which calls the relevant methods on this_arg.
14708 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
14710 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
14713 * Constructs a new Confirm which calls the relevant methods on this_arg.
14714 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
14716 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
14719 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
14720 * indicating whether persistence is necessary. Only one listener on
14721 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
14723 * Note that the feature `allow_wallclock_use` must be enabled to use this function.
14725 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
14728 * Blocks until ChannelManager needs to be persisted. Only one listener on
14729 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
14732 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
14735 * Gets the latest best block which was connected either via the [`chain::Listen`] or
14736 * [`chain::Confirm`] interfaces.
14738 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
14741 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
14742 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
14744 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
14747 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
14749 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
14752 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
14754 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
14757 * The keys provider which will give us relevant keys. Some keys will be loaded during
14758 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
14761 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
14764 * The keys provider which will give us relevant keys. Some keys will be loaded during
14765 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
14768 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
14771 * The fee_estimator for use in the ChannelManager in the future.
14773 * No calls to the FeeEstimator will be made during deserialization.
14775 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
14778 * The fee_estimator for use in the ChannelManager in the future.
14780 * No calls to the FeeEstimator will be made during deserialization.
14782 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
14785 * The chain::Watch for use in the ChannelManager in the future.
14787 * No calls to the chain::Watch will be made during deserialization. It is assumed that
14788 * you have deserialized ChannelMonitors separately and will add them to your
14789 * chain::Watch after deserializing this ChannelManager.
14791 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
14794 * The chain::Watch for use in the ChannelManager in the future.
14796 * No calls to the chain::Watch will be made during deserialization. It is assumed that
14797 * you have deserialized ChannelMonitors separately and will add them to your
14798 * chain::Watch after deserializing this ChannelManager.
14800 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
14803 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
14804 * used to broadcast the latest local commitment transactions of channels which must be
14805 * force-closed during deserialization.
14807 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
14810 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
14811 * used to broadcast the latest local commitment transactions of channels which must be
14812 * force-closed during deserialization.
14814 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
14817 * The Logger for use in the ChannelManager and which may be used to log information during
14820 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
14823 * The Logger for use in the ChannelManager and which may be used to log information during
14826 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
14829 * Default settings used for new channels. Any existing channels will continue to use the
14830 * runtime settings which were stored when the ChannelManager was serialized.
14832 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
14835 * Default settings used for new channels. Any existing channels will continue to use the
14836 * runtime settings which were stored when the ChannelManager was serialized.
14838 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
14841 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
14842 * HashMap for you. This is primarily useful for C bindings where it is not practical to
14843 * populate a HashMap directly from C.
14845 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);
14848 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
14850 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
14853 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
14855 void DecodeError_free(struct LDKDecodeError this_obj);
14858 * Creates a copy of the DecodeError
14860 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
14863 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
14865 void Init_free(struct LDKInit this_obj);
14868 * The relevant features which the sender supports
14870 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
14873 * The relevant features which the sender supports
14875 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
14878 * Constructs a new Init given each field
14880 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
14883 * Creates a copy of the Init
14885 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
14888 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
14890 void ErrorMessage_free(struct LDKErrorMessage this_obj);
14893 * The channel ID involved in the error
14895 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
14898 * The channel ID involved in the error
14900 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14903 * A possibly human-readable error description.
14904 * The string should be sanitized before it is used (e.g. emitted to logs
14905 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
14906 * vulnerability in the terminal emulator or the logging subsystem.
14908 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
14911 * A possibly human-readable error description.
14912 * The string should be sanitized before it is used (e.g. emitted to logs
14913 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
14914 * vulnerability in the terminal emulator or the logging subsystem.
14916 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
14919 * Constructs a new ErrorMessage given each field
14921 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
14924 * Creates a copy of the ErrorMessage
14926 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
14929 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
14931 void Ping_free(struct LDKPing this_obj);
14934 * The desired response length
14936 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
14939 * The desired response length
14941 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
14944 * The ping packet size.
14945 * This field is not sent on the wire. byteslen zeros are sent.
14947 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
14950 * The ping packet size.
14951 * This field is not sent on the wire. byteslen zeros are sent.
14953 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
14956 * Constructs a new Ping given each field
14958 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
14961 * Creates a copy of the Ping
14963 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
14966 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
14968 void Pong_free(struct LDKPong this_obj);
14971 * The pong packet size.
14972 * This field is not sent on the wire. byteslen zeros are sent.
14974 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
14977 * The pong packet size.
14978 * This field is not sent on the wire. byteslen zeros are sent.
14980 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
14983 * Constructs a new Pong given each field
14985 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
14988 * Creates a copy of the Pong
14990 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
14993 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
14995 void OpenChannel_free(struct LDKOpenChannel this_obj);
14998 * The genesis hash of the blockchain where the channel is to be opened
15000 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
15003 * The genesis hash of the blockchain where the channel is to be opened
15005 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15008 * A temporary channel ID, until the funding outpoint is announced
15010 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
15013 * A temporary channel ID, until the funding outpoint is announced
15015 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15018 * The channel value
15020 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
15023 * The channel value
15025 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
15028 * The amount to push to the counterparty as part of the open, in milli-satoshi
15030 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
15033 * The amount to push to the counterparty as part of the open, in milli-satoshi
15035 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
15038 * The threshold below which outputs on transactions broadcast by sender will be omitted
15040 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
15043 * The threshold below which outputs on transactions broadcast by sender will be omitted
15045 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
15048 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
15050 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
15053 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
15055 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
15058 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
15060 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
15063 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
15065 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
15068 * The minimum HTLC size incoming to sender, in milli-satoshi
15070 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
15073 * The minimum HTLC size incoming to sender, in milli-satoshi
15075 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
15078 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
15080 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
15083 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
15085 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
15088 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
15090 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
15093 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
15095 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
15098 * The maximum number of inbound HTLCs towards sender
15100 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
15103 * The maximum number of inbound HTLCs towards sender
15105 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
15108 * The sender's key controlling the funding transaction
15110 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
15113 * The sender's key controlling the funding transaction
15115 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15118 * Used to derive a revocation key for transactions broadcast by counterparty
15120 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
15123 * Used to derive a revocation key for transactions broadcast by counterparty
15125 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15128 * A payment key to sender for transactions broadcast by counterparty
15130 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
15133 * A payment key to sender for transactions broadcast by counterparty
15135 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15138 * Used to derive a payment key to sender for transactions broadcast by sender
15140 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
15143 * Used to derive a payment key to sender for transactions broadcast by sender
15145 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15148 * Used to derive an HTLC payment key to sender
15150 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
15153 * Used to derive an HTLC payment key to sender
15155 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15158 * The first to-be-broadcast-by-sender transaction's per commitment point
15160 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
15163 * The first to-be-broadcast-by-sender transaction's per commitment point
15165 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15170 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
15175 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
15178 * Creates a copy of the OpenChannel
15180 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
15183 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
15185 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
15188 * A temporary channel ID, until the funding outpoint is announced
15190 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
15193 * A temporary channel ID, until the funding outpoint is announced
15195 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15198 * The threshold below which outputs on transactions broadcast by sender will be omitted
15200 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
15203 * The threshold below which outputs on transactions broadcast by sender will be omitted
15205 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
15208 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
15210 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
15213 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
15215 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
15218 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
15220 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
15223 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
15225 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
15228 * The minimum HTLC size incoming to sender, in milli-satoshi
15230 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
15233 * The minimum HTLC size incoming to sender, in milli-satoshi
15235 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
15238 * Minimum depth of the funding transaction before the channel is considered open
15240 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
15243 * Minimum depth of the funding transaction before the channel is considered open
15245 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
15248 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
15250 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
15253 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
15255 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
15258 * The maximum number of inbound HTLCs towards sender
15260 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
15263 * The maximum number of inbound HTLCs towards sender
15265 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
15268 * The sender's key controlling the funding transaction
15270 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
15273 * The sender's key controlling the funding transaction
15275 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15278 * Used to derive a revocation key for transactions broadcast by counterparty
15280 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
15283 * Used to derive a revocation key for transactions broadcast by counterparty
15285 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15288 * A payment key to sender for transactions broadcast by counterparty
15290 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
15293 * A payment key to sender for transactions broadcast by counterparty
15295 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15298 * Used to derive a payment key to sender for transactions broadcast by sender
15300 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
15303 * Used to derive a payment key to sender for transactions broadcast by sender
15305 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15308 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
15310 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
15313 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
15315 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15318 * The first to-be-broadcast-by-sender transaction's per commitment point
15320 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
15323 * The first to-be-broadcast-by-sender transaction's per commitment point
15325 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15328 * Creates a copy of the AcceptChannel
15330 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
15333 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
15335 void FundingCreated_free(struct LDKFundingCreated this_obj);
15338 * A temporary channel ID, until the funding is established
15340 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
15343 * A temporary channel ID, until the funding is established
15345 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15348 * The funding transaction ID
15350 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
15353 * The funding transaction ID
15355 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15358 * The specific output index funding this channel
15360 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
15363 * The specific output index funding this channel
15365 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
15368 * The signature of the channel initiator (funder) on the funding transaction
15370 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
15373 * The signature of the channel initiator (funder) on the funding transaction
15375 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
15378 * Constructs a new FundingCreated given each field
15380 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);
15383 * Creates a copy of the FundingCreated
15385 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
15388 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
15390 void FundingSigned_free(struct LDKFundingSigned this_obj);
15395 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
15400 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15403 * The signature of the channel acceptor (fundee) on the funding transaction
15405 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
15408 * The signature of the channel acceptor (fundee) on the funding transaction
15410 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
15413 * Constructs a new FundingSigned given each field
15415 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
15418 * Creates a copy of the FundingSigned
15420 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
15423 * Frees any resources used by the FundingLocked, if is_owned is set and inner is non-NULL.
15425 void FundingLocked_free(struct LDKFundingLocked this_obj);
15430 const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32];
15435 void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15438 * The per-commitment point of the second commitment transaction
15440 struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr);
15443 * The per-commitment point of the second commitment transaction
15445 void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15448 * Constructs a new FundingLocked given each field
15450 MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
15453 * Creates a copy of the FundingLocked
15455 struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
15458 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
15460 void Shutdown_free(struct LDKShutdown this_obj);
15465 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
15470 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15473 * The destination of this peer's funds on closing.
15474 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
15476 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
15479 * The destination of this peer's funds on closing.
15480 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
15482 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
15485 * Constructs a new Shutdown given each field
15487 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
15490 * Creates a copy of the Shutdown
15492 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
15495 * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
15497 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
15500 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
15503 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
15506 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
15509 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
15512 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
15515 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
15518 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
15521 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
15524 * Constructs a new ClosingSignedFeeRange given each field
15526 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
15529 * Creates a copy of the ClosingSignedFeeRange
15531 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
15534 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
15536 void ClosingSigned_free(struct LDKClosingSigned this_obj);
15541 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
15546 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15549 * The proposed total fee for the closing transaction
15551 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
15554 * The proposed total fee for the closing transaction
15556 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
15559 * A signature on the closing transaction
15561 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
15564 * A signature on the closing transaction
15566 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
15569 * The minimum and maximum fees which the sender is willing to accept, provided only by new
15572 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
15574 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
15577 * The minimum and maximum fees which the sender is willing to accept, provided only by new
15580 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
15582 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
15585 * Constructs a new ClosingSigned given each field
15587 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);
15590 * Creates a copy of the ClosingSigned
15592 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
15595 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
15597 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
15602 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
15607 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15612 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
15617 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
15620 * The HTLC value in milli-satoshi
15622 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
15625 * The HTLC value in milli-satoshi
15627 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
15630 * The payment hash, the pre-image of which controls HTLC redemption
15632 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
15635 * The payment hash, the pre-image of which controls HTLC redemption
15637 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15640 * The expiry height of the HTLC
15642 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
15645 * The expiry height of the HTLC
15647 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
15650 * Creates a copy of the UpdateAddHTLC
15652 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
15655 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
15657 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
15662 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
15667 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15672 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
15677 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
15680 * The pre-image of the payment hash, allowing HTLC redemption
15682 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
15685 * The pre-image of the payment hash, allowing HTLC redemption
15687 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15690 * Constructs a new UpdateFulfillHTLC given each field
15692 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
15695 * Creates a copy of the UpdateFulfillHTLC
15697 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
15700 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
15702 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
15707 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
15712 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15717 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
15722 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
15725 * Creates a copy of the UpdateFailHTLC
15727 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
15730 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
15732 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
15737 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
15742 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15747 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
15752 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
15757 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
15762 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
15765 * Creates a copy of the UpdateFailMalformedHTLC
15767 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
15770 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
15772 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
15777 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
15782 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15785 * A signature on the commitment transaction
15787 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
15790 * A signature on the commitment transaction
15792 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
15795 * Signatures on the HTLC transactions
15797 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
15800 * Constructs a new CommitmentSigned given each field
15802 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
15805 * Creates a copy of the CommitmentSigned
15807 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
15810 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
15812 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
15817 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
15822 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15825 * The secret corresponding to the per-commitment point
15827 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
15830 * The secret corresponding to the per-commitment point
15832 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15835 * The next sender-broadcast commitment transaction's per-commitment point
15837 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
15840 * The next sender-broadcast commitment transaction's per-commitment point
15842 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15845 * Constructs a new RevokeAndACK given each field
15847 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);
15850 * Creates a copy of the RevokeAndACK
15852 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
15855 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
15857 void UpdateFee_free(struct LDKUpdateFee this_obj);
15862 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
15867 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15870 * Fee rate per 1000-weight of the transaction
15872 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
15875 * Fee rate per 1000-weight of the transaction
15877 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
15880 * Constructs a new UpdateFee given each field
15882 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
15885 * Creates a copy of the UpdateFee
15887 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
15890 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
15892 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
15895 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
15896 * belonging to the recipient
15898 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
15901 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
15902 * belonging to the recipient
15904 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15907 * The sender's per-commitment point for their current commitment transaction
15909 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
15912 * The sender's per-commitment point for their current commitment transaction
15914 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15917 * Constructs a new DataLossProtect given each field
15919 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
15922 * Creates a copy of the DataLossProtect
15924 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
15927 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
15929 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
15934 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
15939 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15942 * The next commitment number for the sender
15944 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
15947 * The next commitment number for the sender
15949 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
15952 * The next commitment number for the recipient
15954 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
15957 * The next commitment number for the recipient
15959 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
15962 * Creates a copy of the ChannelReestablish
15964 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
15967 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
15969 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
15974 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
15979 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15982 * The short channel ID
15984 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
15987 * The short channel ID
15989 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
15992 * A signature by the node key
15994 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
15997 * A signature by the node key
15999 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
16002 * A signature by the funding key
16004 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
16007 * A signature by the funding key
16009 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
16012 * Constructs a new AnnouncementSignatures given each field
16014 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);
16017 * Creates a copy of the AnnouncementSignatures
16019 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
16022 * Frees any resources used by the NetAddress
16024 void NetAddress_free(struct LDKNetAddress this_ptr);
16027 * Creates a copy of the NetAddress
16029 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
16032 * Utility method to constructs a new IPv4-variant NetAddress
16034 struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port);
16037 * Utility method to constructs a new IPv6-variant NetAddress
16039 struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port);
16042 * Utility method to constructs a new OnionV2-variant NetAddress
16044 struct LDKNetAddress NetAddress_onion_v2(struct LDKTenBytes addr, uint16_t port);
16047 * Utility method to constructs a new OnionV3-variant NetAddress
16049 struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
16052 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
16054 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
16057 * Read a Result from a byte array, created by Result_write
16059 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
16062 * Read a NetAddress from a byte array, created by NetAddress_write
16064 struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
16067 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
16069 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
16072 * The advertised features
16074 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
16077 * The advertised features
16079 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
16082 * A strictly monotonic announcement counter, with gaps allowed
16084 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
16087 * A strictly monotonic announcement counter, with gaps allowed
16089 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
16092 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
16095 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
16098 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
16101 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16104 * An RGB color for UI purposes
16106 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
16109 * An RGB color for UI purposes
16111 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
16114 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
16117 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
16120 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
16123 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
16126 * List of addresses on which this node is reachable
16128 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
16131 * Creates a copy of the UnsignedNodeAnnouncement
16133 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
16136 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
16138 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
16141 * The signature by the node key
16143 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
16146 * The signature by the node key
16148 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
16151 * The actual content of the announcement
16153 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
16156 * The actual content of the announcement
16158 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
16161 * Constructs a new NodeAnnouncement given each field
16163 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
16166 * Creates a copy of the NodeAnnouncement
16168 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
16171 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
16173 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
16176 * The advertised channel features
16178 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
16181 * The advertised channel features
16183 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
16186 * The genesis hash of the blockchain where the channel is to be opened
16188 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
16191 * The genesis hash of the blockchain where the channel is to be opened
16193 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
16196 * The short channel ID
16198 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
16201 * The short channel ID
16203 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
16206 * One of the two node_ids which are endpoints of this channel
16208 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
16211 * One of the two node_ids which are endpoints of this channel
16213 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16216 * The other of the two node_ids which are endpoints of this channel
16218 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
16221 * The other of the two node_ids which are endpoints of this channel
16223 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16226 * The funding key for the first node
16228 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
16231 * The funding key for the first node
16233 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16236 * The funding key for the second node
16238 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
16241 * The funding key for the second node
16243 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16246 * Creates a copy of the UnsignedChannelAnnouncement
16248 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
16251 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
16253 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
16256 * Authentication of the announcement by the first public node
16258 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
16261 * Authentication of the announcement by the first public node
16263 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
16266 * Authentication of the announcement by the second public node
16268 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
16271 * Authentication of the announcement by the second public node
16273 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
16276 * Proof of funding UTXO ownership by the first public node
16278 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
16281 * Proof of funding UTXO ownership by the first public node
16283 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
16286 * Proof of funding UTXO ownership by the second public node
16288 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
16291 * Proof of funding UTXO ownership by the second public node
16293 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
16296 * The actual announcement
16298 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
16301 * The actual announcement
16303 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
16306 * Constructs a new ChannelAnnouncement given each field
16308 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);
16311 * Creates a copy of the ChannelAnnouncement
16313 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
16316 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
16318 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
16321 * The genesis hash of the blockchain where the channel is to be opened
16323 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
16326 * The genesis hash of the blockchain where the channel is to be opened
16328 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
16331 * The short channel ID
16333 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
16336 * The short channel ID
16338 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
16341 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
16343 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
16346 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
16348 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
16353 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
16358 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
16361 * The number of blocks such that if:
16362 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
16363 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
16364 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
16365 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
16366 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
16367 * forwarding. Note that the HTLC sender is the one who originally sets this value when
16368 * constructing the route.
16370 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
16373 * The number of blocks such that if:
16374 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
16375 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
16376 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
16377 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
16378 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
16379 * forwarding. Note that the HTLC sender is the one who originally sets this value when
16380 * constructing the route.
16382 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
16385 * The minimum HTLC size incoming to sender, in milli-satoshi
16387 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
16390 * The minimum HTLC size incoming to sender, in milli-satoshi
16392 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
16395 * The base HTLC fee charged by sender, in milli-satoshi
16397 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
16400 * The base HTLC fee charged by sender, in milli-satoshi
16402 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
16405 * The amount to fee multiplier, in micro-satoshi
16407 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
16410 * The amount to fee multiplier, in micro-satoshi
16412 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
16415 * Creates a copy of the UnsignedChannelUpdate
16417 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
16420 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
16422 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
16425 * A signature of the channel update
16427 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
16430 * A signature of the channel update
16432 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
16435 * The actual channel update
16437 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
16440 * The actual channel update
16442 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
16445 * Constructs a new ChannelUpdate given each field
16447 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
16450 * Creates a copy of the ChannelUpdate
16452 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
16455 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
16457 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
16460 * The genesis hash of the blockchain being queried
16462 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
16465 * The genesis hash of the blockchain being queried
16467 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
16470 * The height of the first block for the channel UTXOs being queried
16472 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
16475 * The height of the first block for the channel UTXOs being queried
16477 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
16480 * The number of blocks to include in the query results
16482 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
16485 * The number of blocks to include in the query results
16487 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
16490 * Constructs a new QueryChannelRange given each field
16492 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
16495 * Creates a copy of the QueryChannelRange
16497 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
16500 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
16502 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
16505 * The genesis hash of the blockchain being queried
16507 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
16510 * The genesis hash of the blockchain being queried
16512 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
16515 * The height of the first block in the range of the reply
16517 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
16520 * The height of the first block in the range of the reply
16522 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
16525 * The number of blocks included in the range of the reply
16527 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
16530 * The number of blocks included in the range of the reply
16532 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
16535 * True when this is the final reply for a query
16537 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
16540 * True when this is the final reply for a query
16542 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
16545 * The short_channel_ids in the channel range
16547 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
16550 * Constructs a new ReplyChannelRange given each field
16552 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);
16555 * Creates a copy of the ReplyChannelRange
16557 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
16560 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
16562 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
16565 * The genesis hash of the blockchain being queried
16567 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
16570 * The genesis hash of the blockchain being queried
16572 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
16575 * The short_channel_ids that are being queried
16577 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
16580 * Constructs a new QueryShortChannelIds given each field
16582 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
16585 * Creates a copy of the QueryShortChannelIds
16587 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
16590 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
16592 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
16595 * The genesis hash of the blockchain that was queried
16597 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
16600 * The genesis hash of the blockchain that was queried
16602 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
16605 * Indicates if the query recipient maintains up-to-date channel
16606 * information for the chain_hash
16608 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
16611 * Indicates if the query recipient maintains up-to-date channel
16612 * information for the chain_hash
16614 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
16617 * Constructs a new ReplyShortChannelIdsEnd given each field
16619 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
16622 * Creates a copy of the ReplyShortChannelIdsEnd
16624 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
16627 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
16629 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
16632 * The genesis hash of the blockchain for channel and node information
16634 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
16637 * The genesis hash of the blockchain for channel and node information
16639 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
16642 * The starting unix timestamp
16644 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
16647 * The starting unix timestamp
16649 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
16652 * The range of information in seconds
16654 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
16657 * The range of information in seconds
16659 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
16662 * Constructs a new GossipTimestampFilter given each field
16664 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
16667 * Creates a copy of the GossipTimestampFilter
16669 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
16672 * Frees any resources used by the ErrorAction
16674 void ErrorAction_free(struct LDKErrorAction this_ptr);
16677 * Creates a copy of the ErrorAction
16679 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
16682 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
16684 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
16687 * Utility method to constructs a new IgnoreError-variant ErrorAction
16689 struct LDKErrorAction ErrorAction_ignore_error(void);
16692 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
16694 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
16697 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
16699 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
16702 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
16704 void LightningError_free(struct LDKLightningError this_obj);
16707 * A human-readable message describing the error
16709 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
16712 * A human-readable message describing the error
16714 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
16717 * The action which should be taken against the offending peer.
16719 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
16722 * The action which should be taken against the offending peer.
16724 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
16727 * Constructs a new LightningError given each field
16729 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
16732 * Creates a copy of the LightningError
16734 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
16737 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
16739 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
16742 * update_add_htlc messages which should be sent
16744 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
16747 * update_fulfill_htlc messages which should be sent
16749 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
16752 * update_fail_htlc messages which should be sent
16754 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
16757 * update_fail_malformed_htlc messages which should be sent
16759 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
16762 * An update_fee message which should be sent
16764 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
16766 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
16769 * An update_fee message which should be sent
16771 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
16773 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
16776 * Finally, the commitment_signed message which should be sent
16778 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
16781 * Finally, the commitment_signed message which should be sent
16783 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
16786 * Constructs a new CommitmentUpdate given each field
16788 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);
16791 * Creates a copy of the CommitmentUpdate
16793 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
16796 * Frees any resources used by the HTLCFailChannelUpdate
16798 void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr);
16801 * Creates a copy of the HTLCFailChannelUpdate
16803 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig);
16806 * Utility method to constructs a new ChannelUpdateMessage-variant HTLCFailChannelUpdate
16808 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_channel_update_message(struct LDKChannelUpdate msg);
16811 * Utility method to constructs a new ChannelClosed-variant HTLCFailChannelUpdate
16813 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_channel_closed(uint64_t short_channel_id, bool is_permanent);
16816 * Utility method to constructs a new NodeFailure-variant HTLCFailChannelUpdate
16818 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
16821 * Calls the free function if one is set
16823 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
16826 * Calls the free function if one is set
16828 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
16831 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
16833 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
16836 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
16838 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
16841 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
16843 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
16846 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
16848 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
16851 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
16853 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
16856 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
16858 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
16861 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
16863 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
16866 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
16868 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
16871 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
16873 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
16876 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
16878 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
16881 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
16883 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
16886 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
16888 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
16891 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
16893 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
16896 * Read a FundingCreated from a byte array, created by FundingCreated_write
16898 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
16901 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
16903 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
16906 * Read a FundingSigned from a byte array, created by FundingSigned_write
16908 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
16911 * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
16913 struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
16916 * Read a FundingLocked from a byte array, created by FundingLocked_write
16918 struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
16921 * Serialize the Init object into a byte array which can be read by Init_read
16923 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
16926 * Read a Init from a byte array, created by Init_write
16928 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
16931 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
16933 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
16936 * Read a OpenChannel from a byte array, created by OpenChannel_write
16938 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
16941 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
16943 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
16946 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
16948 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
16951 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
16953 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
16956 * Read a Shutdown from a byte array, created by Shutdown_write
16958 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
16961 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
16963 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
16966 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
16968 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
16971 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
16973 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
16976 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
16978 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
16981 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
16983 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
16986 * Read a UpdateFee from a byte array, created by UpdateFee_write
16988 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
16991 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
16993 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
16996 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
16998 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
17001 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
17003 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
17006 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
17008 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
17011 * Serialize the Ping object into a byte array which can be read by Ping_read
17013 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
17016 * Read a Ping from a byte array, created by Ping_write
17018 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
17021 * Serialize the Pong object into a byte array which can be read by Pong_read
17023 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
17026 * Read a Pong from a byte array, created by Pong_write
17028 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
17031 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
17033 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
17036 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
17038 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
17041 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
17043 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
17046 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
17048 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
17051 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
17053 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
17056 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
17058 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
17061 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
17063 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
17066 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
17068 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
17071 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
17073 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
17076 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
17078 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
17081 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
17083 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
17086 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
17088 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
17091 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
17093 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
17096 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
17098 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
17101 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
17103 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
17106 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
17108 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
17111 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
17113 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
17116 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
17118 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
17121 *\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
17123 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
17126 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
17128 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
17131 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
17133 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
17136 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
17138 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
17141 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
17143 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
17146 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
17148 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
17151 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
17153 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
17156 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
17158 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
17161 * Constructs a new IgnoringMessageHandler given each field
17163 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
17166 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
17167 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
17169 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
17172 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
17173 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
17175 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
17178 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
17180 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
17183 * Constructs a new ErroringMessageHandler
17185 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
17188 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
17189 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
17191 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
17194 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
17195 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
17197 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
17200 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
17202 void MessageHandler_free(struct LDKMessageHandler this_obj);
17205 * A message handler which handles messages specific to channels. Usually this is just a
17206 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
17208 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17210 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
17213 * A message handler which handles messages specific to channels. Usually this is just a
17214 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
17216 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17218 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
17221 * A message handler which handles messages updating our knowledge of the network channel
17222 * graph. Usually this is just a [`NetGraphMsgHandler`] object or an
17223 * [`IgnoringMessageHandler`].
17225 * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler
17227 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
17230 * A message handler which handles messages updating our knowledge of the network channel
17231 * graph. Usually this is just a [`NetGraphMsgHandler`] object or an
17232 * [`IgnoringMessageHandler`].
17234 * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler
17236 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
17239 * Constructs a new MessageHandler given each field
17241 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
17244 * Creates a copy of a SocketDescriptor
17246 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
17249 * Calls the free function if one is set
17251 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
17254 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
17256 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
17259 * Used to indicate that we probably can't make any future connections to this peer, implying
17260 * we should go ahead and force-close any channels we have with it.
17262 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
17265 * Used to indicate that we probably can't make any future connections to this peer, implying
17266 * we should go ahead and force-close any channels we have with it.
17268 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
17271 * Constructs a new PeerHandleError given each field
17273 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
17276 * Creates a copy of the PeerHandleError
17278 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
17281 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
17283 void PeerManager_free(struct LDKPeerManager this_obj);
17286 * Constructs a new PeerManager with the given message handlers and node_id secret key
17287 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
17288 * cryptographically secure random bytes.
17290 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);
17293 * Get the list of node ids for peers which have completed the initial handshake.
17295 * For outbound connections, this will be the same as the their_node_id parameter passed in to
17296 * new_outbound_connection, however entries will only appear once the initial handshake has
17297 * completed and we are sure the remote peer has the private key for the given node_id.
17299 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
17302 * Indicates a new outbound connection has been established to a node with the given node_id.
17303 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
17304 * descriptor but must disconnect the connection immediately.
17306 * Returns a small number of bytes to send to the remote node (currently always 50).
17308 * Panics if descriptor is duplicative with some other descriptor which has not yet been
17309 * [`socket_disconnected()`].
17311 * [`socket_disconnected()`]: PeerManager::socket_disconnected
17313 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);
17316 * Indicates a new inbound connection has been established.
17318 * May refuse the connection by returning an Err, but will never write bytes to the remote end
17319 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
17320 * call socket_disconnected for the new descriptor but must disconnect the connection
17323 * Panics if descriptor is duplicative with some other descriptor which has not yet been
17324 * [`socket_disconnected()`].
17326 * [`socket_disconnected()`]: PeerManager::socket_disconnected
17328 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor);
17331 * Indicates that there is room to write data to the given socket descriptor.
17333 * May return an Err to indicate that the connection should be closed.
17335 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
17336 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
17337 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
17338 * ready to call `[write_buffer_space_avail`] again if a write call generated here isn't
17341 * [`send_data`]: SocketDescriptor::send_data
17342 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
17344 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
17347 * Indicates that data was read from the given socket descriptor.
17349 * May return an Err to indicate that the connection should be closed.
17351 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
17352 * Thus, however, you should call [`process_events`] after any `read_event` to generate
17353 * [`send_data`] calls to handle responses.
17355 * If `Ok(true)` is returned, further read_events should not be triggered until a
17356 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
17359 * [`send_data`]: SocketDescriptor::send_data
17360 * [`process_events`]: PeerManager::process_events
17362 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);
17365 * Checks for any events generated by our handlers and processes them. Includes sending most
17366 * response messages as well as messages generated by calls to handler functions directly (eg
17367 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
17369 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
17372 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
17373 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
17374 * [`send_data`]: SocketDescriptor::send_data
17376 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
17379 * Indicates that the given socket descriptor's connection is now closed.
17381 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
17384 * Disconnect a peer given its node id.
17386 * Set `no_connection_possible` to true to prevent any further connection with this peer,
17387 * force-closing any channels we have with it.
17389 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
17390 * peer. Thus, be very careful about reentrancy issues.
17392 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
17394 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
17397 * Send pings to each peer and disconnect those which did not respond to the last round of
17400 * This may be called on any timescale you want, however, roughly once every five to ten
17401 * seconds is preferred. The call rate determines both how often we send a ping to our peers
17402 * and how much time they have to respond before we disconnect them.
17404 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
17407 * [`send_data`]: SocketDescriptor::send_data
17409 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
17412 * Build the commitment secret from the seed and the commitment number
17414 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
17417 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
17418 * from the base secret and the per_commitment_point.
17420 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
17421 * generated (ie our own).
17423 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
17426 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
17427 * from the base point and the per_commitment_key. This is the public equivalent of
17428 * derive_private_key - using only public keys to derive a public key instead of private keys.
17430 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
17431 * generated (ie our own).
17433 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
17436 * Derives a per-commitment-transaction revocation key from its constituent parts.
17438 * Only the cheating participant owns a valid witness to propagate a revoked
17439 * commitment transaction, thus per_commitment_secret always come from cheater
17440 * and revocation_base_secret always come from punisher, which is the broadcaster
17441 * of the transaction spending with this key knowledge.
17443 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
17444 * generated (ie our own).
17446 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
17449 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
17450 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
17451 * public key instead of private keys.
17453 * Only the cheating participant owns a valid witness to propagate a revoked
17454 * commitment transaction, thus per_commitment_point always come from cheater
17455 * and revocation_base_point always come from punisher, which is the broadcaster
17456 * of the transaction spending with this key knowledge.
17458 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
17459 * generated (ie our own).
17461 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
17464 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
17466 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
17469 * The broadcaster's per-commitment public key which was used to derive the other keys.
17471 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
17474 * The broadcaster's per-commitment public key which was used to derive the other keys.
17476 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17479 * The revocation key which is used to allow the broadcaster of the commitment
17480 * transaction to provide their counterparty the ability to punish them if they broadcast
17483 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
17486 * The revocation key which is used to allow the broadcaster of the commitment
17487 * transaction to provide their counterparty the ability to punish them if they broadcast
17490 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17493 * Broadcaster's HTLC Key
17495 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
17498 * Broadcaster's HTLC Key
17500 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17503 * Countersignatory's HTLC Key
17505 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
17508 * Countersignatory's HTLC Key
17510 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17513 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
17515 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
17518 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
17520 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17523 * Constructs a new TxCreationKeys given each field
17525 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);
17528 * Creates a copy of the TxCreationKeys
17530 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
17533 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
17535 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
17538 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
17540 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
17543 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
17545 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
17548 * The public key which is used to sign all commitment transactions, as it appears in the
17549 * on-chain channel lock-in 2-of-2 multisig output.
17551 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
17554 * The public key which is used to sign all commitment transactions, as it appears in the
17555 * on-chain channel lock-in 2-of-2 multisig output.
17557 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17560 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
17561 * revocation keys. This is combined with the per-commitment-secret generated by the
17562 * counterparty to create a secret which the counterparty can reveal to revoke previous
17565 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
17568 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
17569 * revocation keys. This is combined with the per-commitment-secret generated by the
17570 * counterparty to create a secret which the counterparty can reveal to revoke previous
17573 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17576 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
17577 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
17578 * static across every commitment transaction.
17580 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
17583 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
17584 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
17585 * static across every commitment transaction.
17587 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17590 * The base point which is used (with derive_public_key) to derive a per-commitment payment
17591 * public key which receives non-HTLC-encumbered funds which are only available for spending
17592 * after some delay (or can be claimed via the revocation path).
17594 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
17597 * The base point which is used (with derive_public_key) to derive a per-commitment payment
17598 * public key which receives non-HTLC-encumbered funds which are only available for spending
17599 * after some delay (or can be claimed via the revocation path).
17601 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17604 * The base point which is used (with derive_public_key) to derive a per-commitment public key
17605 * which is used to encumber HTLC-in-flight outputs.
17607 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
17610 * The base point which is used (with derive_public_key) to derive a per-commitment public key
17611 * which is used to encumber HTLC-in-flight outputs.
17613 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17616 * Constructs a new ChannelPublicKeys given each field
17618 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);
17621 * Creates a copy of the ChannelPublicKeys
17623 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
17626 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
17628 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
17631 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
17633 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
17636 * Create per-state keys from channel base points and the per-commitment point.
17637 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
17639 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);
17642 * Generate per-state keys from channel static keys.
17643 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
17645 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);
17648 * A script either spendable by the revocation
17649 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
17650 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
17652 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
17655 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
17657 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
17660 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
17661 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
17662 * need to compare this value to whether the commitment transaction in question is that of
17663 * the counterparty or our own.
17665 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
17668 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
17669 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
17670 * need to compare this value to whether the commitment transaction in question is that of
17671 * the counterparty or our own.
17673 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
17676 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
17677 * this divided by 1000.
17679 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
17682 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
17683 * this divided by 1000.
17685 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
17688 * The CLTV lock-time at which this HTLC expires.
17690 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
17693 * The CLTV lock-time at which this HTLC expires.
17695 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
17698 * The hash of the preimage which unlocks this HTLC.
17700 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
17703 * The hash of the preimage which unlocks this HTLC.
17705 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
17708 * The position within the commitment transactions' outputs. This may be None if the value is
17709 * below the dust limit (in which case no output appears in the commitment transaction and the
17710 * value is spent to additional transaction fees).
17712 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
17715 * The position within the commitment transactions' outputs. This may be None if the value is
17716 * below the dust limit (in which case no output appears in the commitment transaction and the
17717 * value is spent to additional transaction fees).
17719 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
17722 * Constructs a new HTLCOutputInCommitment given each field
17724 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);
17727 * Creates a copy of the HTLCOutputInCommitment
17729 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
17732 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
17734 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
17737 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
17739 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
17742 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
17743 * does not need to have its previous_output_index filled.
17745 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys);
17748 * Gets the redeemscript for a funding output from the two funding public keys.
17749 * Note that the order of funding public keys does not matter.
17751 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
17754 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
17755 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
17756 * transaction which needs signing, and can be used to construct an HTLC transaction which is
17757 * broadcastable given a counterparty HTLC signature.
17759 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
17760 * commitment transaction).
17762 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, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
17765 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
17767 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
17770 * Holder public keys
17772 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
17775 * Holder public keys
17777 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
17780 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
17782 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
17785 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
17787 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
17790 * Whether the holder is the initiator of this channel.
17791 * This is an input to the commitment number obscure factor computation.
17793 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
17796 * Whether the holder is the initiator of this channel.
17797 * This is an input to the commitment number obscure factor computation.
17799 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
17802 * The late-bound counterparty channel transaction parameters.
17803 * These parameters are populated at the point in the protocol where the counterparty provides them.
17805 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
17807 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
17810 * The late-bound counterparty channel transaction parameters.
17811 * These parameters are populated at the point in the protocol where the counterparty provides them.
17813 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
17815 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
17818 * The late-bound funding outpoint
17820 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
17822 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
17825 * The late-bound funding outpoint
17827 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
17829 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
17832 * Constructs a new ChannelTransactionParameters given each field
17834 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);
17837 * Creates a copy of the ChannelTransactionParameters
17839 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
17842 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
17844 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
17847 * Counter-party public keys
17849 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
17852 * Counter-party public keys
17854 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
17857 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
17859 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
17862 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
17864 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
17867 * Constructs a new CounterpartyChannelTransactionParameters given each field
17869 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
17872 * Creates a copy of the CounterpartyChannelTransactionParameters
17874 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
17877 * Whether the late bound parameters are populated.
17879 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
17882 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
17883 * given that the holder is the broadcaster.
17885 * self.is_populated() must be true before calling this function.
17887 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
17890 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
17891 * given that the counterparty is the broadcaster.
17893 * self.is_populated() must be true before calling this function.
17895 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
17898 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
17900 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
17903 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
17905 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
17908 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
17910 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
17913 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
17915 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
17918 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
17920 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
17923 * Get the channel pubkeys for the broadcaster
17925 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
17928 * Get the channel pubkeys for the countersignatory
17930 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
17933 * Get the contest delay applicable to the transactions.
17934 * Note that the contest delay was selected by the countersignatory.
17936 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
17939 * Whether the channel is outbound from the broadcaster.
17941 * The boolean representing the side that initiated the channel is
17942 * an input to the commitment number obscure factor computation.
17944 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
17947 * The funding outpoint
17949 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
17952 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
17954 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
17957 * Our counterparty's signature for the transaction
17959 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
17962 * Our counterparty's signature for the transaction
17964 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
17967 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
17969 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
17972 * Creates a copy of the HolderCommitmentTransaction
17974 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
17977 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
17979 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
17982 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
17984 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
17987 * Create a new holder transaction with the given counterparty signatures.
17988 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
17990 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);
17993 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
17995 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
17998 * The commitment transaction
18000 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
18003 * The commitment transaction
18005 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
18008 * The txid for the commitment transaction.
18010 * This is provided as a performance optimization, instead of calling transaction.txid()
18013 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
18016 * The txid for the commitment transaction.
18018 * This is provided as a performance optimization, instead of calling transaction.txid()
18021 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18024 * Constructs a new BuiltCommitmentTransaction given each field
18026 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
18029 * Creates a copy of the BuiltCommitmentTransaction
18031 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
18034 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
18036 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
18039 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
18041 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
18044 * Get the SIGHASH_ALL sighash value of the transaction.
18046 * This can be used to verify a signature.
18048 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);
18051 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
18052 * because we are about to broadcast a holder transaction.
18054 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);
18057 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
18059 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
18062 * Creates a copy of the CommitmentTransaction
18064 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
18067 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
18069 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
18072 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
18074 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
18077 * The backwards-counting commitment number
18079 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
18082 * The value to be sent to the broadcaster
18084 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
18087 * The value to be sent to the counterparty
18089 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
18092 * The feerate paid per 1000-weight-unit in this commitment transaction.
18094 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
18097 * Trust our pre-built transaction and derived transaction creation public keys.
18099 * Applies a wrapper which allows access to these fields.
18101 * This should only be used if you fully trust the builder of this object. It should not
18102 *\tbe used by an external signer - instead use the verify function.
18104 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
18107 * Verify our pre-built transaction and derived transaction creation public keys.
18109 * Applies a wrapper which allows access to these fields.
18111 * An external validating signer must call this method before signing
18112 * or using the built transaction.
18114 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);
18117 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
18119 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
18122 * The transaction ID of the built Bitcoin transaction
18124 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
18127 * The pre-built Bitcoin commitment transaction
18129 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
18132 * The pre-calculated transaction creation public keys.
18134 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
18137 * Get a signature for each HTLC which was included in the commitment transaction (ie for
18138 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
18140 * The returned Vec has one entry for each HTLC, and in the same order.
18142 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);
18145 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
18146 * shared secret first. This prevents on-chain observers from discovering how many commitment
18147 * transactions occurred in a channel before it was closed.
18149 * This function gets the shared secret from relevant channel public keys and can be used to
18150 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
18152 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
18155 * Checks if two InitFeaturess contain equal inner contents.
18156 * This ignores pointers and is_owned flags and looks at the values in fields.
18157 * Two objects with NULL inner values will be considered "equal" here.
18159 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
18162 * Checks if two NodeFeaturess contain equal inner contents.
18163 * This ignores pointers and is_owned flags and looks at the values in fields.
18164 * Two objects with NULL inner values will be considered "equal" here.
18166 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
18169 * Checks if two ChannelFeaturess contain equal inner contents.
18170 * This ignores pointers and is_owned flags and looks at the values in fields.
18171 * Two objects with NULL inner values will be considered "equal" here.
18173 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
18176 * Checks if two InvoiceFeaturess contain equal inner contents.
18177 * This ignores pointers and is_owned flags and looks at the values in fields.
18178 * Two objects with NULL inner values will be considered "equal" here.
18180 bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b);
18183 * Creates a copy of the InitFeatures
18185 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
18188 * Creates a copy of the NodeFeatures
18190 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
18193 * Creates a copy of the ChannelFeatures
18195 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
18198 * Creates a copy of the InvoiceFeatures
18200 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
18203 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
18205 void InitFeatures_free(struct LDKInitFeatures this_obj);
18208 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
18210 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
18213 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
18215 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
18218 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
18220 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
18223 * Create a blank Features with no features set
18225 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
18228 * Creates a Features with the bits set which are known by the implementation
18230 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
18233 * Create a blank Features with no features set
18235 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
18238 * Creates a Features with the bits set which are known by the implementation
18240 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
18243 * Create a blank Features with no features set
18245 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
18248 * Creates a Features with the bits set which are known by the implementation
18250 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
18253 * Create a blank Features with no features set
18255 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
18258 * Creates a Features with the bits set which are known by the implementation
18260 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
18263 * Returns whether the `payment_secret` feature is supported.
18265 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
18268 * Returns whether the `payment_secret` feature is supported.
18270 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
18273 * Returns whether the `payment_secret` feature is supported.
18275 MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
18278 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
18280 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
18283 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
18285 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
18288 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
18290 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
18293 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
18295 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
18298 * Read a InitFeatures from a byte array, created by InitFeatures_write
18300 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
18303 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
18305 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
18308 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
18310 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
18313 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
18315 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
18318 * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
18320 void ShutdownScript_free(struct LDKShutdownScript this_obj);
18323 * Creates a copy of the ShutdownScript
18325 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
18328 * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
18330 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
18333 * The script that did not meet the requirements from [BOLT #2].
18335 * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md
18337 struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
18340 * The script that did not meet the requirements from [BOLT #2].
18342 * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md
18344 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
18347 * Constructs a new InvalidShutdownScript given each field
18349 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
18352 * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
18354 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
18357 * Read a ShutdownScript from a byte array, created by ShutdownScript_write
18359 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
18362 * Generates a P2PKH script pubkey from the given [`PubkeyHash`].
18364 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2pkh(const uint8_t (*pubkey_hash)[20]);
18367 * Generates a P2SH script pubkey from the given [`ScriptHash`].
18369 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2sh(const uint8_t (*script_hash)[20]);
18372 * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
18374 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
18377 * Generates a P2WSH script pubkey from the given [`WScriptHash`].
18379 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
18382 * Generates a witness script pubkey from the given segwit version and program.
18384 * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
18385 * [`ShutdownScript::new_p2wsh`] instead.
18389 * This function may return an error if `program` is invalid for the segwit `version`.
18391 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(uint8_t version, struct LDKu8slice program);
18394 * Converts the shutdown script into the underlying [`Script`].
18396 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
18399 * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
18401 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18403 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
18406 * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
18408 * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
18410 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
18413 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
18415 void RouteHop_free(struct LDKRouteHop this_obj);
18418 * The node_id of the node at this hop.
18420 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
18423 * The node_id of the node at this hop.
18425 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
18428 * The node_announcement features of the node at this hop. For the last hop, these may be
18429 * amended to match the features present in the invoice this node generated.
18431 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
18434 * The node_announcement features of the node at this hop. For the last hop, these may be
18435 * amended to match the features present in the invoice this node generated.
18437 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
18440 * The channel that should be used from the previous hop to reach this node.
18442 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
18445 * The channel that should be used from the previous hop to reach this node.
18447 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
18450 * The channel_announcement features of the channel that should be used from the previous hop
18451 * to reach this node.
18453 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
18456 * The channel_announcement features of the channel that should be used from the previous hop
18457 * to reach this node.
18459 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
18462 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
18463 * For the last hop, this should be the full value of the payment (might be more than
18464 * requested if we had to match htlc_minimum_msat).
18466 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
18469 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
18470 * For the last hop, this should be the full value of the payment (might be more than
18471 * requested if we had to match htlc_minimum_msat).
18473 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
18476 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
18477 * expected at the destination, in excess of the current block height.
18479 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
18482 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
18483 * expected at the destination, in excess of the current block height.
18485 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
18488 * Constructs a new RouteHop given each field
18490 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);
18493 * Creates a copy of the RouteHop
18495 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
18498 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
18500 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
18503 * Read a RouteHop from a byte array, created by RouteHop_write
18505 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
18508 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
18510 void Route_free(struct LDKRoute this_obj);
18513 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
18514 * last RouteHop in each path must be the same.
18515 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
18516 * destination. Thus, this must always be at least length one. While the maximum length of any
18517 * given path is variable, keeping the length of any path to less than 20 should currently
18518 * ensure it is viable.
18520 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
18523 * Constructs a new Route given each field
18525 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
18528 * Creates a copy of the Route
18530 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
18533 * Serialize the Route object into a byte array which can be read by Route_read
18535 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
18538 * Read a Route from a byte array, created by Route_write
18540 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
18543 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
18545 void RouteHint_free(struct LDKRouteHint this_obj);
18548 * Checks if two RouteHints contain equal inner contents.
18549 * This ignores pointers and is_owned flags and looks at the values in fields.
18550 * Two objects with NULL inner values will be considered "equal" here.
18552 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
18555 * Creates a copy of the RouteHint
18557 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
18560 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
18562 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
18565 * The node_id of the non-target end of the route
18567 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
18570 * The node_id of the non-target end of the route
18572 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
18575 * The short_channel_id of this channel
18577 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
18580 * The short_channel_id of this channel
18582 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
18585 * The fees which must be paid to use this channel
18587 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
18590 * The fees which must be paid to use this channel
18592 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
18595 * The difference in CLTV values between this node and the next node.
18597 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
18600 * The difference in CLTV values between this node and the next node.
18602 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
18605 * The minimum value, in msat, which must be relayed to the next hop.
18607 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
18610 * The minimum value, in msat, which must be relayed to the next hop.
18612 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
18615 * The maximum value in msat available for routing with a single HTLC.
18617 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
18620 * The maximum value in msat available for routing with a single HTLC.
18622 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
18625 * Constructs a new RouteHintHop given each field
18627 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);
18630 * Checks if two RouteHintHops contain equal inner contents.
18631 * This ignores pointers and is_owned flags and looks at the values in fields.
18632 * Two objects with NULL inner values will be considered "equal" here.
18634 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
18637 * Creates a copy of the RouteHintHop
18639 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
18642 * Gets a keysend route from us (payer) to the given target node (payee). This is needed because
18643 * keysend payments do not have an invoice from which to pull the payee's supported features, which
18644 * makes it tricky to otherwise supply the `payee_features` parameter of `get_route`.
18646 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
18648 struct LDKCResult_RouteLightningErrorZ get_keysend_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
18651 * Gets a route from us (payer) to the given target node (payee).
18653 * If the payee provided features in their invoice, they should be provided via payee_features.
18654 * Without this, MPP will only be used if the payee's features are available in the network graph.
18656 * Private routing paths between a public node and the target may be included in `last_hops`.
18657 * Currently, only the last hop in each path is considered.
18659 * If some channels aren't announced, it may be useful to fill in a first_hops with the
18660 * results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
18661 * view of our local channels (from net_graph_msg_handler) will be ignored, and only those
18662 * in first_hops will be used.
18664 * Panics if first_hops contains channels without short_channel_ids
18665 * (ChannelManager::list_usable_channels will never include such channels).
18667 * The fees on channels from us to next-hops are ignored (as they are assumed to all be
18668 * equal), however the enabled/disabled bit on such channels as well as the
18669 * htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
18671 * Note that payee_features (or a relevant inner pointer) may be NULL or all-0s to represent None
18672 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
18674 struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKInvoiceFeatures payee_features, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
18677 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
18679 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
18682 * Creates a copy of the NetworkGraph
18684 struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
18687 * Frees any resources used by the LockedNetworkGraph, if is_owned is set and inner is non-NULL.
18689 void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj);
18692 * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
18694 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
18697 * Creates a new tracker of the actual state of the network of channels and nodes,
18698 * assuming a fresh network graph.
18699 * Chain monitor is used to make sure announced channels exist on-chain,
18700 * channel data is correct, and that the announcement is signed with
18701 * channel owners' keys.
18703 * Note that chain_access (or a relevant inner pointer) may be NULL or all-0s to represent None
18705 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger);
18708 * Creates a new tracker of the actual state of the network of channels and nodes,
18709 * assuming an existing Network Graph.
18711 * Note that chain_access (or a relevant inner pointer) may be NULL or all-0s to represent None
18713 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph);
18716 * Adds a provider used to check new announcements. Does not affect
18717 * existing announcements unless they are updated.
18718 * Add, update or remove the provider would replace the current one.
18720 * Note that chain_access (or a relevant inner pointer) may be NULL or all-0s to represent None
18722 void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKAccess *chain_access);
18725 * Take a read lock on the network_graph and return it in the C-bindings
18726 * newtype helper. This is likely only useful when called via the C
18727 * bindings as you can call `self.network_graph.read().unwrap()` in Rust
18730 MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
18733 * Get a reference to the NetworkGraph which this read-lock contains.
18735 MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg);
18738 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
18739 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
18741 struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
18744 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
18745 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
18747 struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
18750 * Frees any resources used by the DirectionalChannelInfo, if is_owned is set and inner is non-NULL.
18752 void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_obj);
18755 * When the last update to the channel direction was issued.
18756 * Value is opaque, as set in the announcement.
18758 uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
18761 * When the last update to the channel direction was issued.
18762 * Value is opaque, as set in the announcement.
18764 void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val);
18767 * Whether the channel can be currently used for payments (in this one direction).
18769 bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
18772 * Whether the channel can be currently used for payments (in this one direction).
18774 void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, bool val);
18777 * The difference in CLTV values that you must have when routing through this channel.
18779 uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
18782 * The difference in CLTV values that you must have when routing through this channel.
18784 void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint16_t val);
18787 * The minimum value, which must be relayed to the next hop via the channel
18789 uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
18792 * The minimum value, which must be relayed to the next hop via the channel
18794 void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val);
18797 * The maximum value which may be relayed to the next hop via the channel.
18799 struct LDKCOption_u64Z DirectionalChannelInfo_get_htlc_maximum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
18802 * The maximum value which may be relayed to the next hop via the channel.
18804 void DirectionalChannelInfo_set_htlc_maximum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
18807 * Fees charged when the channel is used for routing
18809 struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
18812 * Fees charged when the channel is used for routing
18814 void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
18817 * Most recent update for the channel received from the network
18818 * Mostly redundant with the data we store in fields explicitly.
18819 * Everything else is useful only for sending out for initial routing sync.
18820 * Not stored if contains excess data to prevent DoS.
18822 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18824 struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
18827 * Most recent update for the channel received from the network
18828 * Mostly redundant with the data we store in fields explicitly.
18829 * Everything else is useful only for sending out for initial routing sync.
18830 * Not stored if contains excess data to prevent DoS.
18832 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
18834 void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
18837 * Constructs a new DirectionalChannelInfo given each field
18839 MUST_USE_RES struct LDKDirectionalChannelInfo DirectionalChannelInfo_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);
18842 * Creates a copy of the DirectionalChannelInfo
18844 struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig);
18847 * Serialize the DirectionalChannelInfo object into a byte array which can be read by DirectionalChannelInfo_read
18849 struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj);
18852 * Read a DirectionalChannelInfo from a byte array, created by DirectionalChannelInfo_write
18854 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser);
18857 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
18859 void ChannelInfo_free(struct LDKChannelInfo this_obj);
18862 * Protocol features of a channel communicated during its announcement
18864 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
18867 * Protocol features of a channel communicated during its announcement
18869 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
18872 * Source node of the first direction of a channel
18874 struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
18877 * Source node of the first direction of a channel
18879 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
18882 * Details about the first direction of a channel
18884 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18886 struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
18889 * Details about the first direction of a channel
18891 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
18893 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
18896 * Source node of the second direction of a channel
18898 struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
18901 * Source node of the second direction of a channel
18903 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
18906 * Details about the second direction of a channel
18908 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18910 struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
18913 * Details about the second direction of a channel
18915 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
18917 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
18920 * The channel capacity as seen on-chain, if chain lookup is available.
18922 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
18925 * The channel capacity as seen on-chain, if chain lookup is available.
18927 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
18930 * An initial announcement of the channel
18931 * Mostly redundant with the data we store in fields explicitly.
18932 * Everything else is useful only for sending out for initial routing sync.
18933 * Not stored if contains excess data to prevent DoS.
18935 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18937 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
18940 * An initial announcement of the channel
18941 * Mostly redundant with the data we store in fields explicitly.
18942 * Everything else is useful only for sending out for initial routing sync.
18943 * Not stored if contains excess data to prevent DoS.
18945 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
18947 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
18950 * Constructs a new ChannelInfo given each field
18952 MUST_USE_RES struct LDKChannelInfo ChannelInfo_new(struct LDKChannelFeatures features_arg, struct LDKPublicKey node_one_arg, struct LDKDirectionalChannelInfo one_to_two_arg, struct LDKPublicKey node_two_arg, struct LDKDirectionalChannelInfo two_to_one_arg, struct LDKCOption_u64Z capacity_sats_arg, struct LDKChannelAnnouncement announcement_message_arg);
18955 * Creates a copy of the ChannelInfo
18957 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
18960 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
18962 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
18965 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
18967 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
18970 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
18972 void RoutingFees_free(struct LDKRoutingFees this_obj);
18975 * Flat routing fee in satoshis
18977 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
18980 * Flat routing fee in satoshis
18982 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
18985 * Liquidity-based routing fee in millionths of a routed amount.
18986 * In other words, 10000 is 1%.
18988 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
18991 * Liquidity-based routing fee in millionths of a routed amount.
18992 * In other words, 10000 is 1%.
18994 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
18997 * Constructs a new RoutingFees given each field
18999 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
19002 * Checks if two RoutingFeess contain equal inner contents.
19003 * This ignores pointers and is_owned flags and looks at the values in fields.
19004 * Two objects with NULL inner values will be considered "equal" here.
19006 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
19009 * Creates a copy of the RoutingFees
19011 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
19014 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
19016 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
19019 * Read a RoutingFees from a byte array, created by RoutingFees_write
19021 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
19024 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
19026 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
19029 * Protocol features the node announced support for
19031 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
19034 * Protocol features the node announced support for
19036 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
19039 * When the last known update to the node state was issued.
19040 * Value is opaque, as set in the announcement.
19042 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
19045 * When the last known update to the node state was issued.
19046 * Value is opaque, as set in the announcement.
19048 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
19051 * Color assigned to the node
19053 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
19056 * Color assigned to the node
19058 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
19061 * Moniker assigned to the node.
19062 * May be invalid or malicious (eg control chars),
19063 * should not be exposed to the user.
19065 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
19068 * Moniker assigned to the node.
19069 * May be invalid or malicious (eg control chars),
19070 * should not be exposed to the user.
19072 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19075 * Internet-level addresses via which one can connect to the node
19077 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
19080 * An initial announcement of the node
19081 * Mostly redundant with the data we store in fields explicitly.
19082 * Everything else is useful only for sending out for initial routing sync.
19083 * Not stored if contains excess data to prevent DoS.
19085 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19087 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
19090 * An initial announcement of the node
19091 * Mostly redundant with the data we store in fields explicitly.
19092 * Everything else is useful only for sending out for initial routing sync.
19093 * Not stored if contains excess data to prevent DoS.
19095 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
19097 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
19100 * Constructs a new NodeAnnouncementInfo given each field
19102 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);
19105 * Creates a copy of the NodeAnnouncementInfo
19107 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
19110 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
19112 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
19115 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
19117 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
19120 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
19122 void NodeInfo_free(struct LDKNodeInfo this_obj);
19125 * All valid channels a node has announced
19127 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
19130 * Lowest fees enabling routing via any of the enabled, known channels to a node.
19131 * The two fields (flat and proportional fee) are independent,
19132 * meaning they don't have to refer to the same channel.
19134 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19136 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
19139 * Lowest fees enabling routing via any of the enabled, known channels to a node.
19140 * The two fields (flat and proportional fee) are independent,
19141 * meaning they don't have to refer to the same channel.
19143 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
19145 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
19148 * More information about a node from node_announcement.
19149 * Optional because we store a Node entry after learning about it from
19150 * a channel announcement, but before receiving a node announcement.
19152 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19154 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
19157 * More information about a node from node_announcement.
19158 * Optional because we store a Node entry after learning about it from
19159 * a channel announcement, but before receiving a node announcement.
19161 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
19163 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
19166 * Constructs a new NodeInfo given each field
19168 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
19171 * Creates a copy of the NodeInfo
19173 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
19176 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
19178 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
19181 * Read a NodeInfo from a byte array, created by NodeInfo_write
19183 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
19186 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
19188 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
19191 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
19193 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
19196 * Creates a new, empty, network graph.
19198 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
19201 * For an already known node (from channel announcements), update its stored properties from a
19202 * given node announcement.
19204 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
19205 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
19206 * routing messages from a source using a protocol other than the lightning P2P protocol.
19208 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
19211 * For an already known node (from channel announcements), update its stored properties from a
19212 * given node announcement without verifying the associated signatures. Because we aren't
19213 * given the associated signatures here we cannot relay the node announcement to any of our
19216 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
19219 * Store or update channel info from a channel announcement.
19221 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
19222 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
19223 * routing messages from a source using a protocol other than the lightning P2P protocol.
19225 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
19226 * the corresponding UTXO exists on chain and is correctly-formatted.
19228 * Note that chain_access (or a relevant inner pointer) may be NULL or all-0s to represent None
19230 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg, struct LDKAccess *chain_access);
19233 * Store or update channel info from a channel announcement without verifying the associated
19234 * signatures. Because we aren't given the associated signatures here we cannot relay the
19235 * channel announcement to any of our peers.
19237 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
19238 * the corresponding UTXO exists on chain and is correctly-formatted.
19240 * Note that chain_access (or a relevant inner pointer) may be NULL or all-0s to represent None
19242 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg, struct LDKAccess *chain_access);
19245 * Close a channel if a corresponding HTLC fail was sent.
19246 * If permanent, removes a channel from the local storage.
19247 * May cause the removal of nodes too, if this was their last channel.
19248 * If not permanent, makes channels unavailable for routing.
19250 void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
19253 * For an already known (from announcement) channel, update info about one of the directions
19256 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
19257 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
19258 * routing messages from a source using a protocol other than the lightning P2P protocol.
19260 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
19263 * For an already known (from announcement) channel, update info about one of the directions
19264 * of the channel without verifying the associated signatures. Because we aren't given the
19265 * associated signatures here we cannot relay the channel update to any of our peers.
19267 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
19270 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
19272 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
19275 * Initialize a new FilesystemPersister and set the path to the individual channels'
19278 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
19281 * Get the directory which was provided when this persister was initialized.
19283 MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
19286 * Writes the provided `ChannelManager` to the path provided at `FilesystemPersister`
19287 * initialization, within a file called \"manager\".
19289 MUST_USE_RES struct LDKCResult_NoneErrorZ FilesystemPersister_persist_manager(struct LDKStr data_dir, const struct LDKChannelManager *NONNULL_PTR manager);
19292 * Read `ChannelMonitor`s from disk.
19294 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
19297 * Constructs a new Persist which calls the relevant methods on this_arg.
19298 * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
19300 struct LDKPersist FilesystemPersister_as_Persist(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
19303 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
19305 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
19308 * Calls the free function if one is set
19310 void ChannelManagerPersister_free(struct LDKChannelManagerPersister this_ptr);
19313 * Start a background thread that takes care of responsibilities enumerated in the [top-level
19316 * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
19317 * `persist_manager` returns an error. In case of an error, the error is retrieved by calling
19318 * either [`join`] or [`stop`].
19320 * Typically, users should either implement [`ChannelManagerPersister`] to never return an
19321 * error or call [`join`] and handle any error that may arise. For the latter case, the
19322 * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
19324 * `persist_manager` is responsible for writing out the [`ChannelManager`] to disk, and/or
19325 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
19326 * [`ChannelManager`]. See [`FilesystemPersister::persist_manager`] for Rust-Lightning's
19327 * provided implementation.
19329 * [top-level documentation]: Self
19330 * [`join`]: Self::join
19331 * [`stop`]: Self::stop
19332 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
19333 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
19334 * [`FilesystemPersister::persist_manager`]: lightning_persister::FilesystemPersister::persist_manager
19336 MUST_USE_RES struct LDKBackgroundProcessor BackgroundProcessor_start(struct LDKChannelManagerPersister persister, struct LDKEventHandler event_handler, const struct LDKChainMonitor *NONNULL_PTR chain_monitor, const struct LDKChannelManager *NONNULL_PTR channel_manager, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger);
19339 * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
19340 * [`ChannelManager`].
19344 * This function panics if the background thread has panicked such as while persisting or
19347 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
19349 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
19352 * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
19353 * [`ChannelManager`].
19357 * This function panics if the background thread has panicked such as while persisting or
19360 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
19362 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
19365 * **Call this function on startup to ensure that all assumptions about the platform are valid.**
19367 * Unfortunately we have to make assumptions about the upper bounds of the `SystemTime` type on
19368 * your platform which we can't fully verify at compile time and which isn't part of it's contract.
19369 * To our best knowledge our assumptions hold for all platforms officially supported by rust, but
19370 * since this check is fast we recommend to do it anyway.
19372 * If this function fails this is considered a bug. Please open an issue describing your
19373 * platform and stating your current system time.
19376 * If the check fails this function panics. By calling this function on startup you ensure that
19377 * this wont happen at an arbitrary later point in time.
19379 void check_platform(void);
19382 * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
19384 void Invoice_free(struct LDKInvoice this_obj);
19387 * Checks if two Invoices contain equal inner contents.
19388 * This ignores pointers and is_owned flags and looks at the values in fields.
19389 * Two objects with NULL inner values will be considered "equal" here.
19391 bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
19394 * Creates a copy of the Invoice
19396 struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
19399 * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
19401 void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
19404 * Checks if two SignedRawInvoices contain equal inner contents.
19405 * This ignores pointers and is_owned flags and looks at the values in fields.
19406 * Two objects with NULL inner values will be considered "equal" here.
19408 bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b);
19411 * Creates a copy of the SignedRawInvoice
19413 struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
19416 * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
19418 void RawInvoice_free(struct LDKRawInvoice this_obj);
19423 struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
19428 void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
19431 * Checks if two RawInvoices contain equal inner contents.
19432 * This ignores pointers and is_owned flags and looks at the values in fields.
19433 * Two objects with NULL inner values will be considered "equal" here.
19435 bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b);
19438 * Creates a copy of the RawInvoice
19440 struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
19443 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
19445 void RawDataPart_free(struct LDKRawDataPart this_obj);
19448 * generation time of the invoice
19450 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
19453 * generation time of the invoice
19455 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
19458 * Checks if two RawDataParts contain equal inner contents.
19459 * This ignores pointers and is_owned flags and looks at the values in fields.
19460 * Two objects with NULL inner values will be considered "equal" here.
19462 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
19465 * Creates a copy of the RawDataPart
19467 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
19470 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
19472 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
19475 * Checks if two PositiveTimestamps contain equal inner contents.
19476 * This ignores pointers and is_owned flags and looks at the values in fields.
19477 * Two objects with NULL inner values will be considered "equal" here.
19479 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
19482 * Creates a copy of the PositiveTimestamp
19484 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
19487 * Creates a copy of the SiPrefix
19489 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
19492 * Utility method to constructs a new Milli-variant SiPrefix
19494 enum LDKSiPrefix SiPrefix_milli(void);
19497 * Utility method to constructs a new Micro-variant SiPrefix
19499 enum LDKSiPrefix SiPrefix_micro(void);
19502 * Utility method to constructs a new Nano-variant SiPrefix
19504 enum LDKSiPrefix SiPrefix_nano(void);
19507 * Utility method to constructs a new Pico-variant SiPrefix
19509 enum LDKSiPrefix SiPrefix_pico(void);
19512 * Checks if two SiPrefixs contain equal inner contents.
19513 * This ignores pointers and is_owned flags and looks at the values in fields.
19515 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
19518 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
19519 * This is effectively 10^12 * the prefix multiplier
19521 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
19524 * Creates a copy of the Currency
19526 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
19529 * Utility method to constructs a new Bitcoin-variant Currency
19531 enum LDKCurrency Currency_bitcoin(void);
19534 * Utility method to constructs a new BitcoinTestnet-variant Currency
19536 enum LDKCurrency Currency_bitcoin_testnet(void);
19539 * Utility method to constructs a new Regtest-variant Currency
19541 enum LDKCurrency Currency_regtest(void);
19544 * Utility method to constructs a new Simnet-variant Currency
19546 enum LDKCurrency Currency_simnet(void);
19549 * Utility method to constructs a new Signet-variant Currency
19551 enum LDKCurrency Currency_signet(void);
19554 * Checks if two Currencys contain equal inner contents.
19555 * This ignores pointers and is_owned flags and looks at the values in fields.
19557 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
19560 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
19562 void Sha256_free(struct LDKSha256 this_obj);
19565 * Checks if two Sha256s contain equal inner contents.
19566 * This ignores pointers and is_owned flags and looks at the values in fields.
19567 * Two objects with NULL inner values will be considered "equal" here.
19569 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
19572 * Creates a copy of the Sha256
19574 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
19577 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
19579 void Description_free(struct LDKDescription this_obj);
19582 * Checks if two Descriptions contain equal inner contents.
19583 * This ignores pointers and is_owned flags and looks at the values in fields.
19584 * Two objects with NULL inner values will be considered "equal" here.
19586 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
19589 * Creates a copy of the Description
19591 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
19594 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
19596 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
19599 * Checks if two PayeePubKeys contain equal inner contents.
19600 * This ignores pointers and is_owned flags and looks at the values in fields.
19601 * Two objects with NULL inner values will be considered "equal" here.
19603 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
19606 * Creates a copy of the PayeePubKey
19608 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
19611 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
19613 void ExpiryTime_free(struct LDKExpiryTime this_obj);
19616 * Checks if two ExpiryTimes contain equal inner contents.
19617 * This ignores pointers and is_owned flags and looks at the values in fields.
19618 * Two objects with NULL inner values will be considered "equal" here.
19620 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
19623 * Creates a copy of the ExpiryTime
19625 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
19628 * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
19630 void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
19633 * Checks if two MinFinalCltvExpirys contain equal inner contents.
19634 * This ignores pointers and is_owned flags and looks at the values in fields.
19635 * Two objects with NULL inner values will be considered "equal" here.
19637 bool MinFinalCltvExpiry_eq(const struct LDKMinFinalCltvExpiry *NONNULL_PTR a, const struct LDKMinFinalCltvExpiry *NONNULL_PTR b);
19640 * Creates a copy of the MinFinalCltvExpiry
19642 struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
19645 * Frees any resources used by the Fallback
19647 void Fallback_free(struct LDKFallback this_ptr);
19650 * Creates a copy of the Fallback
19652 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
19655 * Utility method to constructs a new SegWitProgram-variant Fallback
19657 struct LDKFallback Fallback_seg_wit_program(struct LDKu5 version, struct LDKCVec_u8Z program);
19660 * Utility method to constructs a new PubKeyHash-variant Fallback
19662 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
19665 * Utility method to constructs a new ScriptHash-variant Fallback
19667 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
19670 * Checks if two Fallbacks contain equal inner contents.
19671 * This ignores pointers and is_owned flags and looks at the values in fields.
19673 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
19676 * Frees any resources used by the InvoiceSignature, if is_owned is set and inner is non-NULL.
19678 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
19681 * Checks if two InvoiceSignatures contain equal inner contents.
19682 * This ignores pointers and is_owned flags and looks at the values in fields.
19683 * Two objects with NULL inner values will be considered "equal" here.
19685 bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b);
19688 * Creates a copy of the InvoiceSignature
19690 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
19693 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
19695 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
19698 * Checks if two PrivateRoutes contain equal inner contents.
19699 * This ignores pointers and is_owned flags and looks at the values in fields.
19700 * Two objects with NULL inner values will be considered "equal" here.
19702 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
19705 * Creates a copy of the PrivateRoute
19707 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
19710 * Disassembles the `SignedRawInvoice` into its three parts:
19712 * 2. hash of the raw invoice
19715 MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg);
19718 * The `RawInvoice` which was signed.
19720 MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
19723 * The hash of the `RawInvoice` that was signed.
19725 MUST_USE_RES const uint8_t (*SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32];
19728 * InvoiceSignature for the invoice.
19730 MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
19733 * Recovers the public key used for signing the invoice from the recoverable signature.
19735 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
19738 * Checks if the signature is valid for the included payee public key or if none exists if it's
19739 * valid for the recovered signature (which should always be true?).
19741 MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
19744 * Calculate the hash of the encoded `RawInvoice`
19746 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19750 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19752 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19756 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19758 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19762 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19764 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19768 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19770 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19774 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19776 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19780 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19782 MUST_USE_RES struct LDKMinFinalCltvExpiry RawInvoice_min_final_cltv_expiry(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19786 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19788 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19792 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19794 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19796 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawInvoice_private_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19798 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19800 MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg);
19803 * Create a new `PositiveTimestamp` from a unix timestamp in the Range
19804 * `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a
19805 * `CreationError::TimestampOutOfBounds`.
19807 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
19810 * Create a new `PositiveTimestamp` from a `SystemTime` with a corresponding unix timestamp in
19811 * the Range `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a
19812 * `CreationError::TimestampOutOfBounds`.
19814 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
19817 * Returns the UNIX timestamp representing the stored time
19819 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
19822 * Returns a reference to the internal `SystemTime` time representation
19824 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
19827 * Transform the `Invoice` into it's unchecked version
19829 MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg);
19832 * Check that the invoice is signed correctly and that key recovery works
19834 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
19837 * Constructs an `Invoice` from a `SignedRawInvoice` by checking all its invariants.
19839 * use lightning_invoice::*;
19841 * let invoice = \"lnbc1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdp\\
19842 * \tl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq8rkx3yf5tcsyz3d7\\
19843 * \t3gafnh3cax9rn449d9p5uxz9ezhhypd0elx87sjle52x86fux2ypatgddc6k63n7erqz25le42c4u4ec\\
19844 * \tky03ylcqca784w\";
19846 * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
19848 * assert!(Invoice::from_signed(signed).is_ok());
19851 MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice);
19854 * Returns the `Invoice`'s timestamp (should equal it's creation time)
19856 MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg);
19859 * Returns the hash to which we will receive the preimage on completion of the payment
19861 MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
19864 * Get the payee's public key if one was included in the invoice
19866 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19868 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
19871 * Get the payment secret if one was included in the invoice
19873 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19875 MUST_USE_RES struct LDKThirtyTwoBytes Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg);
19878 * Get the invoice features if they were included in the invoice
19880 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19882 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
19885 * Recover the payee's public key (only to be used if none was included in the invoice)
19887 MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
19890 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
19892 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
19895 * Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
19896 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`].
19898 MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
19901 * Returns a list of all routes included in the invoice
19903 MUST_USE_RES struct LDKCVec_PrivateRouteZ Invoice_private_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
19906 * Returns a list of all routes included in the invoice as the underlying hints
19908 MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_route_hints(const struct LDKInvoice *NONNULL_PTR this_arg);
19911 * Returns the currency for which the invoice was issued
19913 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
19916 * Returns the amount if specified in the invoice as pico <currency>.
19918 MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_pico_btc(const struct LDKInvoice *NONNULL_PTR this_arg);
19921 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
19922 * returns `CreationError::DescriptionTooLong` otherwise
19924 * Please note that single characters may use more than one byte due to UTF8 encoding.
19926 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
19929 * Returns the underlying description `String`
19931 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
19934 * Construct an `ExpiryTime` from seconds. If there exists a `PositiveTimestamp` which would
19935 * overflow on adding the `EpiryTime` to it then this function will return a
19936 * `CreationError::ExpiryTimeOutOfBounds`.
19938 MUST_USE_RES struct LDKCResult_ExpiryTimeCreationErrorZ ExpiryTime_from_seconds(uint64_t seconds);
19941 * Construct an `ExpiryTime` from a `Duration`. If there exists a `PositiveTimestamp` which
19942 * would overflow on adding the `EpiryTime` to it then this function will return a
19943 * `CreationError::ExpiryTimeOutOfBounds`.
19945 MUST_USE_RES struct LDKCResult_ExpiryTimeCreationErrorZ ExpiryTime_from_duration(uint64_t duration);
19948 * Returns the expiry time in seconds
19950 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
19953 * Returns a reference to the underlying `Duration` (=expiry time)
19955 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
19958 * Creates a new (partial) route from a list of hops
19960 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
19963 * Returns the underlying list of hops
19965 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
19968 * Creates a copy of the CreationError
19970 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
19973 * Utility method to constructs a new DescriptionTooLong-variant CreationError
19975 enum LDKCreationError CreationError_description_too_long(void);
19978 * Utility method to constructs a new RouteTooLong-variant CreationError
19980 enum LDKCreationError CreationError_route_too_long(void);
19983 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
19985 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
19988 * Utility method to constructs a new ExpiryTimeOutOfBounds-variant CreationError
19990 enum LDKCreationError CreationError_expiry_time_out_of_bounds(void);
19993 * Checks if two CreationErrors contain equal inner contents.
19994 * This ignores pointers and is_owned flags and looks at the values in fields.
19996 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
19999 * Get the string representation of a CreationError object
20001 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
20004 * Creates a copy of the SemanticError
20006 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
20009 * Utility method to constructs a new NoPaymentHash-variant SemanticError
20011 enum LDKSemanticError SemanticError_no_payment_hash(void);
20014 * Utility method to constructs a new MultiplePaymentHashes-variant SemanticError
20016 enum LDKSemanticError SemanticError_multiple_payment_hashes(void);
20019 * Utility method to constructs a new NoDescription-variant SemanticError
20021 enum LDKSemanticError SemanticError_no_description(void);
20024 * Utility method to constructs a new MultipleDescriptions-variant SemanticError
20026 enum LDKSemanticError SemanticError_multiple_descriptions(void);
20029 * Utility method to constructs a new MultiplePaymentSecrets-variant SemanticError
20031 enum LDKSemanticError SemanticError_multiple_payment_secrets(void);
20034 * Utility method to constructs a new InvalidFeatures-variant SemanticError
20036 enum LDKSemanticError SemanticError_invalid_features(void);
20039 * Utility method to constructs a new InvalidRecoveryId-variant SemanticError
20041 enum LDKSemanticError SemanticError_invalid_recovery_id(void);
20044 * Utility method to constructs a new InvalidSignature-variant SemanticError
20046 enum LDKSemanticError SemanticError_invalid_signature(void);
20049 * Checks if two SemanticErrors contain equal inner contents.
20050 * This ignores pointers and is_owned flags and looks at the values in fields.
20052 bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b);
20055 * Get the string representation of a SemanticError object
20057 struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
20060 * Frees any resources used by the SignOrCreationError
20062 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
20065 * Creates a copy of the SignOrCreationError
20067 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
20070 * Utility method to constructs a new SignError-variant SignOrCreationError
20072 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
20075 * Utility method to constructs a new CreationError-variant SignOrCreationError
20077 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
20080 * Checks if two SignOrCreationErrors contain equal inner contents.
20081 * This ignores pointers and is_owned flags and looks at the values in fields.
20083 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
20086 * Get the string representation of a SignOrCreationError object
20088 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
20091 * Utility to construct an invoice. Generally, unless you want to do something like a custom
20092 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
20093 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
20094 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
20095 * that the payment secret is valid when the invoice is paid.
20097 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);
20100 * Read a SiPrefix object from a string
20102 struct LDKCResult_SiPrefixNoneZ SiPrefix_from_str(struct LDKStr s);
20105 * Read a Invoice object from a string
20107 struct LDKCResult_InvoiceNoneZ Invoice_from_str(struct LDKStr s);
20110 * Read a SignedRawInvoice object from a string
20112 struct LDKCResult_SignedRawInvoiceNoneZ SignedRawInvoice_from_str(struct LDKStr s);
20115 * Get the string representation of a Invoice object
20117 struct LDKStr Invoice_to_str(const struct LDKInvoice *NONNULL_PTR o);
20120 * Get the string representation of a SignedRawInvoice object
20122 struct LDKStr SignedRawInvoice_to_str(const struct LDKSignedRawInvoice *NONNULL_PTR o);
20125 * Get the string representation of a Currency object
20127 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
20130 * Get the string representation of a SiPrefix object
20132 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
20134 #endif /* LDK_C_BINDINGS_H */
20136 #include "ldk_ver.h"