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,
167 * Bitcoin simnet/signet
171 * Must be last for serialization purposes
173 LDKCurrency_Sentinel,
177 * Represents an IO Error. Note that some information is lost in the conversion from Rust.
179 typedef enum LDKIOError {
181 LDKIOError_PermissionDenied,
182 LDKIOError_ConnectionRefused,
183 LDKIOError_ConnectionReset,
184 LDKIOError_ConnectionAborted,
185 LDKIOError_NotConnected,
186 LDKIOError_AddrInUse,
187 LDKIOError_AddrNotAvailable,
188 LDKIOError_BrokenPipe,
189 LDKIOError_AlreadyExists,
190 LDKIOError_WouldBlock,
191 LDKIOError_InvalidInput,
192 LDKIOError_InvalidData,
194 LDKIOError_WriteZero,
195 LDKIOError_Interrupted,
197 LDKIOError_UnexpectedEof,
199 * Must be last for serialization purposes
205 * An enum representing the available verbosity levels of the logger.
207 typedef enum LDKLevel {
209 *Designates logger being silent
213 * Designates very serious errors
217 * Designates hazardous situations
221 * Designates useful information
225 * Designates lower priority information
229 * Designates very low priority, often extremely verbose, information
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 recovery id doesn't fit the signature/pub key
334 LDKSemanticError_InvalidRecoveryId,
336 * The invoice's signature is invalid
338 LDKSemanticError_InvalidSignature,
340 * Must be last for serialization purposes
342 LDKSemanticError_Sentinel,
346 * SI prefixes for the human readable part
348 typedef enum LDKSiPrefix {
366 * Must be last for serialization purposes
368 LDKSiPrefix_Sentinel,
372 * A Rust str object, ie a reference to a UTF8-valid string.
373 * This is *not* null-terminated so cannot be used directly as a C string!
375 typedef struct LDKStr {
377 * A pointer to the string's bytes, in UTF8 encoding
379 const uint8_t *chars;
381 * The number of bytes (not characters!) pointed to by `chars`
385 * Whether the data pointed to by `chars` should be freed or not.
391 * A serialized transaction, in (pointer, length) form.
393 * This type optionally owns its own memory, and thus the semantics around access change based on
394 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
395 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
396 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
397 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
398 * you would be invalid.
400 * Note that, while it may change in the future, because transactions on the Rust side are stored
401 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
402 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
403 * `data_is_owned` either set or unset at your discretion.
405 typedef struct LDKTransaction {
407 * The serialized transaction data.
409 * This is non-const for your convenience, an object passed to Rust is never written to.
413 * The length of the serialized transaction
417 * Whether the data pointed to by `data` should be freed or not.
423 * A dynamically-allocated array of u8s of arbitrary size.
424 * This corresponds to std::vector in C++
426 typedef struct LDKCVec_u8Z {
428 * The elements in the array.
429 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
433 * The number of elements pointed to by `data`.
439 * A transaction output including a scriptPubKey and value.
440 * This type *does* own its own memory, so must be free'd appropriately.
442 typedef struct LDKTxOut {
444 * The script_pubkey in this output
446 struct LDKCVec_u8Z script_pubkey;
448 * The value, in satoshis, of this output
456 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
457 * with our counterparty.
459 typedef struct MUST_USE_STRUCT LDKChannelConfig {
461 * A pointer to the opaque Rust object.
462 * Nearly everywhere, inner must be non-null, however in places where
463 * the Rust equivalent takes an Option, it may be set to null to indicate None.
465 LDKnativeChannelConfig *inner;
467 * Indicates that this is the only struct which contains the same pointer.
468 * Rust functions which take ownership of an object provided via an argument require
469 * this to be true and invalidate the object pointed to by inner.
477 * An error in decoding a message or struct.
479 typedef struct MUST_USE_STRUCT LDKDecodeError {
481 * A pointer to the opaque Rust object.
482 * Nearly everywhere, inner must be non-null, however in places where
483 * the Rust equivalent takes an Option, it may be set to null to indicate None.
485 LDKnativeDecodeError *inner;
487 * Indicates that this is the only struct which contains the same pointer.
488 * Rust functions which take ownership of an object provided via an argument require
489 * this to be true and invalidate the object pointed to by inner.
495 * The contents of CResult_ChannelConfigDecodeErrorZ
497 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
499 * A pointer to the contents in the success state.
500 * Reading from this pointer when `result_ok` is not set is undefined.
502 struct LDKChannelConfig *result;
504 * A pointer to the contents in the error state.
505 * Reading from this pointer when `result_ok` is set is undefined.
507 struct LDKDecodeError *err;
508 } LDKCResult_ChannelConfigDecodeErrorZPtr;
511 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
512 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
513 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
515 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
517 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
518 * `err` or `result` depending on the state of `result_ok`.
520 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
522 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
525 } LDKCResult_ChannelConfigDecodeErrorZ;
530 * A reference to a transaction output.
532 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
533 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
535 typedef struct MUST_USE_STRUCT LDKOutPoint {
537 * A pointer to the opaque Rust object.
538 * Nearly everywhere, inner must be non-null, however in places where
539 * the Rust equivalent takes an Option, it may be set to null to indicate None.
541 LDKnativeOutPoint *inner;
543 * Indicates that this is the only struct which contains the same pointer.
544 * Rust functions which take ownership of an object provided via an argument require
545 * this to be true and invalidate the object pointed to by inner.
551 * The contents of CResult_OutPointDecodeErrorZ
553 typedef union LDKCResult_OutPointDecodeErrorZPtr {
555 * A pointer to the contents in the success state.
556 * Reading from this pointer when `result_ok` is not set is undefined.
558 struct LDKOutPoint *result;
560 * A pointer to the contents in the error state.
561 * Reading from this pointer when `result_ok` is set is undefined.
563 struct LDKDecodeError *err;
564 } LDKCResult_OutPointDecodeErrorZPtr;
567 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
568 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
569 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
571 typedef struct LDKCResult_OutPointDecodeErrorZ {
573 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
574 * `err` or `result` depending on the state of `result_ok`.
576 union LDKCResult_OutPointDecodeErrorZPtr contents;
578 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
581 } LDKCResult_OutPointDecodeErrorZ;
584 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
586 typedef struct LDKSecretKey {
588 * The bytes of the secret key
594 * The contents of CResult_SecretKeyErrorZ
596 typedef union LDKCResult_SecretKeyErrorZPtr {
598 * A pointer to the contents in the success state.
599 * Reading from this pointer when `result_ok` is not set is undefined.
601 struct LDKSecretKey *result;
603 * A pointer to the contents in the error state.
604 * Reading from this pointer when `result_ok` is set is undefined.
606 enum LDKSecp256k1Error *err;
607 } LDKCResult_SecretKeyErrorZPtr;
610 * A CResult_SecretKeyErrorZ represents the result of a fallible operation,
611 * containing a crate::c_types::SecretKey on success and a crate::c_types::Secp256k1Error on failure.
612 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
614 typedef struct LDKCResult_SecretKeyErrorZ {
616 * The contents of this CResult_SecretKeyErrorZ, accessible via either
617 * `err` or `result` depending on the state of `result_ok`.
619 union LDKCResult_SecretKeyErrorZPtr contents;
621 * Whether this CResult_SecretKeyErrorZ represents a success state.
624 } LDKCResult_SecretKeyErrorZ;
627 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
629 typedef struct LDKPublicKey {
631 * The bytes of the public key
633 uint8_t compressed_form[33];
637 * The contents of CResult_PublicKeyErrorZ
639 typedef union LDKCResult_PublicKeyErrorZPtr {
641 * A pointer to the contents in the success state.
642 * Reading from this pointer when `result_ok` is not set is undefined.
644 struct LDKPublicKey *result;
646 * A pointer to the contents in the error state.
647 * Reading from this pointer when `result_ok` is set is undefined.
649 enum LDKSecp256k1Error *err;
650 } LDKCResult_PublicKeyErrorZPtr;
653 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
654 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
655 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
657 typedef struct LDKCResult_PublicKeyErrorZ {
659 * The contents of this CResult_PublicKeyErrorZ, accessible via either
660 * `err` or `result` depending on the state of `result_ok`.
662 union LDKCResult_PublicKeyErrorZPtr contents;
664 * Whether this CResult_PublicKeyErrorZ represents a success state.
667 } LDKCResult_PublicKeyErrorZ;
672 * The set of public keys which are used in the creation of one commitment transaction.
673 * These are derived from the channel base keys and per-commitment data.
675 * A broadcaster key is provided from potential broadcaster of the computed transaction.
676 * A countersignatory key is coming from a protocol participant unable to broadcast the
679 * These keys are assumed to be good, either because the code derived them from
680 * channel basepoints via the new function, or they were obtained via
681 * CommitmentTransaction.trust().keys() because we trusted the source of the
682 * pre-calculated keys.
684 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
686 * A pointer to the opaque Rust object.
687 * Nearly everywhere, inner must be non-null, however in places where
688 * the Rust equivalent takes an Option, it may be set to null to indicate None.
690 LDKnativeTxCreationKeys *inner;
692 * Indicates that this is the only struct which contains the same pointer.
693 * Rust functions which take ownership of an object provided via an argument require
694 * this to be true and invalidate the object pointed to by inner.
700 * The contents of CResult_TxCreationKeysDecodeErrorZ
702 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
704 * A pointer to the contents in the success state.
705 * Reading from this pointer when `result_ok` is not set is undefined.
707 struct LDKTxCreationKeys *result;
709 * A pointer to the contents in the error state.
710 * Reading from this pointer when `result_ok` is set is undefined.
712 struct LDKDecodeError *err;
713 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
716 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
717 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
718 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
720 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
722 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
723 * `err` or `result` depending on the state of `result_ok`.
725 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
727 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
730 } LDKCResult_TxCreationKeysDecodeErrorZ;
735 * One counterparty's public keys which do not change over the life of a channel.
737 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
739 * A pointer to the opaque Rust object.
740 * Nearly everywhere, inner must be non-null, however in places where
741 * the Rust equivalent takes an Option, it may be set to null to indicate None.
743 LDKnativeChannelPublicKeys *inner;
745 * Indicates that this is the only struct which contains the same pointer.
746 * Rust functions which take ownership of an object provided via an argument require
747 * this to be true and invalidate the object pointed to by inner.
750 } LDKChannelPublicKeys;
753 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
755 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
757 * A pointer to the contents in the success state.
758 * Reading from this pointer when `result_ok` is not set is undefined.
760 struct LDKChannelPublicKeys *result;
762 * A pointer to the contents in the error state.
763 * Reading from this pointer when `result_ok` is set is undefined.
765 struct LDKDecodeError *err;
766 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
769 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
770 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
771 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
773 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
775 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
776 * `err` or `result` depending on the state of `result_ok`.
778 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
780 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
783 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
786 * The contents of CResult_TxCreationKeysErrorZ
788 typedef union LDKCResult_TxCreationKeysErrorZPtr {
790 * A pointer to the contents in the success state.
791 * Reading from this pointer when `result_ok` is not set is undefined.
793 struct LDKTxCreationKeys *result;
795 * A pointer to the contents in the error state.
796 * Reading from this pointer when `result_ok` is set is undefined.
798 enum LDKSecp256k1Error *err;
799 } LDKCResult_TxCreationKeysErrorZPtr;
802 * A CResult_TxCreationKeysErrorZ represents the result of a fallible operation,
803 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::c_types::Secp256k1Error on failure.
804 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
806 typedef struct LDKCResult_TxCreationKeysErrorZ {
808 * The contents of this CResult_TxCreationKeysErrorZ, accessible via either
809 * `err` or `result` depending on the state of `result_ok`.
811 union LDKCResult_TxCreationKeysErrorZPtr contents;
813 * Whether this CResult_TxCreationKeysErrorZ represents a success state.
816 } LDKCResult_TxCreationKeysErrorZ;
819 * An enum which can either contain a u32 or not
821 typedef enum LDKCOption_u32Z_Tag {
823 * When we're in this state, this COption_u32Z contains a u32
825 LDKCOption_u32Z_Some,
827 * When we're in this state, this COption_u32Z contains nothing
829 LDKCOption_u32Z_None,
831 * Must be last for serialization purposes
833 LDKCOption_u32Z_Sentinel,
834 } LDKCOption_u32Z_Tag;
836 typedef struct LDKCOption_u32Z {
837 LDKCOption_u32Z_Tag tag;
848 * Information about an HTLC as it appears in a commitment transaction
850 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
852 * A pointer to the opaque Rust object.
853 * Nearly everywhere, inner must be non-null, however in places where
854 * the Rust equivalent takes an Option, it may be set to null to indicate None.
856 LDKnativeHTLCOutputInCommitment *inner;
858 * Indicates that this is the only struct which contains the same pointer.
859 * Rust functions which take ownership of an object provided via an argument require
860 * this to be true and invalidate the object pointed to by inner.
863 } LDKHTLCOutputInCommitment;
866 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
868 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
870 * A pointer to the contents in the success state.
871 * Reading from this pointer when `result_ok` is not set is undefined.
873 struct LDKHTLCOutputInCommitment *result;
875 * A pointer to the contents in the error state.
876 * Reading from this pointer when `result_ok` is set is undefined.
878 struct LDKDecodeError *err;
879 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
882 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
883 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
884 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
886 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
888 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
889 * `err` or `result` depending on the state of `result_ok`.
891 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
893 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
896 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
901 * Late-bound per-channel counterparty data used to build transactions.
903 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
905 * A pointer to the opaque Rust object.
906 * Nearly everywhere, inner must be non-null, however in places where
907 * the Rust equivalent takes an Option, it may be set to null to indicate None.
909 LDKnativeCounterpartyChannelTransactionParameters *inner;
911 * Indicates that this is the only struct which contains the same pointer.
912 * Rust functions which take ownership of an object provided via an argument require
913 * this to be true and invalidate the object pointed to by inner.
916 } LDKCounterpartyChannelTransactionParameters;
919 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
921 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
923 * A pointer to the contents in the success state.
924 * Reading from this pointer when `result_ok` is not set is undefined.
926 struct LDKCounterpartyChannelTransactionParameters *result;
928 * A pointer to the contents in the error state.
929 * Reading from this pointer when `result_ok` is set is undefined.
931 struct LDKDecodeError *err;
932 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
935 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
936 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
937 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
939 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
941 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
942 * `err` or `result` depending on the state of `result_ok`.
944 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
946 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
949 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
954 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
955 * The fields are organized by holder/counterparty.
957 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
958 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
960 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
962 * A pointer to the opaque Rust object.
963 * Nearly everywhere, inner must be non-null, however in places where
964 * the Rust equivalent takes an Option, it may be set to null to indicate None.
966 LDKnativeChannelTransactionParameters *inner;
968 * Indicates that this is the only struct which contains the same pointer.
969 * Rust functions which take ownership of an object provided via an argument require
970 * this to be true and invalidate the object pointed to by inner.
973 } LDKChannelTransactionParameters;
976 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
978 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
980 * A pointer to the contents in the success state.
981 * Reading from this pointer when `result_ok` is not set is undefined.
983 struct LDKChannelTransactionParameters *result;
985 * A pointer to the contents in the error state.
986 * Reading from this pointer when `result_ok` is set is undefined.
988 struct LDKDecodeError *err;
989 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
992 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
993 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
994 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
996 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
998 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
999 * `err` or `result` depending on the state of `result_ok`.
1001 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
1003 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
1006 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
1009 * Represents a secp256k1 signature serialized as two 32-byte numbers
1011 typedef struct LDKSignature {
1013 * The bytes of the signature in "compact" form
1015 uint8_t compact_form[64];
1019 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
1020 * This corresponds to std::vector in C++
1022 typedef struct LDKCVec_SignatureZ {
1024 * The elements in the array.
1025 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1027 struct LDKSignature *data;
1029 * The number of elements pointed to by `data`.
1032 } LDKCVec_SignatureZ;
1037 * Information needed to build and sign a holder's commitment transaction.
1039 * The transaction is only signed once we are ready to broadcast.
1041 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
1043 * A pointer to the opaque Rust object.
1044 * Nearly everywhere, inner must be non-null, however in places where
1045 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1047 LDKnativeHolderCommitmentTransaction *inner;
1049 * Indicates that this is the only struct which contains the same pointer.
1050 * Rust functions which take ownership of an object provided via an argument require
1051 * this to be true and invalidate the object pointed to by inner.
1054 } LDKHolderCommitmentTransaction;
1057 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
1059 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
1061 * A pointer to the contents in the success state.
1062 * Reading from this pointer when `result_ok` is not set is undefined.
1064 struct LDKHolderCommitmentTransaction *result;
1066 * A pointer to the contents in the error state.
1067 * Reading from this pointer when `result_ok` is set is undefined.
1069 struct LDKDecodeError *err;
1070 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
1073 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1074 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1075 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1077 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
1079 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
1080 * `err` or `result` depending on the state of `result_ok`.
1082 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
1084 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
1087 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
1092 * A pre-built Bitcoin commitment transaction and its txid.
1094 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
1096 * A pointer to the opaque Rust object.
1097 * Nearly everywhere, inner must be non-null, however in places where
1098 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1100 LDKnativeBuiltCommitmentTransaction *inner;
1102 * Indicates that this is the only struct which contains the same pointer.
1103 * Rust functions which take ownership of an object provided via an argument require
1104 * this to be true and invalidate the object pointed to by inner.
1107 } LDKBuiltCommitmentTransaction;
1110 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
1112 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
1114 * A pointer to the contents in the success state.
1115 * Reading from this pointer when `result_ok` is not set is undefined.
1117 struct LDKBuiltCommitmentTransaction *result;
1119 * A pointer to the contents in the error state.
1120 * Reading from this pointer when `result_ok` is set is undefined.
1122 struct LDKDecodeError *err;
1123 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
1126 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1127 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1128 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1130 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
1132 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
1133 * `err` or `result` depending on the state of `result_ok`.
1135 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
1137 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
1140 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
1145 * This class tracks the per-transaction information needed to build a commitment transaction and to
1146 * actually build it and sign. It is used for holder transactions that we sign only when needed
1147 * and for transactions we sign for the counterparty.
1149 * This class can be used inside a signer implementation to generate a signature given the relevant
1152 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
1154 * A pointer to the opaque Rust object.
1155 * Nearly everywhere, inner must be non-null, however in places where
1156 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1158 LDKnativeCommitmentTransaction *inner;
1160 * Indicates that this is the only struct which contains the same pointer.
1161 * Rust functions which take ownership of an object provided via an argument require
1162 * this to be true and invalidate the object pointed to by inner.
1165 } LDKCommitmentTransaction;
1168 * The contents of CResult_CommitmentTransactionDecodeErrorZ
1170 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
1172 * A pointer to the contents in the success state.
1173 * Reading from this pointer when `result_ok` is not set is undefined.
1175 struct LDKCommitmentTransaction *result;
1177 * A pointer to the contents in the error state.
1178 * Reading from this pointer when `result_ok` is set is undefined.
1180 struct LDKDecodeError *err;
1181 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
1184 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1185 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1186 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1188 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
1190 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
1191 * `err` or `result` depending on the state of `result_ok`.
1193 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
1195 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
1198 } LDKCResult_CommitmentTransactionDecodeErrorZ;
1203 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
1204 * transaction and the transaction creation keys) are trusted.
1206 * See trust() and verify() functions on CommitmentTransaction.
1208 * This structure implements Deref.
1210 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
1212 * A pointer to the opaque Rust object.
1213 * Nearly everywhere, inner must be non-null, however in places where
1214 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1216 LDKnativeTrustedCommitmentTransaction *inner;
1218 * Indicates that this is the only struct which contains the same pointer.
1219 * Rust functions which take ownership of an object provided via an argument require
1220 * this to be true and invalidate the object pointed to by inner.
1223 } LDKTrustedCommitmentTransaction;
1226 * The contents of CResult_TrustedCommitmentTransactionNoneZ
1228 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
1230 * A pointer to the contents in the success state.
1231 * Reading from this pointer when `result_ok` is not set is undefined.
1233 struct LDKTrustedCommitmentTransaction *result;
1235 * Note that this value is always NULL, as there are no contents in the Err variant
1238 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
1241 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
1242 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
1243 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1245 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
1247 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
1248 * `err` or `result` depending on the state of `result_ok`.
1250 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
1252 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
1255 } LDKCResult_TrustedCommitmentTransactionNoneZ;
1258 * The contents of CResult_CVec_SignatureZNoneZ
1260 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
1262 * A pointer to the contents in the success state.
1263 * Reading from this pointer when `result_ok` is not set is undefined.
1265 struct LDKCVec_SignatureZ *result;
1267 * Note that this value is always NULL, as there are no contents in the Err variant
1270 } LDKCResult_CVec_SignatureZNoneZPtr;
1273 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
1274 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
1275 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1277 typedef struct LDKCResult_CVec_SignatureZNoneZ {
1279 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
1280 * `err` or `result` depending on the state of `result_ok`.
1282 union LDKCResult_CVec_SignatureZNoneZPtr contents;
1284 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
1287 } LDKCResult_CVec_SignatureZNoneZ;
1290 * The contents of CResult_SiPrefixNoneZ
1292 typedef union LDKCResult_SiPrefixNoneZPtr {
1294 * A pointer to the contents in the success state.
1295 * Reading from this pointer when `result_ok` is not set is undefined.
1297 enum LDKSiPrefix *result;
1299 * Note that this value is always NULL, as there are no contents in the Err variant
1302 } LDKCResult_SiPrefixNoneZPtr;
1305 * A CResult_SiPrefixNoneZ represents the result of a fallible operation,
1306 * containing a crate::lightning_invoice::SiPrefix on success and a () on failure.
1307 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1309 typedef struct LDKCResult_SiPrefixNoneZ {
1311 * The contents of this CResult_SiPrefixNoneZ, accessible via either
1312 * `err` or `result` depending on the state of `result_ok`.
1314 union LDKCResult_SiPrefixNoneZPtr contents;
1316 * Whether this CResult_SiPrefixNoneZ represents a success state.
1319 } LDKCResult_SiPrefixNoneZ;
1324 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
1326 * There are three ways to construct an `Invoice`:
1327 * 1. using `InvoiceBuilder`
1328 * 2. using `Invoice::from_signed(SignedRawInvoice)`
1329 * 3. using `str::parse::<Invoice>(&str)`
1331 typedef struct MUST_USE_STRUCT LDKInvoice {
1333 * A pointer to the opaque Rust object.
1334 * Nearly everywhere, inner must be non-null, however in places where
1335 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1337 LDKnativeInvoice *inner;
1339 * Indicates that this is the only struct which contains the same pointer.
1340 * Rust functions which take ownership of an object provided via an argument require
1341 * this to be true and invalidate the object pointed to by inner.
1347 * The contents of CResult_InvoiceNoneZ
1349 typedef union LDKCResult_InvoiceNoneZPtr {
1351 * A pointer to the contents in the success state.
1352 * Reading from this pointer when `result_ok` is not set is undefined.
1354 struct LDKInvoice *result;
1356 * Note that this value is always NULL, as there are no contents in the Err variant
1359 } LDKCResult_InvoiceNoneZPtr;
1362 * A CResult_InvoiceNoneZ represents the result of a fallible operation,
1363 * containing a crate::lightning_invoice::Invoice on success and a () on failure.
1364 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1366 typedef struct LDKCResult_InvoiceNoneZ {
1368 * The contents of this CResult_InvoiceNoneZ, accessible via either
1369 * `err` or `result` depending on the state of `result_ok`.
1371 union LDKCResult_InvoiceNoneZPtr contents;
1373 * Whether this CResult_InvoiceNoneZ represents a success state.
1376 } LDKCResult_InvoiceNoneZ;
1381 * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be
1385 * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`.
1387 typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
1389 * A pointer to the opaque Rust object.
1390 * Nearly everywhere, inner must be non-null, however in places where
1391 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1393 LDKnativeSignedRawInvoice *inner;
1395 * Indicates that this is the only struct which contains the same pointer.
1396 * Rust functions which take ownership of an object provided via an argument require
1397 * this to be true and invalidate the object pointed to by inner.
1400 } LDKSignedRawInvoice;
1403 * The contents of CResult_SignedRawInvoiceNoneZ
1405 typedef union LDKCResult_SignedRawInvoiceNoneZPtr {
1407 * A pointer to the contents in the success state.
1408 * Reading from this pointer when `result_ok` is not set is undefined.
1410 struct LDKSignedRawInvoice *result;
1412 * Note that this value is always NULL, as there are no contents in the Err variant
1415 } LDKCResult_SignedRawInvoiceNoneZPtr;
1418 * A CResult_SignedRawInvoiceNoneZ represents the result of a fallible operation,
1419 * containing a crate::lightning_invoice::SignedRawInvoice on success and a () on failure.
1420 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1422 typedef struct LDKCResult_SignedRawInvoiceNoneZ {
1424 * The contents of this CResult_SignedRawInvoiceNoneZ, accessible via either
1425 * `err` or `result` depending on the state of `result_ok`.
1427 union LDKCResult_SignedRawInvoiceNoneZPtr contents;
1429 * Whether this CResult_SignedRawInvoiceNoneZ represents a success state.
1432 } LDKCResult_SignedRawInvoiceNoneZ;
1437 * Represents an syntactically correct Invoice for a payment on the lightning network,
1438 * but without the signature information.
1439 * De- and encoding should not lead to information loss but may lead to different hashes.
1441 * For methods without docs see the corresponding methods in `Invoice`.
1443 typedef struct MUST_USE_STRUCT LDKRawInvoice {
1445 * A pointer to the opaque Rust object.
1446 * Nearly everywhere, inner must be non-null, however in places where
1447 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1449 LDKnativeRawInvoice *inner;
1451 * Indicates that this is the only struct which contains the same pointer.
1452 * Rust functions which take ownership of an object provided via an argument require
1453 * this to be true and invalidate the object pointed to by inner.
1459 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
1460 * look up the corresponding function in rust-lightning's docs.
1462 typedef struct LDKThirtyTwoBytes {
1464 * The thirty-two bytes
1467 } LDKThirtyTwoBytes;
1472 * Recoverable signature
1474 typedef struct MUST_USE_STRUCT LDKInvoiceSignature {
1476 * A pointer to the opaque Rust object.
1477 * Nearly everywhere, inner must be non-null, however in places where
1478 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1480 LDKnativeInvoiceSignature *inner;
1482 * Indicates that this is the only struct which contains the same pointer.
1483 * Rust functions which take ownership of an object provided via an argument require
1484 * this to be true and invalidate the object pointed to by inner.
1487 } LDKInvoiceSignature;
1490 * A tuple of 3 elements. See the individual fields for the types contained.
1492 typedef struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ {
1494 * The element at position 0
1496 struct LDKRawInvoice a;
1498 * The element at position 1
1500 struct LDKThirtyTwoBytes b;
1502 * The element at position 2
1504 struct LDKInvoiceSignature c;
1505 } LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ;
1512 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
1514 * A pointer to the opaque Rust object.
1515 * Nearly everywhere, inner must be non-null, however in places where
1516 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1518 LDKnativePayeePubKey *inner;
1520 * Indicates that this is the only struct which contains the same pointer.
1521 * Rust functions which take ownership of an object provided via an argument require
1522 * this to be true and invalidate the object pointed to by inner.
1528 * The contents of CResult_PayeePubKeyErrorZ
1530 typedef union LDKCResult_PayeePubKeyErrorZPtr {
1532 * A pointer to the contents in the success state.
1533 * Reading from this pointer when `result_ok` is not set is undefined.
1535 struct LDKPayeePubKey *result;
1537 * A pointer to the contents in the error state.
1538 * Reading from this pointer when `result_ok` is set is undefined.
1540 enum LDKSecp256k1Error *err;
1541 } LDKCResult_PayeePubKeyErrorZPtr;
1544 * A CResult_PayeePubKeyErrorZ represents the result of a fallible operation,
1545 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
1546 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1548 typedef struct LDKCResult_PayeePubKeyErrorZ {
1550 * The contents of this CResult_PayeePubKeyErrorZ, accessible via either
1551 * `err` or `result` depending on the state of `result_ok`.
1553 union LDKCResult_PayeePubKeyErrorZPtr contents;
1555 * Whether this CResult_PayeePubKeyErrorZ represents a success state.
1558 } LDKCResult_PayeePubKeyErrorZ;
1563 * Private routing information
1566 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
1569 typedef struct MUST_USE_STRUCT LDKRouteHint {
1571 * A pointer to the opaque Rust object.
1572 * Nearly everywhere, inner must be non-null, however in places where
1573 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1575 LDKnativeRouteHint *inner;
1577 * Indicates that this is the only struct which contains the same pointer.
1578 * Rust functions which take ownership of an object provided via an argument require
1579 * this to be true and invalidate the object pointed to by inner.
1585 * A dynamically-allocated array of crate::lightning_invoice::RouteHints of arbitrary size.
1586 * This corresponds to std::vector in C++
1588 typedef struct LDKCVec_RouteHintZ {
1590 * The elements in the array.
1591 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1593 struct LDKRouteHint *data;
1595 * The number of elements pointed to by `data`.
1598 } LDKCVec_RouteHintZ;
1601 * An enum which can either contain a u64 or not
1603 typedef enum LDKCOption_u64Z_Tag {
1605 * When we're in this state, this COption_u64Z contains a u64
1607 LDKCOption_u64Z_Some,
1609 * When we're in this state, this COption_u64Z contains nothing
1611 LDKCOption_u64Z_None,
1613 * Must be last for serialization purposes
1615 LDKCOption_u64Z_Sentinel,
1616 } LDKCOption_u64Z_Tag;
1618 typedef struct LDKCOption_u64Z {
1619 LDKCOption_u64Z_Tag tag;
1630 * A timestamp that refers to a date after 1 January 1970 which means its representation as UNIX
1631 * timestamp is positive.
1634 * The UNIX timestamp representing the stored time has to be positive and small enough so that
1635 * a `EpiryTime` can be added to it without an overflow.
1637 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
1639 * A pointer to the opaque Rust object.
1640 * Nearly everywhere, inner must be non-null, however in places where
1641 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1643 LDKnativePositiveTimestamp *inner;
1645 * Indicates that this is the only struct which contains the same pointer.
1646 * Rust functions which take ownership of an object provided via an argument require
1647 * this to be true and invalidate the object pointed to by inner.
1650 } LDKPositiveTimestamp;
1653 * The contents of CResult_PositiveTimestampCreationErrorZ
1655 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
1657 * A pointer to the contents in the success state.
1658 * Reading from this pointer when `result_ok` is not set is undefined.
1660 struct LDKPositiveTimestamp *result;
1662 * A pointer to the contents in the error state.
1663 * Reading from this pointer when `result_ok` is set is undefined.
1665 enum LDKCreationError *err;
1666 } LDKCResult_PositiveTimestampCreationErrorZPtr;
1669 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
1670 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
1671 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1673 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
1675 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
1676 * `err` or `result` depending on the state of `result_ok`.
1678 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
1680 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
1683 } LDKCResult_PositiveTimestampCreationErrorZ;
1686 * The contents of CResult_NoneSemanticErrorZ
1688 typedef union LDKCResult_NoneSemanticErrorZPtr {
1690 * Note that this value is always NULL, as there are no contents in the OK variant
1694 * A pointer to the contents in the error state.
1695 * Reading from this pointer when `result_ok` is set is undefined.
1697 enum LDKSemanticError *err;
1698 } LDKCResult_NoneSemanticErrorZPtr;
1701 * A CResult_NoneSemanticErrorZ represents the result of a fallible operation,
1702 * containing a () on success and a crate::lightning_invoice::SemanticError on failure.
1703 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1705 typedef struct LDKCResult_NoneSemanticErrorZ {
1707 * The contents of this CResult_NoneSemanticErrorZ, accessible via either
1708 * `err` or `result` depending on the state of `result_ok`.
1710 union LDKCResult_NoneSemanticErrorZPtr contents;
1712 * Whether this CResult_NoneSemanticErrorZ represents a success state.
1715 } LDKCResult_NoneSemanticErrorZ;
1718 * The contents of CResult_InvoiceSemanticErrorZ
1720 typedef union LDKCResult_InvoiceSemanticErrorZPtr {
1722 * A pointer to the contents in the success state.
1723 * Reading from this pointer when `result_ok` is not set is undefined.
1725 struct LDKInvoice *result;
1727 * A pointer to the contents in the error state.
1728 * Reading from this pointer when `result_ok` is set is undefined.
1730 enum LDKSemanticError *err;
1731 } LDKCResult_InvoiceSemanticErrorZPtr;
1734 * A CResult_InvoiceSemanticErrorZ represents the result of a fallible operation,
1735 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SemanticError on failure.
1736 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1738 typedef struct LDKCResult_InvoiceSemanticErrorZ {
1740 * The contents of this CResult_InvoiceSemanticErrorZ, accessible via either
1741 * `err` or `result` depending on the state of `result_ok`.
1743 union LDKCResult_InvoiceSemanticErrorZPtr contents;
1745 * Whether this CResult_InvoiceSemanticErrorZ represents a success state.
1748 } LDKCResult_InvoiceSemanticErrorZ;
1753 * Description string
1756 * The description can be at most 639 __bytes__ long
1758 typedef struct MUST_USE_STRUCT LDKDescription {
1760 * A pointer to the opaque Rust object.
1761 * Nearly everywhere, inner must be non-null, however in places where
1762 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1764 LDKnativeDescription *inner;
1766 * Indicates that this is the only struct which contains the same pointer.
1767 * Rust functions which take ownership of an object provided via an argument require
1768 * this to be true and invalidate the object pointed to by inner.
1774 * The contents of CResult_DescriptionCreationErrorZ
1776 typedef union LDKCResult_DescriptionCreationErrorZPtr {
1778 * A pointer to the contents in the success state.
1779 * Reading from this pointer when `result_ok` is not set is undefined.
1781 struct LDKDescription *result;
1783 * A pointer to the contents in the error state.
1784 * Reading from this pointer when `result_ok` is set is undefined.
1786 enum LDKCreationError *err;
1787 } LDKCResult_DescriptionCreationErrorZPtr;
1790 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
1791 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
1792 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1794 typedef struct LDKCResult_DescriptionCreationErrorZ {
1796 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
1797 * `err` or `result` depending on the state of `result_ok`.
1799 union LDKCResult_DescriptionCreationErrorZPtr contents;
1801 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
1804 } LDKCResult_DescriptionCreationErrorZ;
1809 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
1813 * The number of seconds this expiry time represents has to be in the range
1814 * `0...(SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME)` to avoid overflows when adding it to a
1817 typedef struct MUST_USE_STRUCT LDKExpiryTime {
1819 * A pointer to the opaque Rust object.
1820 * Nearly everywhere, inner must be non-null, however in places where
1821 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1823 LDKnativeExpiryTime *inner;
1825 * Indicates that this is the only struct which contains the same pointer.
1826 * Rust functions which take ownership of an object provided via an argument require
1827 * this to be true and invalidate the object pointed to by inner.
1833 * The contents of CResult_ExpiryTimeCreationErrorZ
1835 typedef union LDKCResult_ExpiryTimeCreationErrorZPtr {
1837 * A pointer to the contents in the success state.
1838 * Reading from this pointer when `result_ok` is not set is undefined.
1840 struct LDKExpiryTime *result;
1842 * A pointer to the contents in the error state.
1843 * Reading from this pointer when `result_ok` is set is undefined.
1845 enum LDKCreationError *err;
1846 } LDKCResult_ExpiryTimeCreationErrorZPtr;
1849 * A CResult_ExpiryTimeCreationErrorZ represents the result of a fallible operation,
1850 * containing a crate::lightning_invoice::ExpiryTime on success and a crate::lightning_invoice::CreationError on failure.
1851 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1853 typedef struct LDKCResult_ExpiryTimeCreationErrorZ {
1855 * The contents of this CResult_ExpiryTimeCreationErrorZ, accessible via either
1856 * `err` or `result` depending on the state of `result_ok`.
1858 union LDKCResult_ExpiryTimeCreationErrorZPtr contents;
1860 * Whether this CResult_ExpiryTimeCreationErrorZ represents a success state.
1863 } LDKCResult_ExpiryTimeCreationErrorZ;
1868 * A channel descriptor which provides a last-hop route to get_route
1870 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
1872 * A pointer to the opaque Rust object.
1873 * Nearly everywhere, inner must be non-null, however in places where
1874 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1876 LDKnativeRouteHintHop *inner;
1878 * Indicates that this is the only struct which contains the same pointer.
1879 * Rust functions which take ownership of an object provided via an argument require
1880 * this to be true and invalidate the object pointed to by inner.
1886 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
1887 * This corresponds to std::vector in C++
1889 typedef struct LDKCVec_RouteHintHopZ {
1891 * The elements in the array.
1892 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1894 struct LDKRouteHintHop *data;
1896 * The number of elements pointed to by `data`.
1899 } LDKCVec_RouteHintHopZ;
1902 * The contents of CResult_RouteHintCreationErrorZ
1904 typedef union LDKCResult_RouteHintCreationErrorZPtr {
1906 * A pointer to the contents in the success state.
1907 * Reading from this pointer when `result_ok` is not set is undefined.
1909 struct LDKRouteHint *result;
1911 * A pointer to the contents in the error state.
1912 * Reading from this pointer when `result_ok` is set is undefined.
1914 enum LDKCreationError *err;
1915 } LDKCResult_RouteHintCreationErrorZPtr;
1918 * A CResult_RouteHintCreationErrorZ represents the result of a fallible operation,
1919 * containing a crate::lightning_invoice::RouteHint on success and a crate::lightning_invoice::CreationError on failure.
1920 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1922 typedef struct LDKCResult_RouteHintCreationErrorZ {
1924 * The contents of this CResult_RouteHintCreationErrorZ, accessible via either
1925 * `err` or `result` depending on the state of `result_ok`.
1927 union LDKCResult_RouteHintCreationErrorZPtr contents;
1929 * Whether this CResult_RouteHintCreationErrorZ represents a success state.
1932 } LDKCResult_RouteHintCreationErrorZ;
1935 * The contents of CResult_StringErrorZ
1937 typedef union LDKCResult_StringErrorZPtr {
1939 * A pointer to the contents in the success state.
1940 * Reading from this pointer when `result_ok` is not set is undefined.
1942 struct LDKStr *result;
1944 * A pointer to the contents in the error state.
1945 * Reading from this pointer when `result_ok` is set is undefined.
1947 enum LDKSecp256k1Error *err;
1948 } LDKCResult_StringErrorZPtr;
1951 * A CResult_StringErrorZ represents the result of a fallible operation,
1952 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
1953 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1955 typedef struct LDKCResult_StringErrorZ {
1957 * The contents of this CResult_StringErrorZ, accessible via either
1958 * `err` or `result` depending on the state of `result_ok`.
1960 union LDKCResult_StringErrorZPtr contents;
1962 * Whether this CResult_StringErrorZ represents a success state.
1965 } LDKCResult_StringErrorZ;
1970 * An update generated by the underlying Channel itself which contains some new information the
1971 * ChannelMonitor should be made aware of.
1973 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
1975 * A pointer to the opaque Rust object.
1976 * Nearly everywhere, inner must be non-null, however in places where
1977 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1979 LDKnativeChannelMonitorUpdate *inner;
1981 * Indicates that this is the only struct which contains the same pointer.
1982 * Rust functions which take ownership of an object provided via an argument require
1983 * this to be true and invalidate the object pointed to by inner.
1986 } LDKChannelMonitorUpdate;
1989 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
1991 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
1993 * A pointer to the contents in the success state.
1994 * Reading from this pointer when `result_ok` is not set is undefined.
1996 struct LDKChannelMonitorUpdate *result;
1998 * A pointer to the contents in the error state.
1999 * Reading from this pointer when `result_ok` is set is undefined.
2001 struct LDKDecodeError *err;
2002 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
2005 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
2006 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
2007 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2009 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
2011 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
2012 * `err` or `result` depending on the state of `result_ok`.
2014 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
2016 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
2019 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
2024 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
2025 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
2026 * preimage claim backward will lead to loss of funds.
2028 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
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 LDKnativeHTLCUpdate *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.
2044 * The contents of CResult_HTLCUpdateDecodeErrorZ
2046 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
2048 * A pointer to the contents in the success state.
2049 * Reading from this pointer when `result_ok` is not set is undefined.
2051 struct LDKHTLCUpdate *result;
2053 * A pointer to the contents in the error state.
2054 * Reading from this pointer when `result_ok` is set is undefined.
2056 struct LDKDecodeError *err;
2057 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
2060 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
2061 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
2062 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2064 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
2066 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
2067 * `err` or `result` depending on the state of `result_ok`.
2069 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
2071 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
2074 } LDKCResult_HTLCUpdateDecodeErrorZ;
2079 * General Err type for ChannelMonitor actions. Generally, this implies that the data provided is
2080 * inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this
2081 * means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was
2083 * Contains a developer-readable error message.
2085 typedef struct MUST_USE_STRUCT LDKMonitorUpdateError {
2087 * A pointer to the opaque Rust object.
2088 * Nearly everywhere, inner must be non-null, however in places where
2089 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2091 LDKnativeMonitorUpdateError *inner;
2093 * Indicates that this is the only struct which contains the same pointer.
2094 * Rust functions which take ownership of an object provided via an argument require
2095 * this to be true and invalidate the object pointed to by inner.
2098 } LDKMonitorUpdateError;
2101 * The contents of CResult_NoneMonitorUpdateErrorZ
2103 typedef union LDKCResult_NoneMonitorUpdateErrorZPtr {
2105 * Note that this value is always NULL, as there are no contents in the OK variant
2109 * A pointer to the contents in the error state.
2110 * Reading from this pointer when `result_ok` is set is undefined.
2112 struct LDKMonitorUpdateError *err;
2113 } LDKCResult_NoneMonitorUpdateErrorZPtr;
2116 * A CResult_NoneMonitorUpdateErrorZ represents the result of a fallible operation,
2117 * containing a () on success and a crate::lightning::chain::channelmonitor::MonitorUpdateError on failure.
2118 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2120 typedef struct LDKCResult_NoneMonitorUpdateErrorZ {
2122 * The contents of this CResult_NoneMonitorUpdateErrorZ, accessible via either
2123 * `err` or `result` depending on the state of `result_ok`.
2125 union LDKCResult_NoneMonitorUpdateErrorZPtr contents;
2127 * Whether this CResult_NoneMonitorUpdateErrorZ represents a success state.
2130 } LDKCResult_NoneMonitorUpdateErrorZ;
2133 * A tuple of 2 elements. See the individual fields for the types contained.
2135 typedef struct LDKC2Tuple_OutPointScriptZ {
2137 * The element at position 0
2139 struct LDKOutPoint a;
2141 * The element at position 1
2143 struct LDKCVec_u8Z b;
2144 } LDKC2Tuple_OutPointScriptZ;
2147 * A tuple of 2 elements. See the individual fields for the types contained.
2149 typedef struct LDKC2Tuple_u32ScriptZ {
2151 * The element at position 0
2155 * The element at position 1
2157 struct LDKCVec_u8Z b;
2158 } LDKC2Tuple_u32ScriptZ;
2161 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
2162 * This corresponds to std::vector in C++
2164 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
2166 * The elements in the array.
2167 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2169 struct LDKC2Tuple_u32ScriptZ *data;
2171 * The number of elements pointed to by `data`.
2174 } LDKCVec_C2Tuple_u32ScriptZZ;
2177 * A tuple of 2 elements. See the individual fields for the types contained.
2179 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
2181 * The element at position 0
2183 struct LDKThirtyTwoBytes a;
2185 * The element at position 1
2187 struct LDKCVec_C2Tuple_u32ScriptZZ b;
2188 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
2191 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
2192 * This corresponds to std::vector in C++
2194 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
2196 * The elements in the array.
2197 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2199 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
2201 * The number of elements pointed to by `data`.
2204 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
2207 * An event to be processed by the ChannelManager.
2209 typedef enum LDKMonitorEvent_Tag {
2211 * A monitor event containing an HTLCUpdate.
2213 LDKMonitorEvent_HTLCEvent,
2215 * A monitor event that the Channel's commitment transaction was broadcasted.
2217 LDKMonitorEvent_CommitmentTxBroadcasted,
2219 * Must be last for serialization purposes
2221 LDKMonitorEvent_Sentinel,
2222 } LDKMonitorEvent_Tag;
2224 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
2225 LDKMonitorEvent_Tag tag;
2228 struct LDKHTLCUpdate htlc_event;
2231 struct LDKOutPoint commitment_tx_broadcasted;
2237 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
2238 * This corresponds to std::vector in C++
2240 typedef struct LDKCVec_MonitorEventZ {
2242 * The elements in the array.
2243 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2245 struct LDKMonitorEvent *data;
2247 * The number of elements pointed to by `data`.
2250 } LDKCVec_MonitorEventZ;
2255 * Information about a spendable output to a P2WSH script. See
2256 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
2258 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
2260 * A pointer to the opaque Rust object.
2261 * Nearly everywhere, inner must be non-null, however in places where
2262 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2264 LDKnativeDelayedPaymentOutputDescriptor *inner;
2266 * Indicates that this is the only struct which contains the same pointer.
2267 * Rust functions which take ownership of an object provided via an argument require
2268 * this to be true and invalidate the object pointed to by inner.
2271 } LDKDelayedPaymentOutputDescriptor;
2276 * Information about a spendable output to our \"payment key\". See
2277 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
2279 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
2281 * A pointer to the opaque Rust object.
2282 * Nearly everywhere, inner must be non-null, however in places where
2283 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2285 LDKnativeStaticPaymentOutputDescriptor *inner;
2287 * Indicates that this is the only struct which contains the same pointer.
2288 * Rust functions which take ownership of an object provided via an argument require
2289 * this to be true and invalidate the object pointed to by inner.
2292 } LDKStaticPaymentOutputDescriptor;
2295 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
2296 * claim at any point in the future) an event is generated which you must track and be able to
2297 * spend on-chain. The information needed to do this is provided in this enum, including the
2298 * outpoint describing which txid and output index is available, the full output which exists at
2299 * that txid/index, and any keys or other information required to sign.
2301 typedef enum LDKSpendableOutputDescriptor_Tag {
2303 * An output to a script which was provided via KeysInterface directly, either from
2304 * `get_destination_script()` or `get_shutdown_pubkey()`, thus you should already know how to
2305 * spend it. No secret keys are provided as rust-lightning was never given any key.
2306 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
2307 * on-chain using the payment preimage or after it has timed out.
2309 LDKSpendableOutputDescriptor_StaticOutput,
2311 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
2313 * The witness in the spending input should be:
2314 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
2316 * Note that the nSequence field in the spending input must be set to to_self_delay
2317 * (which means the transaction is not broadcastable until at least to_self_delay
2318 * blocks after the outpoint confirms).
2320 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
2321 * it is an output from an old state which we broadcast (which should never happen).
2323 * To derive the delayed_payment key which is used to sign for this input, you must pass the
2324 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
2325 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
2326 * chan_utils::derive_private_key. The public key can be generated without the secret key
2327 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
2330 * To derive the revocation_pubkey provided here (which is used in the witness
2331 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
2332 * call to Sign::ready_channel) and the provided per_commitment point
2333 * to chan_utils::derive_public_revocation_key.
2335 * The witness script which is hashed and included in the output script_pubkey may be
2336 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
2337 * (derived as above), and the to_self_delay contained here to
2338 * chan_utils::get_revokeable_redeemscript.
2340 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
2342 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
2343 * corresponds to the public key in Sign::pubkeys().payment_point).
2344 * The witness in the spending input, is, thus, simply:
2345 * <BIP 143 signature> <payment key>
2347 * These are generally the result of our counterparty having broadcast the current state,
2348 * allowing us to claim the non-HTLC-encumbered outputs immediately.
2350 LDKSpendableOutputDescriptor_StaticPaymentOutput,
2352 * Must be last for serialization purposes
2354 LDKSpendableOutputDescriptor_Sentinel,
2355 } LDKSpendableOutputDescriptor_Tag;
2357 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
2359 * The outpoint which is spendable
2361 struct LDKOutPoint outpoint;
2363 * The output which is referenced by the given outpoint.
2365 struct LDKTxOut output;
2366 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
2368 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
2369 LDKSpendableOutputDescriptor_Tag tag;
2371 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
2373 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
2376 struct LDKStaticPaymentOutputDescriptor static_payment_output;
2379 } LDKSpendableOutputDescriptor;
2382 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
2383 * This corresponds to std::vector in C++
2385 typedef struct LDKCVec_SpendableOutputDescriptorZ {
2387 * The elements in the array.
2388 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2390 struct LDKSpendableOutputDescriptor *data;
2392 * The number of elements pointed to by `data`.
2395 } LDKCVec_SpendableOutputDescriptorZ;
2398 * An Event which you should probably take some action in response to.
2400 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
2401 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
2402 * written as it makes no sense to respond to it after reconnecting to peers).
2404 typedef enum LDKEvent_Tag {
2406 * Used to indicate that the client should generate a funding transaction with the given
2407 * parameters and then call ChannelManager::funding_transaction_generated.
2408 * Generated in ChannelManager message handling.
2409 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
2410 * counterparty can steal your funds!
2412 LDKEvent_FundingGenerationReady,
2414 * Indicates we've received money! Just gotta dig out that payment preimage and feed it to
2415 * ChannelManager::claim_funds to get it....
2416 * Note that if the preimage is not known or the amount paid is incorrect, you should call
2417 * ChannelManager::fail_htlc_backwards to free up resources for this HTLC and avoid
2418 * network congestion.
2419 * The amount paid should be considered 'incorrect' when it is less than or more than twice
2420 * the amount expected.
2421 * If you fail to call either ChannelManager::claim_funds or
2422 * ChannelManager::fail_htlc_backwards within the HTLC's timeout, the HTLC will be
2423 * automatically failed.
2425 LDKEvent_PaymentReceived,
2427 * Indicates an outbound payment we made succeeded (ie it made it all the way to its target
2428 * and we got back the payment preimage for it).
2429 * Note that duplicative PaymentSent Events may be generated - it is your responsibility to
2430 * deduplicate them by payment_preimage (which MUST be unique)!
2432 LDKEvent_PaymentSent,
2434 * Indicates an outbound payment we made failed. Probably some intermediary node dropped
2435 * something. You may wish to retry with a different route.
2436 * Note that duplicative PaymentFailed Events may be generated - it is your responsibility to
2437 * deduplicate them by payment_hash (which MUST be unique)!
2439 LDKEvent_PaymentFailed,
2441 * Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
2442 * time in the future.
2444 LDKEvent_PendingHTLCsForwardable,
2446 * Used to indicate that an output was generated on-chain which you should know how to spend.
2447 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
2448 * counterparty spending them due to some kind of timeout. Thus, you need to store them
2449 * somewhere and spend them when you create on-chain transactions.
2451 LDKEvent_SpendableOutputs,
2453 * Must be last for serialization purposes
2458 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
2460 * The random channel_id we picked which you'll need to pass into
2461 * ChannelManager::funding_transaction_generated.
2463 struct LDKThirtyTwoBytes temporary_channel_id;
2465 * The value, in satoshis, that the output should have.
2467 uint64_t channel_value_satoshis;
2469 * The script which should be used in the transaction output.
2471 struct LDKCVec_u8Z output_script;
2473 * The value passed in to ChannelManager::create_channel
2475 uint64_t user_channel_id;
2476 } LDKEvent_LDKFundingGenerationReady_Body;
2478 typedef struct LDKEvent_LDKPaymentReceived_Body {
2480 * The hash for which the preimage should be handed to the ChannelManager.
2482 struct LDKThirtyTwoBytes payment_hash;
2484 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
2485 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
2486 * [`ChannelManager::claim_funds`].
2488 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2489 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2491 struct LDKThirtyTwoBytes payment_preimage;
2493 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
2494 * number of deanonymization attacks during the routing process.
2495 * It is provided here for your reference, however its accuracy is enforced directly by
2496 * [`ChannelManager`] using the values you previously provided to
2497 * [`ChannelManager::create_inbound_payment`] or
2498 * [`ChannelManager::create_inbound_payment_for_hash`].
2500 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2501 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2502 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
2504 struct LDKThirtyTwoBytes payment_secret;
2506 * The value, in thousandths of a satoshi, that this payment is for. Note that you must
2507 * compare this to the expected value before accepting the payment (as otherwise you are
2508 * providing proof-of-payment for less than the value you expected!).
2512 * This is the `user_payment_id` which was provided to
2513 * [`ChannelManager::create_inbound_payment_for_hash`] or
2514 * [`ChannelManager::create_inbound_payment`]. It has no meaning inside of LDK and is
2515 * simply copied here. It may be used to correlate PaymentReceived events with invoice
2516 * metadata stored elsewhere.
2518 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2519 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
2521 uint64_t user_payment_id;
2522 } LDKEvent_LDKPaymentReceived_Body;
2524 typedef struct LDKEvent_LDKPaymentSent_Body {
2526 * The preimage to the hash given to ChannelManager::send_payment.
2527 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
2530 struct LDKThirtyTwoBytes payment_preimage;
2531 } LDKEvent_LDKPaymentSent_Body;
2533 typedef struct LDKEvent_LDKPaymentFailed_Body {
2535 * The hash which was given to ChannelManager::send_payment.
2537 struct LDKThirtyTwoBytes payment_hash;
2539 * Indicates the payment was rejected for some reason by the recipient. This implies that
2540 * the payment has failed, not just the route in question. If this is not set, you may
2541 * retry the payment via a different route.
2543 bool rejected_by_dest;
2544 } LDKEvent_LDKPaymentFailed_Body;
2546 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
2548 * The minimum amount of time that should be waited prior to calling
2549 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
2550 * you should wait a random amount of time in roughly the range (now + time_forwardable,
2551 * now + 5*time_forwardable).
2553 uint64_t time_forwardable;
2554 } LDKEvent_LDKPendingHTLCsForwardable_Body;
2556 typedef struct LDKEvent_LDKSpendableOutputs_Body {
2558 * The outputs which you should store as spendable by you.
2560 struct LDKCVec_SpendableOutputDescriptorZ outputs;
2561 } LDKEvent_LDKSpendableOutputs_Body;
2563 typedef struct MUST_USE_STRUCT LDKEvent {
2566 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
2567 LDKEvent_LDKPaymentReceived_Body payment_received;
2568 LDKEvent_LDKPaymentSent_Body payment_sent;
2569 LDKEvent_LDKPaymentFailed_Body payment_failed;
2570 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
2571 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
2576 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
2577 * This corresponds to std::vector in C++
2579 typedef struct LDKCVec_EventZ {
2581 * The elements in the array.
2582 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2584 struct LDKEvent *data;
2586 * The number of elements pointed to by `data`.
2592 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
2593 * This corresponds to std::vector in C++
2595 typedef struct LDKCVec_TransactionZ {
2597 * The elements in the array.
2598 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2600 struct LDKTransaction *data;
2602 * The number of elements pointed to by `data`.
2605 } LDKCVec_TransactionZ;
2608 * A tuple of 2 elements. See the individual fields for the types contained.
2610 typedef struct LDKC2Tuple_usizeTransactionZ {
2612 * The element at position 0
2616 * The element at position 1
2618 struct LDKTransaction b;
2619 } LDKC2Tuple_usizeTransactionZ;
2622 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
2623 * This corresponds to std::vector in C++
2625 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
2627 * The elements in the array.
2628 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2630 struct LDKC2Tuple_usizeTransactionZ *data;
2632 * The number of elements pointed to by `data`.
2635 } LDKCVec_C2Tuple_usizeTransactionZZ;
2638 * A tuple of 2 elements. See the individual fields for the types contained.
2640 typedef struct LDKC2Tuple_u32TxOutZ {
2642 * The element at position 0
2646 * The element at position 1
2649 } LDKC2Tuple_u32TxOutZ;
2652 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
2653 * This corresponds to std::vector in C++
2655 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
2657 * The elements in the array.
2658 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2660 struct LDKC2Tuple_u32TxOutZ *data;
2662 * The number of elements pointed to by `data`.
2665 } LDKCVec_C2Tuple_u32TxOutZZ;
2668 * A tuple of 2 elements. See the individual fields for the types contained.
2670 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
2672 * The element at position 0
2674 struct LDKThirtyTwoBytes a;
2676 * The element at position 1
2678 struct LDKCVec_C2Tuple_u32TxOutZZ b;
2679 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
2682 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
2683 * This corresponds to std::vector in C++
2685 typedef struct LDKCVec_TransactionOutputsZ {
2687 * The elements in the array.
2688 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2690 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
2692 * The number of elements pointed to by `data`.
2695 } LDKCVec_TransactionOutputsZ;
2698 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
2699 * This corresponds to std::vector in C++
2701 typedef struct LDKCVec_TxidZ {
2703 * The elements in the array.
2704 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2706 struct LDKThirtyTwoBytes *data;
2708 * The number of elements pointed to by `data`.
2714 * The contents of CResult_NoneChannelMonitorUpdateErrZ
2716 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
2718 * Note that this value is always NULL, as there are no contents in the OK variant
2722 * A pointer to the contents in the error state.
2723 * Reading from this pointer when `result_ok` is set is undefined.
2725 enum LDKChannelMonitorUpdateErr *err;
2726 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
2729 * A CResult_NoneChannelMonitorUpdateErrZ represents the result of a fallible operation,
2730 * containing a () on success and a crate::lightning::chain::channelmonitor::ChannelMonitorUpdateErr on failure.
2731 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2733 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
2735 * The contents of this CResult_NoneChannelMonitorUpdateErrZ, accessible via either
2736 * `err` or `result` depending on the state of `result_ok`.
2738 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
2740 * Whether this CResult_NoneChannelMonitorUpdateErrZ represents a success state.
2743 } LDKCResult_NoneChannelMonitorUpdateErrZ;
2746 * A tuple of 2 elements. See the individual fields for the types contained.
2748 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
2750 * The element at position 0
2752 struct LDKSignature a;
2754 * The element at position 1
2756 struct LDKCVec_SignatureZ b;
2757 } LDKC2Tuple_SignatureCVec_SignatureZZ;
2760 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
2762 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
2764 * A pointer to the contents in the success state.
2765 * Reading from this pointer when `result_ok` is not set is undefined.
2767 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
2769 * Note that this value is always NULL, as there are no contents in the Err variant
2772 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
2775 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
2776 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
2777 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2779 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
2781 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
2782 * `err` or `result` depending on the state of `result_ok`.
2784 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
2786 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
2789 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
2792 * The contents of CResult_SignatureNoneZ
2794 typedef union LDKCResult_SignatureNoneZPtr {
2796 * A pointer to the contents in the success state.
2797 * Reading from this pointer when `result_ok` is not set is undefined.
2799 struct LDKSignature *result;
2801 * Note that this value is always NULL, as there are no contents in the Err variant
2804 } LDKCResult_SignatureNoneZPtr;
2807 * A CResult_SignatureNoneZ represents the result of a fallible operation,
2808 * containing a crate::c_types::Signature on success and a () on failure.
2809 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2811 typedef struct LDKCResult_SignatureNoneZ {
2813 * The contents of this CResult_SignatureNoneZ, accessible via either
2814 * `err` or `result` depending on the state of `result_ok`.
2816 union LDKCResult_SignatureNoneZPtr contents;
2818 * Whether this CResult_SignatureNoneZ represents a success state.
2821 } LDKCResult_SignatureNoneZ;
2826 * The unsigned part of a channel_announcement
2828 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
2830 * A pointer to the opaque Rust object.
2831 * Nearly everywhere, inner must be non-null, however in places where
2832 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2834 LDKnativeUnsignedChannelAnnouncement *inner;
2836 * Indicates that this is the only struct which contains the same pointer.
2837 * Rust functions which take ownership of an object provided via an argument require
2838 * this to be true and invalidate the object pointed to by inner.
2841 } LDKUnsignedChannelAnnouncement;
2844 * A trait to sign lightning channel transactions as described in BOLT 3.
2846 * Signing services could be implemented on a hardware wallet. In this case,
2847 * the current Sign would be a front-end on top of a communication
2848 * channel connected to your secure device and lightning key material wouldn't
2849 * reside on a hot server. Nevertheless, a this deployment would still need
2850 * to trust the ChannelManager to avoid loss of funds as this latest component
2851 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
2853 * A more secure iteration would be to use hashlock (or payment points) to pair
2854 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
2855 * at the price of more state and computation on the hardware wallet side. In the future,
2856 * we are looking forward to design such interface.
2858 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
2859 * to act, as liveness and breach reply correctness are always going to be hard requirements
2860 * of LN security model, orthogonal of key management issues.
2862 typedef struct LDKBaseSign {
2864 * An opaque pointer which is passed to your function implementations as an argument.
2865 * This has no meaning in the LDK, and can be NULL or any other value.
2869 * Gets the per-commitment point for a specific commitment number
2871 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
2873 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
2875 * Gets the commitment secret for a specific commitment number as part of the revocation process
2877 * An external signer implementation should error here if the commitment was already signed
2878 * and should refuse to sign it in the future.
2880 * May be called more than once for the same index.
2882 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
2884 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
2886 * Gets the holder's channel public keys and basepoints
2888 struct LDKChannelPublicKeys pubkeys;
2890 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
2891 * Note that this takes a pointer to this object, not the this_ptr like other methods do
2892 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
2894 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
2896 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
2897 * some SpendableOutputDescriptor types. This should be sufficient to identify this
2898 * Sign object uniquely and lookup or re-derive its keys.
2900 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
2902 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
2904 * Note that if signing fails or is rejected, the channel will be force-closed.
2906 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx);
2908 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
2909 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
2910 * latest commitment_tx when we initiate a force-close.
2911 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
2912 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
2914 * This may be called multiple times for the same transaction.
2916 * An external signer implementation should check that the commitment has not been revoked.
2918 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
2920 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
2922 * Create a signature for the given input in a transaction spending an HTLC or commitment
2923 * transaction output when our counterparty broadcasts an old state.
2925 * A justice transaction may claim multiples outputs at the same time if timelocks are
2926 * similar, but only a signature for the input at index `input` should be signed for here.
2927 * It may be called multiples time for same output(s) if a fee-bump is needed with regards
2928 * to an upcoming timelock expiration.
2930 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2932 * per_commitment_key is revocation secret which was provided by our counterparty when they
2933 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2934 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
2937 * htlc holds HTLC elements (hash, timelock) if the output being spent is a HTLC output, thus
2938 * changing the format of the witness script (which is committed to in the BIP 143
2941 struct LDKCResult_SignatureNoneZ (*sign_justice_transaction)(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);
2943 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
2944 * transaction, either offered or received.
2946 * Such a transaction may claim multiples offered outputs at same time if we know the
2947 * preimage for each when we create it, but only the input at index `input` should be
2948 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
2949 * needed with regards to an upcoming timelock expiration.
2951 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
2954 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2956 * Per_commitment_point is the dynamic point corresponding to the channel state
2957 * detected onchain. It has been generated by our counterparty and is used to derive
2958 * channel state keys, which are then included in the witness script and committed to in the
2959 * BIP 143 signature.
2961 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);
2963 * Create a signature for a (proposed) closing transaction.
2965 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
2966 * chosen to forgo their output as dust.
2968 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, struct LDKTransaction closing_tx);
2970 * Signs a channel announcement message with our funding key, proving it comes from one
2971 * of the channel participants.
2973 * Note that if this fails or is rejected, the channel will not be publicly announced and
2974 * our counterparty may (though likely will not) close the channel on us for violating the
2977 struct LDKCResult_SignatureNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
2979 * Set the counterparty static channel data, including basepoints,
2980 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
2981 * This is done as soon as the funding outpoint is known. Since these are static channel data,
2982 * they MUST NOT be allowed to change to different values once set.
2984 * channel_parameters.is_populated() MUST be true.
2986 * We bind holder_selected_contest_delay late here for API convenience.
2988 * Will be called before any signatures are applied.
2990 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
2992 * Frees any resources associated with this object given its this_arg pointer.
2993 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2995 void (*free)(void *this_arg);
2999 * A cloneable signer.
3001 * Although we require signers to be cloneable, it may be useful for developers to be able to use
3002 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
3003 * which implies Sized, into this derived trait.
3005 typedef struct LDKSign {
3007 * An opaque pointer which is passed to your function implementations as an argument.
3008 * This has no meaning in the LDK, and can be NULL or any other value.
3012 * Implementation of BaseSign for this object.
3014 struct LDKBaseSign BaseSign;
3016 * Creates a copy of the BaseSign, for a copy of this Sign.
3017 * Because BaseSign doesn't natively support copying itself, you have to provide a full copy implementation here.
3019 struct LDKBaseSign (*BaseSign_clone)(const struct LDKBaseSign *NONNULL_PTR orig_BaseSign);
3021 * Serialize the object into a byte array
3023 struct LDKCVec_u8Z (*write)(const void *this_arg);
3025 * Creates a copy of the object pointed to by this_arg, for a copy of this Sign.
3026 * Note that the ultimate copy of the Sign will have all function pointers the same as the original.
3027 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new Sign.
3029 void *(*clone)(const void *this_arg);
3031 * Frees any resources associated with this object given its this_arg pointer.
3032 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3034 void (*free)(void *this_arg);
3040 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
3041 * on-chain transactions to ensure no loss of funds occurs.
3043 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
3044 * information and are actively monitoring the chain.
3046 * Pending Events or updated HTLCs which have not yet been read out by
3047 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
3048 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
3049 * gotten are fully handled before re-serializing the new state.
3051 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
3052 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
3053 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
3054 * returned block hash and the the current chain and then reconnecting blocks to get to the
3055 * best chain) upon deserializing the object!
3057 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
3059 * A pointer to the opaque Rust object.
3060 * Nearly everywhere, inner must be non-null, however in places where
3061 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3063 LDKnativeChannelMonitor *inner;
3065 * Indicates that this is the only struct which contains the same pointer.
3066 * Rust functions which take ownership of an object provided via an argument require
3067 * this to be true and invalidate the object pointed to by inner.
3070 } LDKChannelMonitor;
3073 * A tuple of 2 elements. See the individual fields for the types contained.
3075 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
3077 * The element at position 0
3079 struct LDKThirtyTwoBytes a;
3081 * The element at position 1
3083 struct LDKChannelMonitor b;
3084 } LDKC2Tuple_BlockHashChannelMonitorZ;
3087 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
3089 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
3091 * A pointer to the contents in the success state.
3092 * Reading from this pointer when `result_ok` is not set is undefined.
3094 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
3096 * A pointer to the contents in the error state.
3097 * Reading from this pointer when `result_ok` is set is undefined.
3099 struct LDKDecodeError *err;
3100 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
3103 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
3104 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
3105 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3107 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
3109 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
3110 * `err` or `result` depending on the state of `result_ok`.
3112 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
3114 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
3117 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
3124 typedef struct MUST_USE_STRUCT LDKRouteHop {
3126 * A pointer to the opaque Rust object.
3127 * Nearly everywhere, inner must be non-null, however in places where
3128 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3130 LDKnativeRouteHop *inner;
3132 * Indicates that this is the only struct which contains the same pointer.
3133 * Rust functions which take ownership of an object provided via an argument require
3134 * this to be true and invalidate the object pointed to by inner.
3140 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
3141 * This corresponds to std::vector in C++
3143 typedef struct LDKCVec_RouteHopZ {
3145 * The elements in the array.
3146 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3148 struct LDKRouteHop *data;
3150 * The number of elements pointed to by `data`.
3153 } LDKCVec_RouteHopZ;
3156 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
3157 * This corresponds to std::vector in C++
3159 typedef struct LDKCVec_CVec_RouteHopZZ {
3161 * The elements in the array.
3162 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3164 struct LDKCVec_RouteHopZ *data;
3166 * The number of elements pointed to by `data`.
3169 } LDKCVec_CVec_RouteHopZZ;
3174 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
3175 * it can take multiple paths. Each path is composed of one or more hops through the network.
3177 typedef struct MUST_USE_STRUCT LDKRoute {
3179 * A pointer to the opaque Rust object.
3180 * Nearly everywhere, inner must be non-null, however in places where
3181 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3183 LDKnativeRoute *inner;
3185 * Indicates that this is the only struct which contains the same pointer.
3186 * Rust functions which take ownership of an object provided via an argument require
3187 * this to be true and invalidate the object pointed to by inner.
3193 * The contents of CResult_RouteDecodeErrorZ
3195 typedef union LDKCResult_RouteDecodeErrorZPtr {
3197 * A pointer to the contents in the success state.
3198 * Reading from this pointer when `result_ok` is not set is undefined.
3200 struct LDKRoute *result;
3202 * A pointer to the contents in the error state.
3203 * Reading from this pointer when `result_ok` is set is undefined.
3205 struct LDKDecodeError *err;
3206 } LDKCResult_RouteDecodeErrorZPtr;
3209 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
3210 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
3211 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3213 typedef struct LDKCResult_RouteDecodeErrorZ {
3215 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
3216 * `err` or `result` depending on the state of `result_ok`.
3218 union LDKCResult_RouteDecodeErrorZPtr contents;
3220 * Whether this CResult_RouteDecodeErrorZ represents a success state.
3223 } LDKCResult_RouteDecodeErrorZ;
3228 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
3230 typedef struct MUST_USE_STRUCT LDKChannelDetails {
3232 * A pointer to the opaque Rust object.
3233 * Nearly everywhere, inner must be non-null, however in places where
3234 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3236 LDKnativeChannelDetails *inner;
3238 * Indicates that this is the only struct which contains the same pointer.
3239 * Rust functions which take ownership of an object provided via an argument require
3240 * this to be true and invalidate the object pointed to by inner.
3243 } LDKChannelDetails;
3246 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
3247 * This corresponds to std::vector in C++
3249 typedef struct LDKCVec_ChannelDetailsZ {
3251 * The elements in the array.
3252 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3254 struct LDKChannelDetails *data;
3256 * The number of elements pointed to by `data`.
3259 } LDKCVec_ChannelDetailsZ;
3264 * An Err type for failure to process messages.
3266 typedef struct MUST_USE_STRUCT LDKLightningError {
3268 * A pointer to the opaque Rust object.
3269 * Nearly everywhere, inner must be non-null, however in places where
3270 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3272 LDKnativeLightningError *inner;
3274 * Indicates that this is the only struct which contains the same pointer.
3275 * Rust functions which take ownership of an object provided via an argument require
3276 * this to be true and invalidate the object pointed to by inner.
3279 } LDKLightningError;
3282 * The contents of CResult_RouteLightningErrorZ
3284 typedef union LDKCResult_RouteLightningErrorZPtr {
3286 * A pointer to the contents in the success state.
3287 * Reading from this pointer when `result_ok` is not set is undefined.
3289 struct LDKRoute *result;
3291 * A pointer to the contents in the error state.
3292 * Reading from this pointer when `result_ok` is set is undefined.
3294 struct LDKLightningError *err;
3295 } LDKCResult_RouteLightningErrorZPtr;
3298 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
3299 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
3300 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3302 typedef struct LDKCResult_RouteLightningErrorZ {
3304 * The contents of this CResult_RouteLightningErrorZ, accessible via either
3305 * `err` or `result` depending on the state of `result_ok`.
3307 union LDKCResult_RouteLightningErrorZPtr contents;
3309 * Whether this CResult_RouteLightningErrorZ represents a success state.
3312 } LDKCResult_RouteLightningErrorZ;
3317 * An accept_channel message to be sent or received from a peer
3319 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
3321 * A pointer to the opaque Rust object.
3322 * Nearly everywhere, inner must be non-null, however in places where
3323 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3325 LDKnativeAcceptChannel *inner;
3327 * Indicates that this is the only struct which contains the same pointer.
3328 * Rust functions which take ownership of an object provided via an argument require
3329 * this to be true and invalidate the object pointed to by inner.
3337 * An open_channel message to be sent or received from a peer
3339 typedef struct MUST_USE_STRUCT LDKOpenChannel {
3341 * A pointer to the opaque Rust object.
3342 * Nearly everywhere, inner must be non-null, however in places where
3343 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3345 LDKnativeOpenChannel *inner;
3347 * Indicates that this is the only struct which contains the same pointer.
3348 * Rust functions which take ownership of an object provided via an argument require
3349 * this to be true and invalidate the object pointed to by inner.
3357 * A funding_created message to be sent or received from a peer
3359 typedef struct MUST_USE_STRUCT LDKFundingCreated {
3361 * A pointer to the opaque Rust object.
3362 * Nearly everywhere, inner must be non-null, however in places where
3363 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3365 LDKnativeFundingCreated *inner;
3367 * Indicates that this is the only struct which contains the same pointer.
3368 * Rust functions which take ownership of an object provided via an argument require
3369 * this to be true and invalidate the object pointed to by inner.
3372 } LDKFundingCreated;
3377 * A funding_signed message to be sent or received from a peer
3379 typedef struct MUST_USE_STRUCT LDKFundingSigned {
3381 * A pointer to the opaque Rust object.
3382 * Nearly everywhere, inner must be non-null, however in places where
3383 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3385 LDKnativeFundingSigned *inner;
3387 * Indicates that this is the only struct which contains the same pointer.
3388 * Rust functions which take ownership of an object provided via an argument require
3389 * this to be true and invalidate the object pointed to by inner.
3397 * A funding_locked message to be sent or received from a peer
3399 typedef struct MUST_USE_STRUCT LDKFundingLocked {
3401 * A pointer to the opaque Rust object.
3402 * Nearly everywhere, inner must be non-null, however in places where
3403 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3405 LDKnativeFundingLocked *inner;
3407 * Indicates that this is the only struct which contains the same pointer.
3408 * Rust functions which take ownership of an object provided via an argument require
3409 * this to be true and invalidate the object pointed to by inner.
3417 * An announcement_signatures message to be sent or received from a peer
3419 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
3421 * A pointer to the opaque Rust object.
3422 * Nearly everywhere, inner must be non-null, however in places where
3423 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3425 LDKnativeAnnouncementSignatures *inner;
3427 * Indicates that this is the only struct which contains the same pointer.
3428 * Rust functions which take ownership of an object provided via an argument require
3429 * this to be true and invalidate the object pointed to by inner.
3432 } LDKAnnouncementSignatures;
3437 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
3438 * transaction updates if they were pending.
3440 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
3442 * A pointer to the opaque Rust object.
3443 * Nearly everywhere, inner must be non-null, however in places where
3444 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3446 LDKnativeCommitmentUpdate *inner;
3448 * Indicates that this is the only struct which contains the same pointer.
3449 * Rust functions which take ownership of an object provided via an argument require
3450 * this to be true and invalidate the object pointed to by inner.
3453 } LDKCommitmentUpdate;
3458 * A revoke_and_ack message to be sent or received from a peer
3460 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
3462 * A pointer to the opaque Rust object.
3463 * Nearly everywhere, inner must be non-null, however in places where
3464 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3466 LDKnativeRevokeAndACK *inner;
3468 * Indicates that this is the only struct which contains the same pointer.
3469 * Rust functions which take ownership of an object provided via an argument require
3470 * this to be true and invalidate the object pointed to by inner.
3478 * A closing_signed message to be sent or received from a peer
3480 typedef struct MUST_USE_STRUCT LDKClosingSigned {
3482 * A pointer to the opaque Rust object.
3483 * Nearly everywhere, inner must be non-null, however in places where
3484 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3486 LDKnativeClosingSigned *inner;
3488 * Indicates that this is the only struct which contains the same pointer.
3489 * Rust functions which take ownership of an object provided via an argument require
3490 * this to be true and invalidate the object pointed to by inner.
3498 * A shutdown message to be sent or received from a peer
3500 typedef struct MUST_USE_STRUCT LDKShutdown {
3502 * A pointer to the opaque Rust object.
3503 * Nearly everywhere, inner must be non-null, however in places where
3504 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3506 LDKnativeShutdown *inner;
3508 * Indicates that this is the only struct which contains the same pointer.
3509 * Rust functions which take ownership of an object provided via an argument require
3510 * this to be true and invalidate the object pointed to by inner.
3518 * A channel_reestablish message to be sent or received from a peer
3520 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
3522 * A pointer to the opaque Rust object.
3523 * Nearly everywhere, inner must be non-null, however in places where
3524 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3526 LDKnativeChannelReestablish *inner;
3528 * Indicates that this is the only struct which contains the same pointer.
3529 * Rust functions which take ownership of an object provided via an argument require
3530 * this to be true and invalidate the object pointed to by inner.
3533 } LDKChannelReestablish;
3538 * A channel_announcement message to be sent or received from a peer
3540 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
3542 * A pointer to the opaque Rust object.
3543 * Nearly everywhere, inner must be non-null, however in places where
3544 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3546 LDKnativeChannelAnnouncement *inner;
3548 * Indicates that this is the only struct which contains the same pointer.
3549 * Rust functions which take ownership of an object provided via an argument require
3550 * this to be true and invalidate the object pointed to by inner.
3553 } LDKChannelAnnouncement;
3558 * A channel_update message to be sent or received from a peer
3560 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
3562 * A pointer to the opaque Rust object.
3563 * Nearly everywhere, inner must be non-null, however in places where
3564 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3566 LDKnativeChannelUpdate *inner;
3568 * Indicates that this is the only struct which contains the same pointer.
3569 * Rust functions which take ownership of an object provided via an argument require
3570 * this to be true and invalidate the object pointed to by inner.
3578 * A node_announcement message to be sent or received from a peer
3580 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
3582 * A pointer to the opaque Rust object.
3583 * Nearly everywhere, inner must be non-null, however in places where
3584 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3586 LDKnativeNodeAnnouncement *inner;
3588 * Indicates that this is the only struct which contains the same pointer.
3589 * Rust functions which take ownership of an object provided via an argument require
3590 * this to be true and invalidate the object pointed to by inner.
3593 } LDKNodeAnnouncement;
3598 * An error message to be sent or received from a peer
3600 typedef struct MUST_USE_STRUCT LDKErrorMessage {
3602 * A pointer to the opaque Rust object.
3603 * Nearly everywhere, inner must be non-null, however in places where
3604 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3606 LDKnativeErrorMessage *inner;
3608 * Indicates that this is the only struct which contains the same pointer.
3609 * Rust functions which take ownership of an object provided via an argument require
3610 * this to be true and invalidate the object pointed to by inner.
3616 * Used to put an error message in a LightningError
3618 typedef enum LDKErrorAction_Tag {
3620 * The peer took some action which made us think they were useless. Disconnect them.
3622 LDKErrorAction_DisconnectPeer,
3624 * The peer did something harmless that we weren't able to process, just log and ignore
3626 LDKErrorAction_IgnoreError,
3628 * The peer did something incorrect. Tell them.
3630 LDKErrorAction_SendErrorMessage,
3632 * Must be last for serialization purposes
3634 LDKErrorAction_Sentinel,
3635 } LDKErrorAction_Tag;
3637 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
3639 * An error message which we should make an effort to send before we disconnect.
3641 struct LDKErrorMessage msg;
3642 } LDKErrorAction_LDKDisconnectPeer_Body;
3644 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
3646 * The message to send.
3648 struct LDKErrorMessage msg;
3649 } LDKErrorAction_LDKSendErrorMessage_Body;
3651 typedef struct MUST_USE_STRUCT LDKErrorAction {
3652 LDKErrorAction_Tag tag;
3654 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
3655 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
3660 * The information we received from a peer along the route of a payment we originated. This is
3661 * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
3662 * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
3664 typedef enum LDKHTLCFailChannelUpdate_Tag {
3666 * We received an error which included a full ChannelUpdate message.
3668 LDKHTLCFailChannelUpdate_ChannelUpdateMessage,
3670 * We received an error which indicated only that a channel has been closed
3672 LDKHTLCFailChannelUpdate_ChannelClosed,
3674 * We received an error which indicated only that a node has failed
3676 LDKHTLCFailChannelUpdate_NodeFailure,
3678 * Must be last for serialization purposes
3680 LDKHTLCFailChannelUpdate_Sentinel,
3681 } LDKHTLCFailChannelUpdate_Tag;
3683 typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body {
3685 * The unwrapped message we received
3687 struct LDKChannelUpdate msg;
3688 } LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
3690 typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
3692 * The short_channel_id which has now closed.
3694 uint64_t short_channel_id;
3696 * when this true, this channel should be permanently removed from the
3697 * consideration. Otherwise, this channel can be restored as new channel_update is received
3700 } LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
3702 typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
3704 * The node_id that has failed.
3706 struct LDKPublicKey node_id;
3708 * when this true, node should be permanently removed from the
3709 * consideration. Otherwise, the channels connected to this node can be
3710 * restored as new channel_update is received
3713 } LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
3715 typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate {
3716 LDKHTLCFailChannelUpdate_Tag tag;
3718 LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message;
3719 LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed;
3720 LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure;
3722 } LDKHTLCFailChannelUpdate;
3727 * A query_channel_range message is used to query a peer for channel
3728 * UTXOs in a range of blocks. The recipient of a query makes a best
3729 * effort to reply to the query using one or more reply_channel_range
3732 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
3734 * A pointer to the opaque Rust object.
3735 * Nearly everywhere, inner must be non-null, however in places where
3736 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3738 LDKnativeQueryChannelRange *inner;
3740 * Indicates that this is the only struct which contains the same pointer.
3741 * Rust functions which take ownership of an object provided via an argument require
3742 * this to be true and invalidate the object pointed to by inner.
3745 } LDKQueryChannelRange;
3750 * A query_short_channel_ids message is used to query a peer for
3751 * routing gossip messages related to one or more short_channel_ids.
3752 * The query recipient will reply with the latest, if available,
3753 * channel_announcement, channel_update and node_announcement messages
3754 * it maintains for the requested short_channel_ids followed by a
3755 * reply_short_channel_ids_end message. The short_channel_ids sent in
3756 * this query are encoded. We only support encoding_type=0 uncompressed
3757 * serialization and do not support encoding_type=1 zlib serialization.
3759 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
3761 * A pointer to the opaque Rust object.
3762 * Nearly everywhere, inner must be non-null, however in places where
3763 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3765 LDKnativeQueryShortChannelIds *inner;
3767 * Indicates that this is the only struct which contains the same pointer.
3768 * Rust functions which take ownership of an object provided via an argument require
3769 * this to be true and invalidate the object pointed to by inner.
3772 } LDKQueryShortChannelIds;
3777 * A reply_channel_range message is a reply to a query_channel_range
3778 * message. Multiple reply_channel_range messages can be sent in reply
3779 * to a single query_channel_range message. The query recipient makes a
3780 * best effort to respond based on their local network view which may
3781 * not be a perfect view of the network. The short_channel_ids in the
3782 * reply are encoded. We only support encoding_type=0 uncompressed
3783 * serialization and do not support encoding_type=1 zlib serialization.
3785 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
3787 * A pointer to the opaque Rust object.
3788 * Nearly everywhere, inner must be non-null, however in places where
3789 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3791 LDKnativeReplyChannelRange *inner;
3793 * Indicates that this is the only struct which contains the same pointer.
3794 * Rust functions which take ownership of an object provided via an argument require
3795 * this to be true and invalidate the object pointed to by inner.
3798 } LDKReplyChannelRange;
3801 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
3802 * broadcast to most peers).
3803 * These events are handled by PeerManager::process_events if you are using a PeerManager.
3805 typedef enum LDKMessageSendEvent_Tag {
3807 * Used to indicate that we've accepted a channel open and should send the accept_channel
3808 * message provided to the given peer.
3810 LDKMessageSendEvent_SendAcceptChannel,
3812 * Used to indicate that we've initiated a channel open and should send the open_channel
3813 * message provided to the given peer.
3815 LDKMessageSendEvent_SendOpenChannel,
3817 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
3819 LDKMessageSendEvent_SendFundingCreated,
3821 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
3823 LDKMessageSendEvent_SendFundingSigned,
3825 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
3827 LDKMessageSendEvent_SendFundingLocked,
3829 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
3831 LDKMessageSendEvent_SendAnnouncementSignatures,
3833 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
3834 * message should be sent to the peer with the given node_id.
3836 LDKMessageSendEvent_UpdateHTLCs,
3838 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
3840 LDKMessageSendEvent_SendRevokeAndACK,
3842 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
3844 LDKMessageSendEvent_SendClosingSigned,
3846 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
3848 LDKMessageSendEvent_SendShutdown,
3850 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
3852 LDKMessageSendEvent_SendChannelReestablish,
3854 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
3855 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
3857 * Note that after doing so, you very likely (unless you did so very recently) want to call
3858 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
3859 * This ensures that any nodes which see our channel_announcement also have a relevant
3860 * node_announcement, including relevant feature flags which may be important for routing
3863 LDKMessageSendEvent_BroadcastChannelAnnouncement,
3865 * Used to indicate that a node_announcement should be broadcast to all peers.
3867 LDKMessageSendEvent_BroadcastNodeAnnouncement,
3869 * Used to indicate that a channel_update should be broadcast to all peers.
3871 LDKMessageSendEvent_BroadcastChannelUpdate,
3873 * Broadcast an error downstream to be handled
3875 LDKMessageSendEvent_HandleError,
3877 * When a payment fails we may receive updates back from the hop where it failed. In such
3878 * cases this event is generated so that we can inform the network graph of this information.
3880 LDKMessageSendEvent_PaymentFailureNetworkUpdate,
3882 * Query a peer for channels with funding transaction UTXOs in a block range.
3884 LDKMessageSendEvent_SendChannelRangeQuery,
3886 * Request routing gossip messages from a peer for a list of channels identified by
3887 * their short_channel_ids.
3889 LDKMessageSendEvent_SendShortIdsQuery,
3891 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
3892 * emitted during processing of the query.
3894 LDKMessageSendEvent_SendReplyChannelRange,
3896 * Must be last for serialization purposes
3898 LDKMessageSendEvent_Sentinel,
3899 } LDKMessageSendEvent_Tag;
3901 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
3903 * The node_id of the node which should receive this message
3905 struct LDKPublicKey node_id;
3907 * The message which should be sent.
3909 struct LDKAcceptChannel msg;
3910 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
3912 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
3914 * The node_id of the node which should receive this message
3916 struct LDKPublicKey node_id;
3918 * The message which should be sent.
3920 struct LDKOpenChannel msg;
3921 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
3923 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
3925 * The node_id of the node which should receive this message
3927 struct LDKPublicKey node_id;
3929 * The message which should be sent.
3931 struct LDKFundingCreated msg;
3932 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
3934 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
3936 * The node_id of the node which should receive this message
3938 struct LDKPublicKey node_id;
3940 * The message which should be sent.
3942 struct LDKFundingSigned msg;
3943 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
3945 typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
3947 * The node_id of the node which should receive these message(s)
3949 struct LDKPublicKey node_id;
3951 * The funding_locked message which should be sent.
3953 struct LDKFundingLocked msg;
3954 } LDKMessageSendEvent_LDKSendFundingLocked_Body;
3956 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
3958 * The node_id of the node which should receive these message(s)
3960 struct LDKPublicKey node_id;
3962 * The announcement_signatures message which should be sent.
3964 struct LDKAnnouncementSignatures msg;
3965 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
3967 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
3969 * The node_id of the node which should receive these message(s)
3971 struct LDKPublicKey node_id;
3973 * The update messages which should be sent. ALL messages in the struct should be sent!
3975 struct LDKCommitmentUpdate updates;
3976 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
3978 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
3980 * The node_id of the node which should receive this message
3982 struct LDKPublicKey node_id;
3984 * The message which should be sent.
3986 struct LDKRevokeAndACK msg;
3987 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
3989 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
3991 * The node_id of the node which should receive this message
3993 struct LDKPublicKey node_id;
3995 * The message which should be sent.
3997 struct LDKClosingSigned msg;
3998 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
4000 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
4002 * The node_id of the node which should receive this message
4004 struct LDKPublicKey node_id;
4006 * The message which should be sent.
4008 struct LDKShutdown msg;
4009 } LDKMessageSendEvent_LDKSendShutdown_Body;
4011 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
4013 * The node_id of the node which should receive this message
4015 struct LDKPublicKey node_id;
4017 * The message which should be sent.
4019 struct LDKChannelReestablish msg;
4020 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
4022 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
4024 * The channel_announcement which should be sent.
4026 struct LDKChannelAnnouncement msg;
4028 * The followup channel_update which should be sent.
4030 struct LDKChannelUpdate update_msg;
4031 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
4033 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
4035 * The node_announcement which should be sent.
4037 struct LDKNodeAnnouncement msg;
4038 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
4040 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
4042 * The channel_update which should be sent.
4044 struct LDKChannelUpdate msg;
4045 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
4047 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
4049 * The node_id of the node which should receive this message
4051 struct LDKPublicKey node_id;
4053 * The action which should be taken.
4055 struct LDKErrorAction action;
4056 } LDKMessageSendEvent_LDKHandleError_Body;
4058 typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
4060 * The channel/node update which should be sent to NetGraphMsgHandler
4062 struct LDKHTLCFailChannelUpdate update;
4063 } LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
4065 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
4067 * The node_id of this message recipient
4069 struct LDKPublicKey node_id;
4071 * The query_channel_range which should be sent.
4073 struct LDKQueryChannelRange msg;
4074 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
4076 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
4078 * The node_id of this message recipient
4080 struct LDKPublicKey node_id;
4082 * The query_short_channel_ids which should be sent.
4084 struct LDKQueryShortChannelIds msg;
4085 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
4087 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
4089 * The node_id of this message recipient
4091 struct LDKPublicKey node_id;
4093 * The reply_channel_range which should be sent.
4095 struct LDKReplyChannelRange msg;
4096 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
4098 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
4099 LDKMessageSendEvent_Tag tag;
4101 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
4102 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
4103 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
4104 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
4105 LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
4106 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
4107 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
4108 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
4109 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
4110 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
4111 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
4112 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
4113 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
4114 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
4115 LDKMessageSendEvent_LDKHandleError_Body handle_error;
4116 LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update;
4117 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
4118 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
4119 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
4121 } LDKMessageSendEvent;
4124 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
4125 * This corresponds to std::vector in C++
4127 typedef struct LDKCVec_MessageSendEventZ {
4129 * The elements in the array.
4130 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4132 struct LDKMessageSendEvent *data;
4134 * The number of elements pointed to by `data`.
4137 } LDKCVec_MessageSendEventZ;
4140 * The contents of CResult_boolLightningErrorZ
4142 typedef union LDKCResult_boolLightningErrorZPtr {
4144 * A pointer to the contents in the success state.
4145 * Reading from this pointer when `result_ok` is not set is undefined.
4149 * A pointer to the contents in the error state.
4150 * Reading from this pointer when `result_ok` is set is undefined.
4152 struct LDKLightningError *err;
4153 } LDKCResult_boolLightningErrorZPtr;
4156 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
4157 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
4158 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4160 typedef struct LDKCResult_boolLightningErrorZ {
4162 * The contents of this CResult_boolLightningErrorZ, accessible via either
4163 * `err` or `result` depending on the state of `result_ok`.
4165 union LDKCResult_boolLightningErrorZPtr contents;
4167 * Whether this CResult_boolLightningErrorZ represents a success state.
4170 } LDKCResult_boolLightningErrorZ;
4173 * A tuple of 3 elements. See the individual fields for the types contained.
4175 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
4177 * The element at position 0
4179 struct LDKChannelAnnouncement a;
4181 * The element at position 1
4183 struct LDKChannelUpdate b;
4185 * The element at position 2
4187 struct LDKChannelUpdate c;
4188 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
4191 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
4192 * This corresponds to std::vector in C++
4194 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
4196 * The elements in the array.
4197 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4199 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
4201 * The number of elements pointed to by `data`.
4204 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
4207 * A dynamically-allocated array of crate::lightning::ln::msgs::NodeAnnouncements of arbitrary size.
4208 * This corresponds to std::vector in C++
4210 typedef struct LDKCVec_NodeAnnouncementZ {
4212 * The elements in the array.
4213 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4215 struct LDKNodeAnnouncement *data;
4217 * The number of elements pointed to by `data`.
4220 } LDKCVec_NodeAnnouncementZ;
4223 * The contents of CResult_NoneLightningErrorZ
4225 typedef union LDKCResult_NoneLightningErrorZPtr {
4227 * Note that this value is always NULL, as there are no contents in the OK variant
4231 * A pointer to the contents in the error state.
4232 * Reading from this pointer when `result_ok` is set is undefined.
4234 struct LDKLightningError *err;
4235 } LDKCResult_NoneLightningErrorZPtr;
4238 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
4239 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
4240 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4242 typedef struct LDKCResult_NoneLightningErrorZ {
4244 * The contents of this CResult_NoneLightningErrorZ, accessible via either
4245 * `err` or `result` depending on the state of `result_ok`.
4247 union LDKCResult_NoneLightningErrorZPtr contents;
4249 * Whether this CResult_NoneLightningErrorZ represents a success state.
4252 } LDKCResult_NoneLightningErrorZ;
4255 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
4256 * This corresponds to std::vector in C++
4258 typedef struct LDKCVec_PublicKeyZ {
4260 * The elements in the array.
4261 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4263 struct LDKPublicKey *data;
4265 * The number of elements pointed to by `data`.
4268 } LDKCVec_PublicKeyZ;
4273 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
4274 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
4277 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
4279 * A pointer to the opaque Rust object.
4280 * Nearly everywhere, inner must be non-null, however in places where
4281 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4283 LDKnativePeerHandleError *inner;
4285 * Indicates that this is the only struct which contains the same pointer.
4286 * Rust functions which take ownership of an object provided via an argument require
4287 * this to be true and invalidate the object pointed to by inner.
4290 } LDKPeerHandleError;
4293 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
4295 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
4297 * A pointer to the contents in the success state.
4298 * Reading from this pointer when `result_ok` is not set is undefined.
4300 struct LDKCVec_u8Z *result;
4302 * A pointer to the contents in the error state.
4303 * Reading from this pointer when `result_ok` is set is undefined.
4305 struct LDKPeerHandleError *err;
4306 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
4309 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
4310 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
4311 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4313 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
4315 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
4316 * `err` or `result` depending on the state of `result_ok`.
4318 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
4320 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
4323 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
4326 * The contents of CResult_NonePeerHandleErrorZ
4328 typedef union LDKCResult_NonePeerHandleErrorZPtr {
4330 * Note that this value is always NULL, as there are no contents in the OK variant
4334 * A pointer to the contents in the error state.
4335 * Reading from this pointer when `result_ok` is set is undefined.
4337 struct LDKPeerHandleError *err;
4338 } LDKCResult_NonePeerHandleErrorZPtr;
4341 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
4342 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
4343 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4345 typedef struct LDKCResult_NonePeerHandleErrorZ {
4347 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
4348 * `err` or `result` depending on the state of `result_ok`.
4350 union LDKCResult_NonePeerHandleErrorZPtr contents;
4352 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
4355 } LDKCResult_NonePeerHandleErrorZ;
4358 * The contents of CResult_boolPeerHandleErrorZ
4360 typedef union LDKCResult_boolPeerHandleErrorZPtr {
4362 * A pointer to the contents in the success state.
4363 * Reading from this pointer when `result_ok` is not set is undefined.
4367 * A pointer to the contents in the error state.
4368 * Reading from this pointer when `result_ok` is set is undefined.
4370 struct LDKPeerHandleError *err;
4371 } LDKCResult_boolPeerHandleErrorZPtr;
4374 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
4375 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
4376 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4378 typedef struct LDKCResult_boolPeerHandleErrorZ {
4380 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
4381 * `err` or `result` depending on the state of `result_ok`.
4383 union LDKCResult_boolPeerHandleErrorZPtr contents;
4385 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
4388 } LDKCResult_boolPeerHandleErrorZ;
4391 * The contents of CResult_TxOutAccessErrorZ
4393 typedef union LDKCResult_TxOutAccessErrorZPtr {
4395 * A pointer to the contents in the success state.
4396 * Reading from this pointer when `result_ok` is not set is undefined.
4398 struct LDKTxOut *result;
4400 * A pointer to the contents in the error state.
4401 * Reading from this pointer when `result_ok` is set is undefined.
4403 enum LDKAccessError *err;
4404 } LDKCResult_TxOutAccessErrorZPtr;
4407 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
4408 * containing a crate::c_types::TxOut on success and a crate::lightning::chain::AccessError on failure.
4409 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4411 typedef struct LDKCResult_TxOutAccessErrorZ {
4413 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
4414 * `err` or `result` depending on the state of `result_ok`.
4416 union LDKCResult_TxOutAccessErrorZPtr contents;
4418 * Whether this CResult_TxOutAccessErrorZ represents a success state.
4421 } LDKCResult_TxOutAccessErrorZ;
4424 * An enum which can either contain a crate::c_types::derived::C2Tuple_usizeTransactionZ or not
4426 typedef enum LDKCOption_C2Tuple_usizeTransactionZZ_Tag {
4428 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains a crate::c_types::derived::C2Tuple_usizeTransactionZ
4430 LDKCOption_C2Tuple_usizeTransactionZZ_Some,
4432 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains nothing
4434 LDKCOption_C2Tuple_usizeTransactionZZ_None,
4436 * Must be last for serialization purposes
4438 LDKCOption_C2Tuple_usizeTransactionZZ_Sentinel,
4439 } LDKCOption_C2Tuple_usizeTransactionZZ_Tag;
4441 typedef struct LDKCOption_C2Tuple_usizeTransactionZZ {
4442 LDKCOption_C2Tuple_usizeTransactionZZ_Tag tag;
4445 struct LDKC2Tuple_usizeTransactionZ some;
4448 } LDKCOption_C2Tuple_usizeTransactionZZ;
4453 * Details about one direction of a channel. Received
4454 * within a channel update.
4456 typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
4458 * A pointer to the opaque Rust object.
4459 * Nearly everywhere, inner must be non-null, however in places where
4460 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4462 LDKnativeDirectionalChannelInfo *inner;
4464 * Indicates that this is the only struct which contains the same pointer.
4465 * Rust functions which take ownership of an object provided via an argument require
4466 * this to be true and invalidate the object pointed to by inner.
4469 } LDKDirectionalChannelInfo;
4472 * The contents of CResult_DirectionalChannelInfoDecodeErrorZ
4474 typedef union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr {
4476 * A pointer to the contents in the success state.
4477 * Reading from this pointer when `result_ok` is not set is undefined.
4479 struct LDKDirectionalChannelInfo *result;
4481 * A pointer to the contents in the error state.
4482 * Reading from this pointer when `result_ok` is set is undefined.
4484 struct LDKDecodeError *err;
4485 } LDKCResult_DirectionalChannelInfoDecodeErrorZPtr;
4488 * A CResult_DirectionalChannelInfoDecodeErrorZ represents the result of a fallible operation,
4489 * containing a crate::lightning::routing::network_graph::DirectionalChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4490 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4492 typedef struct LDKCResult_DirectionalChannelInfoDecodeErrorZ {
4494 * The contents of this CResult_DirectionalChannelInfoDecodeErrorZ, accessible via either
4495 * `err` or `result` depending on the state of `result_ok`.
4497 union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr contents;
4499 * Whether this CResult_DirectionalChannelInfoDecodeErrorZ represents a success state.
4502 } LDKCResult_DirectionalChannelInfoDecodeErrorZ;
4507 * Details about a channel (both directions).
4508 * Received within a channel announcement.
4510 typedef struct MUST_USE_STRUCT LDKChannelInfo {
4512 * A pointer to the opaque Rust object.
4513 * Nearly everywhere, inner must be non-null, however in places where
4514 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4516 LDKnativeChannelInfo *inner;
4518 * Indicates that this is the only struct which contains the same pointer.
4519 * Rust functions which take ownership of an object provided via an argument require
4520 * this to be true and invalidate the object pointed to by inner.
4526 * The contents of CResult_ChannelInfoDecodeErrorZ
4528 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
4530 * A pointer to the contents in the success state.
4531 * Reading from this pointer when `result_ok` is not set is undefined.
4533 struct LDKChannelInfo *result;
4535 * A pointer to the contents in the error state.
4536 * Reading from this pointer when `result_ok` is set is undefined.
4538 struct LDKDecodeError *err;
4539 } LDKCResult_ChannelInfoDecodeErrorZPtr;
4542 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
4543 * containing a crate::lightning::routing::network_graph::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4544 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4546 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
4548 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
4549 * `err` or `result` depending on the state of `result_ok`.
4551 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
4553 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
4556 } LDKCResult_ChannelInfoDecodeErrorZ;
4561 * Fees for routing via a given channel or a node
4563 typedef struct MUST_USE_STRUCT LDKRoutingFees {
4565 * A pointer to the opaque Rust object.
4566 * Nearly everywhere, inner must be non-null, however in places where
4567 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4569 LDKnativeRoutingFees *inner;
4571 * Indicates that this is the only struct which contains the same pointer.
4572 * Rust functions which take ownership of an object provided via an argument require
4573 * this to be true and invalidate the object pointed to by inner.
4579 * The contents of CResult_RoutingFeesDecodeErrorZ
4581 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
4583 * A pointer to the contents in the success state.
4584 * Reading from this pointer when `result_ok` is not set is undefined.
4586 struct LDKRoutingFees *result;
4588 * A pointer to the contents in the error state.
4589 * Reading from this pointer when `result_ok` is set is undefined.
4591 struct LDKDecodeError *err;
4592 } LDKCResult_RoutingFeesDecodeErrorZPtr;
4595 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
4596 * containing a crate::lightning::routing::network_graph::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
4597 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4599 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
4601 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
4602 * `err` or `result` depending on the state of `result_ok`.
4604 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
4606 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
4609 } LDKCResult_RoutingFeesDecodeErrorZ;
4612 * A 4-byte byte array.
4614 typedef struct LDKFourBytes {
4622 * A 16-byte byte array.
4624 typedef struct LDKSixteenBytes {
4632 * A 10-byte byte array.
4634 typedef struct LDKTenBytes {
4642 * An address which can be used to connect to a remote peer
4644 typedef enum LDKNetAddress_Tag {
4646 * An IPv4 address/port on which the peer is listening.
4650 * An IPv6 address/port on which the peer is listening.
4654 * An old-style Tor onion address/port on which the peer is listening.
4656 LDKNetAddress_OnionV2,
4658 * A new-style Tor onion address/port on which the peer is listening.
4659 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
4660 * wrap as base32 and append \".onion\".
4662 LDKNetAddress_OnionV3,
4664 * Must be last for serialization purposes
4666 LDKNetAddress_Sentinel,
4667 } LDKNetAddress_Tag;
4669 typedef struct LDKNetAddress_LDKIPv4_Body {
4671 * The 4-byte IPv4 address
4673 struct LDKFourBytes addr;
4675 * The port on which the node is listening
4678 } LDKNetAddress_LDKIPv4_Body;
4680 typedef struct LDKNetAddress_LDKIPv6_Body {
4682 * The 16-byte IPv6 address
4684 struct LDKSixteenBytes addr;
4686 * The port on which the node is listening
4689 } LDKNetAddress_LDKIPv6_Body;
4691 typedef struct LDKNetAddress_LDKOnionV2_Body {
4693 * The bytes (usually encoded in base32 with \".onion\" appended)
4695 struct LDKTenBytes addr;
4697 * The port on which the node is listening
4700 } LDKNetAddress_LDKOnionV2_Body;
4702 typedef struct LDKNetAddress_LDKOnionV3_Body {
4704 * The ed25519 long-term public key of the peer
4706 struct LDKThirtyTwoBytes ed25519_pubkey;
4708 * The checksum of the pubkey and version, as included in the onion address
4712 * The version byte, as defined by the Tor Onion v3 spec.
4716 * The port on which the node is listening
4719 } LDKNetAddress_LDKOnionV3_Body;
4721 typedef struct MUST_USE_STRUCT LDKNetAddress {
4722 LDKNetAddress_Tag tag;
4724 LDKNetAddress_LDKIPv4_Body i_pv4;
4725 LDKNetAddress_LDKIPv6_Body i_pv6;
4726 LDKNetAddress_LDKOnionV2_Body onion_v2;
4727 LDKNetAddress_LDKOnionV3_Body onion_v3;
4732 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
4733 * This corresponds to std::vector in C++
4735 typedef struct LDKCVec_NetAddressZ {
4737 * The elements in the array.
4738 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4740 struct LDKNetAddress *data;
4742 * The number of elements pointed to by `data`.
4745 } LDKCVec_NetAddressZ;
4750 * Information received in the latest node_announcement from this node.
4752 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
4754 * A pointer to the opaque Rust object.
4755 * Nearly everywhere, inner must be non-null, however in places where
4756 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4758 LDKnativeNodeAnnouncementInfo *inner;
4760 * Indicates that this is the only struct which contains the same pointer.
4761 * Rust functions which take ownership of an object provided via an argument require
4762 * this to be true and invalidate the object pointed to by inner.
4765 } LDKNodeAnnouncementInfo;
4768 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
4770 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
4772 * A pointer to the contents in the success state.
4773 * Reading from this pointer when `result_ok` is not set is undefined.
4775 struct LDKNodeAnnouncementInfo *result;
4777 * A pointer to the contents in the error state.
4778 * Reading from this pointer when `result_ok` is set is undefined.
4780 struct LDKDecodeError *err;
4781 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
4784 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
4785 * containing a crate::lightning::routing::network_graph::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4786 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4788 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
4790 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
4791 * `err` or `result` depending on the state of `result_ok`.
4793 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
4795 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
4798 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
4801 * A dynamically-allocated array of u64s of arbitrary size.
4802 * This corresponds to std::vector in C++
4804 typedef struct LDKCVec_u64Z {
4806 * The elements in the array.
4807 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4811 * The number of elements pointed to by `data`.
4819 * Details about a node in the network, known from the network announcement.
4821 typedef struct MUST_USE_STRUCT LDKNodeInfo {
4823 * A pointer to the opaque Rust object.
4824 * Nearly everywhere, inner must be non-null, however in places where
4825 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4827 LDKnativeNodeInfo *inner;
4829 * Indicates that this is the only struct which contains the same pointer.
4830 * Rust functions which take ownership of an object provided via an argument require
4831 * this to be true and invalidate the object pointed to by inner.
4837 * The contents of CResult_NodeInfoDecodeErrorZ
4839 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
4841 * A pointer to the contents in the success state.
4842 * Reading from this pointer when `result_ok` is not set is undefined.
4844 struct LDKNodeInfo *result;
4846 * A pointer to the contents in the error state.
4847 * Reading from this pointer when `result_ok` is set is undefined.
4849 struct LDKDecodeError *err;
4850 } LDKCResult_NodeInfoDecodeErrorZPtr;
4853 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
4854 * containing a crate::lightning::routing::network_graph::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4855 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4857 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
4859 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
4860 * `err` or `result` depending on the state of `result_ok`.
4862 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
4864 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
4867 } LDKCResult_NodeInfoDecodeErrorZ;
4872 * Represents the network as nodes and channels between them
4874 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
4876 * A pointer to the opaque Rust object.
4877 * Nearly everywhere, inner must be non-null, however in places where
4878 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4880 LDKnativeNetworkGraph *inner;
4882 * Indicates that this is the only struct which contains the same pointer.
4883 * Rust functions which take ownership of an object provided via an argument require
4884 * this to be true and invalidate the object pointed to by inner.
4890 * The contents of CResult_NetworkGraphDecodeErrorZ
4892 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
4894 * A pointer to the contents in the success state.
4895 * Reading from this pointer when `result_ok` is not set is undefined.
4897 struct LDKNetworkGraph *result;
4899 * A pointer to the contents in the error state.
4900 * Reading from this pointer when `result_ok` is set is undefined.
4902 struct LDKDecodeError *err;
4903 } LDKCResult_NetworkGraphDecodeErrorZPtr;
4906 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
4907 * containing a crate::lightning::routing::network_graph::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
4908 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4910 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
4912 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
4913 * `err` or `result` depending on the state of `result_ok`.
4915 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
4917 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
4920 } LDKCResult_NetworkGraphDecodeErrorZ;
4925 * Features used within an `init` message.
4927 typedef struct MUST_USE_STRUCT LDKInitFeatures {
4929 * A pointer to the opaque Rust object.
4930 * Nearly everywhere, inner must be non-null, however in places where
4931 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4933 LDKnativeInitFeatures *inner;
4935 * Indicates that this is the only struct which contains the same pointer.
4936 * Rust functions which take ownership of an object provided via an argument require
4937 * this to be true and invalidate the object pointed to by inner.
4943 * The contents of CResult_InitFeaturesDecodeErrorZ
4945 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
4947 * A pointer to the contents in the success state.
4948 * Reading from this pointer when `result_ok` is not set is undefined.
4950 struct LDKInitFeatures *result;
4952 * A pointer to the contents in the error state.
4953 * Reading from this pointer when `result_ok` is set is undefined.
4955 struct LDKDecodeError *err;
4956 } LDKCResult_InitFeaturesDecodeErrorZPtr;
4959 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
4960 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4961 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4963 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
4965 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
4966 * `err` or `result` depending on the state of `result_ok`.
4968 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
4970 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
4973 } LDKCResult_InitFeaturesDecodeErrorZ;
4978 * Features used within a `node_announcement` message.
4980 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
4982 * A pointer to the opaque Rust object.
4983 * Nearly everywhere, inner must be non-null, however in places where
4984 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4986 LDKnativeNodeFeatures *inner;
4988 * Indicates that this is the only struct which contains the same pointer.
4989 * Rust functions which take ownership of an object provided via an argument require
4990 * this to be true and invalidate the object pointed to by inner.
4996 * The contents of CResult_NodeFeaturesDecodeErrorZ
4998 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
5000 * A pointer to the contents in the success state.
5001 * Reading from this pointer when `result_ok` is not set is undefined.
5003 struct LDKNodeFeatures *result;
5005 * A pointer to the contents in the error state.
5006 * Reading from this pointer when `result_ok` is set is undefined.
5008 struct LDKDecodeError *err;
5009 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
5012 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
5013 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5014 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5016 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
5018 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
5019 * `err` or `result` depending on the state of `result_ok`.
5021 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
5023 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
5026 } LDKCResult_NodeFeaturesDecodeErrorZ;
5031 * Features used within a `channel_announcement` message.
5033 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
5035 * A pointer to the opaque Rust object.
5036 * Nearly everywhere, inner must be non-null, however in places where
5037 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5039 LDKnativeChannelFeatures *inner;
5041 * Indicates that this is the only struct which contains the same pointer.
5042 * Rust functions which take ownership of an object provided via an argument require
5043 * this to be true and invalidate the object pointed to by inner.
5046 } LDKChannelFeatures;
5049 * The contents of CResult_ChannelFeaturesDecodeErrorZ
5051 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
5053 * A pointer to the contents in the success state.
5054 * Reading from this pointer when `result_ok` is not set is undefined.
5056 struct LDKChannelFeatures *result;
5058 * A pointer to the contents in the error state.
5059 * Reading from this pointer when `result_ok` is set is undefined.
5061 struct LDKDecodeError *err;
5062 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
5065 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
5066 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5067 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5069 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
5071 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
5072 * `err` or `result` depending on the state of `result_ok`.
5074 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
5076 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
5079 } LDKCResult_ChannelFeaturesDecodeErrorZ;
5084 * Features used within an invoice.
5086 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
5088 * A pointer to the opaque Rust object.
5089 * Nearly everywhere, inner must be non-null, however in places where
5090 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5092 LDKnativeInvoiceFeatures *inner;
5094 * Indicates that this is the only struct which contains the same pointer.
5095 * Rust functions which take ownership of an object provided via an argument require
5096 * this to be true and invalidate the object pointed to by inner.
5099 } LDKInvoiceFeatures;
5102 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
5104 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
5106 * A pointer to the contents in the success state.
5107 * Reading from this pointer when `result_ok` is not set is undefined.
5109 struct LDKInvoiceFeatures *result;
5111 * A pointer to the contents in the error state.
5112 * Reading from this pointer when `result_ok` is set is undefined.
5114 struct LDKDecodeError *err;
5115 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
5118 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
5119 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5120 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5122 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
5124 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
5125 * `err` or `result` depending on the state of `result_ok`.
5127 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
5129 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
5132 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
5135 * The contents of CResult_NetAddressu8Z
5137 typedef union LDKCResult_NetAddressu8ZPtr {
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 LDKNetAddress *result;
5144 * A pointer to the contents in the error state.
5145 * Reading from this pointer when `result_ok` is set is undefined.
5148 } LDKCResult_NetAddressu8ZPtr;
5151 * A CResult_NetAddressu8Z represents the result of a fallible operation,
5152 * containing a crate::lightning::ln::msgs::NetAddress on success and a u8 on failure.
5153 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5155 typedef struct LDKCResult_NetAddressu8Z {
5157 * The contents of this CResult_NetAddressu8Z, accessible via either
5158 * `err` or `result` depending on the state of `result_ok`.
5160 union LDKCResult_NetAddressu8ZPtr contents;
5162 * Whether this CResult_NetAddressu8Z represents a success state.
5165 } LDKCResult_NetAddressu8Z;
5168 * The contents of CResult_CResult_NetAddressu8ZDecodeErrorZ
5170 typedef union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr {
5172 * A pointer to the contents in the success state.
5173 * Reading from this pointer when `result_ok` is not set is undefined.
5175 struct LDKCResult_NetAddressu8Z *result;
5177 * A pointer to the contents in the error state.
5178 * Reading from this pointer when `result_ok` is set is undefined.
5180 struct LDKDecodeError *err;
5181 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr;
5184 * A CResult_CResult_NetAddressu8ZDecodeErrorZ represents the result of a fallible operation,
5185 * containing a crate::c_types::derived::CResult_NetAddressu8Z on success and a crate::lightning::ln::msgs::DecodeError on failure.
5186 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5188 typedef struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ {
5190 * The contents of this CResult_CResult_NetAddressu8ZDecodeErrorZ, accessible via either
5191 * `err` or `result` depending on the state of `result_ok`.
5193 union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr contents;
5195 * Whether this CResult_CResult_NetAddressu8ZDecodeErrorZ represents a success state.
5198 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZ;
5203 * An update_add_htlc message to be sent or received from a peer
5205 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
5207 * A pointer to the opaque Rust object.
5208 * Nearly everywhere, inner must be non-null, however in places where
5209 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5211 LDKnativeUpdateAddHTLC *inner;
5213 * Indicates that this is the only struct which contains the same pointer.
5214 * Rust functions which take ownership of an object provided via an argument require
5215 * this to be true and invalidate the object pointed to by inner.
5221 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
5222 * This corresponds to std::vector in C++
5224 typedef struct LDKCVec_UpdateAddHTLCZ {
5226 * The elements in the array.
5227 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5229 struct LDKUpdateAddHTLC *data;
5231 * The number of elements pointed to by `data`.
5234 } LDKCVec_UpdateAddHTLCZ;
5239 * An update_fulfill_htlc message to be sent or received from a peer
5241 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
5243 * A pointer to the opaque Rust object.
5244 * Nearly everywhere, inner must be non-null, however in places where
5245 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5247 LDKnativeUpdateFulfillHTLC *inner;
5249 * Indicates that this is the only struct which contains the same pointer.
5250 * Rust functions which take ownership of an object provided via an argument require
5251 * this to be true and invalidate the object pointed to by inner.
5254 } LDKUpdateFulfillHTLC;
5257 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
5258 * This corresponds to std::vector in C++
5260 typedef struct LDKCVec_UpdateFulfillHTLCZ {
5262 * The elements in the array.
5263 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5265 struct LDKUpdateFulfillHTLC *data;
5267 * The number of elements pointed to by `data`.
5270 } LDKCVec_UpdateFulfillHTLCZ;
5275 * An update_fail_htlc message to be sent or received from a peer
5277 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
5279 * A pointer to the opaque Rust object.
5280 * Nearly everywhere, inner must be non-null, however in places where
5281 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5283 LDKnativeUpdateFailHTLC *inner;
5285 * Indicates that this is the only struct which contains the same pointer.
5286 * Rust functions which take ownership of an object provided via an argument require
5287 * this to be true and invalidate the object pointed to by inner.
5290 } LDKUpdateFailHTLC;
5293 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
5294 * This corresponds to std::vector in C++
5296 typedef struct LDKCVec_UpdateFailHTLCZ {
5298 * The elements in the array.
5299 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5301 struct LDKUpdateFailHTLC *data;
5303 * The number of elements pointed to by `data`.
5306 } LDKCVec_UpdateFailHTLCZ;
5311 * An update_fail_malformed_htlc message to be sent or received from a peer
5313 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
5315 * A pointer to the opaque Rust object.
5316 * Nearly everywhere, inner must be non-null, however in places where
5317 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5319 LDKnativeUpdateFailMalformedHTLC *inner;
5321 * Indicates that this is the only struct which contains the same pointer.
5322 * Rust functions which take ownership of an object provided via an argument require
5323 * this to be true and invalidate the object pointed to by inner.
5326 } LDKUpdateFailMalformedHTLC;
5329 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
5330 * This corresponds to std::vector in C++
5332 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
5334 * The elements in the array.
5335 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5337 struct LDKUpdateFailMalformedHTLC *data;
5339 * The number of elements pointed to by `data`.
5342 } LDKCVec_UpdateFailMalformedHTLCZ;
5345 * The contents of CResult_AcceptChannelDecodeErrorZ
5347 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
5349 * A pointer to the contents in the success state.
5350 * Reading from this pointer when `result_ok` is not set is undefined.
5352 struct LDKAcceptChannel *result;
5354 * A pointer to the contents in the error state.
5355 * Reading from this pointer when `result_ok` is set is undefined.
5357 struct LDKDecodeError *err;
5358 } LDKCResult_AcceptChannelDecodeErrorZPtr;
5361 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
5362 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
5363 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5365 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
5367 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
5368 * `err` or `result` depending on the state of `result_ok`.
5370 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
5372 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
5375 } LDKCResult_AcceptChannelDecodeErrorZ;
5378 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
5380 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
5382 * A pointer to the contents in the success state.
5383 * Reading from this pointer when `result_ok` is not set is undefined.
5385 struct LDKAnnouncementSignatures *result;
5387 * A pointer to the contents in the error state.
5388 * Reading from this pointer when `result_ok` is set is undefined.
5390 struct LDKDecodeError *err;
5391 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
5394 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
5395 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5396 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5398 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
5400 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
5401 * `err` or `result` depending on the state of `result_ok`.
5403 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
5405 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
5408 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
5411 * The contents of CResult_ChannelReestablishDecodeErrorZ
5413 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
5415 * A pointer to the contents in the success state.
5416 * Reading from this pointer when `result_ok` is not set is undefined.
5418 struct LDKChannelReestablish *result;
5420 * A pointer to the contents in the error state.
5421 * Reading from this pointer when `result_ok` is set is undefined.
5423 struct LDKDecodeError *err;
5424 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
5427 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
5428 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
5429 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5431 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
5433 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
5434 * `err` or `result` depending on the state of `result_ok`.
5436 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
5438 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
5441 } LDKCResult_ChannelReestablishDecodeErrorZ;
5444 * The contents of CResult_ClosingSignedDecodeErrorZ
5446 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
5448 * A pointer to the contents in the success state.
5449 * Reading from this pointer when `result_ok` is not set is undefined.
5451 struct LDKClosingSigned *result;
5453 * A pointer to the contents in the error state.
5454 * Reading from this pointer when `result_ok` is set is undefined.
5456 struct LDKDecodeError *err;
5457 } LDKCResult_ClosingSignedDecodeErrorZPtr;
5460 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
5461 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
5462 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5464 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
5466 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
5467 * `err` or `result` depending on the state of `result_ok`.
5469 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
5471 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
5474 } LDKCResult_ClosingSignedDecodeErrorZ;
5479 * A commitment_signed message to be sent or received from a peer
5481 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
5483 * A pointer to the opaque Rust object.
5484 * Nearly everywhere, inner must be non-null, however in places where
5485 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5487 LDKnativeCommitmentSigned *inner;
5489 * Indicates that this is the only struct which contains the same pointer.
5490 * Rust functions which take ownership of an object provided via an argument require
5491 * this to be true and invalidate the object pointed to by inner.
5494 } LDKCommitmentSigned;
5497 * The contents of CResult_CommitmentSignedDecodeErrorZ
5499 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
5501 * A pointer to the contents in the success state.
5502 * Reading from this pointer when `result_ok` is not set is undefined.
5504 struct LDKCommitmentSigned *result;
5506 * A pointer to the contents in the error state.
5507 * Reading from this pointer when `result_ok` is set is undefined.
5509 struct LDKDecodeError *err;
5510 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
5513 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
5514 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
5515 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5517 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
5519 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
5520 * `err` or `result` depending on the state of `result_ok`.
5522 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
5524 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
5527 } LDKCResult_CommitmentSignedDecodeErrorZ;
5530 * The contents of CResult_FundingCreatedDecodeErrorZ
5532 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
5534 * A pointer to the contents in the success state.
5535 * Reading from this pointer when `result_ok` is not set is undefined.
5537 struct LDKFundingCreated *result;
5539 * A pointer to the contents in the error state.
5540 * Reading from this pointer when `result_ok` is set is undefined.
5542 struct LDKDecodeError *err;
5543 } LDKCResult_FundingCreatedDecodeErrorZPtr;
5546 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
5547 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
5548 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5550 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
5552 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
5553 * `err` or `result` depending on the state of `result_ok`.
5555 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
5557 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
5560 } LDKCResult_FundingCreatedDecodeErrorZ;
5563 * The contents of CResult_FundingSignedDecodeErrorZ
5565 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
5567 * A pointer to the contents in the success state.
5568 * Reading from this pointer when `result_ok` is not set is undefined.
5570 struct LDKFundingSigned *result;
5572 * A pointer to the contents in the error state.
5573 * Reading from this pointer when `result_ok` is set is undefined.
5575 struct LDKDecodeError *err;
5576 } LDKCResult_FundingSignedDecodeErrorZPtr;
5579 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
5580 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
5581 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5583 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
5585 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
5586 * `err` or `result` depending on the state of `result_ok`.
5588 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
5590 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
5593 } LDKCResult_FundingSignedDecodeErrorZ;
5596 * The contents of CResult_FundingLockedDecodeErrorZ
5598 typedef union LDKCResult_FundingLockedDecodeErrorZPtr {
5600 * A pointer to the contents in the success state.
5601 * Reading from this pointer when `result_ok` is not set is undefined.
5603 struct LDKFundingLocked *result;
5605 * A pointer to the contents in the error state.
5606 * Reading from this pointer when `result_ok` is set is undefined.
5608 struct LDKDecodeError *err;
5609 } LDKCResult_FundingLockedDecodeErrorZPtr;
5612 * A CResult_FundingLockedDecodeErrorZ represents the result of a fallible operation,
5613 * containing a crate::lightning::ln::msgs::FundingLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
5614 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5616 typedef struct LDKCResult_FundingLockedDecodeErrorZ {
5618 * The contents of this CResult_FundingLockedDecodeErrorZ, accessible via either
5619 * `err` or `result` depending on the state of `result_ok`.
5621 union LDKCResult_FundingLockedDecodeErrorZPtr contents;
5623 * Whether this CResult_FundingLockedDecodeErrorZ represents a success state.
5626 } LDKCResult_FundingLockedDecodeErrorZ;
5631 * An init message to be sent or received from a peer
5633 typedef struct MUST_USE_STRUCT LDKInit {
5635 * A pointer to the opaque Rust object.
5636 * Nearly everywhere, inner must be non-null, however in places where
5637 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5639 LDKnativeInit *inner;
5641 * Indicates that this is the only struct which contains the same pointer.
5642 * Rust functions which take ownership of an object provided via an argument require
5643 * this to be true and invalidate the object pointed to by inner.
5649 * The contents of CResult_InitDecodeErrorZ
5651 typedef union LDKCResult_InitDecodeErrorZPtr {
5653 * A pointer to the contents in the success state.
5654 * Reading from this pointer when `result_ok` is not set is undefined.
5656 struct LDKInit *result;
5658 * A pointer to the contents in the error state.
5659 * Reading from this pointer when `result_ok` is set is undefined.
5661 struct LDKDecodeError *err;
5662 } LDKCResult_InitDecodeErrorZPtr;
5665 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
5666 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
5667 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5669 typedef struct LDKCResult_InitDecodeErrorZ {
5671 * The contents of this CResult_InitDecodeErrorZ, accessible via either
5672 * `err` or `result` depending on the state of `result_ok`.
5674 union LDKCResult_InitDecodeErrorZPtr contents;
5676 * Whether this CResult_InitDecodeErrorZ represents a success state.
5679 } LDKCResult_InitDecodeErrorZ;
5682 * The contents of CResult_OpenChannelDecodeErrorZ
5684 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
5686 * A pointer to the contents in the success state.
5687 * Reading from this pointer when `result_ok` is not set is undefined.
5689 struct LDKOpenChannel *result;
5691 * A pointer to the contents in the error state.
5692 * Reading from this pointer when `result_ok` is set is undefined.
5694 struct LDKDecodeError *err;
5695 } LDKCResult_OpenChannelDecodeErrorZPtr;
5698 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
5699 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
5700 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5702 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
5704 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
5705 * `err` or `result` depending on the state of `result_ok`.
5707 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
5709 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
5712 } LDKCResult_OpenChannelDecodeErrorZ;
5715 * The contents of CResult_RevokeAndACKDecodeErrorZ
5717 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
5719 * A pointer to the contents in the success state.
5720 * Reading from this pointer when `result_ok` is not set is undefined.
5722 struct LDKRevokeAndACK *result;
5724 * A pointer to the contents in the error state.
5725 * Reading from this pointer when `result_ok` is set is undefined.
5727 struct LDKDecodeError *err;
5728 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
5731 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
5732 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
5733 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5735 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
5737 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
5738 * `err` or `result` depending on the state of `result_ok`.
5740 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
5742 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
5745 } LDKCResult_RevokeAndACKDecodeErrorZ;
5748 * The contents of CResult_ShutdownDecodeErrorZ
5750 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
5752 * A pointer to the contents in the success state.
5753 * Reading from this pointer when `result_ok` is not set is undefined.
5755 struct LDKShutdown *result;
5757 * A pointer to the contents in the error state.
5758 * Reading from this pointer when `result_ok` is set is undefined.
5760 struct LDKDecodeError *err;
5761 } LDKCResult_ShutdownDecodeErrorZPtr;
5764 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
5765 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
5766 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5768 typedef struct LDKCResult_ShutdownDecodeErrorZ {
5770 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
5771 * `err` or `result` depending on the state of `result_ok`.
5773 union LDKCResult_ShutdownDecodeErrorZPtr contents;
5775 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
5778 } LDKCResult_ShutdownDecodeErrorZ;
5781 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
5783 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
5785 * A pointer to the contents in the success state.
5786 * Reading from this pointer when `result_ok` is not set is undefined.
5788 struct LDKUpdateFailHTLC *result;
5790 * A pointer to the contents in the error state.
5791 * Reading from this pointer when `result_ok` is set is undefined.
5793 struct LDKDecodeError *err;
5794 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
5797 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
5798 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5799 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5801 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
5803 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
5804 * `err` or `result` depending on the state of `result_ok`.
5806 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
5808 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
5811 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
5814 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
5816 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5818 * A pointer to the contents in the success state.
5819 * Reading from this pointer when `result_ok` is not set is undefined.
5821 struct LDKUpdateFailMalformedHTLC *result;
5823 * A pointer to the contents in the error state.
5824 * Reading from this pointer when `result_ok` is set is undefined.
5826 struct LDKDecodeError *err;
5827 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
5830 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
5831 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5832 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5834 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
5836 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
5837 * `err` or `result` depending on the state of `result_ok`.
5839 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
5841 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
5844 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
5849 * An update_fee message to be sent or received from a peer
5851 typedef struct MUST_USE_STRUCT LDKUpdateFee {
5853 * A pointer to the opaque Rust object.
5854 * Nearly everywhere, inner must be non-null, however in places where
5855 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5857 LDKnativeUpdateFee *inner;
5859 * Indicates that this is the only struct which contains the same pointer.
5860 * Rust functions which take ownership of an object provided via an argument require
5861 * this to be true and invalidate the object pointed to by inner.
5867 * The contents of CResult_UpdateFeeDecodeErrorZ
5869 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
5871 * A pointer to the contents in the success state.
5872 * Reading from this pointer when `result_ok` is not set is undefined.
5874 struct LDKUpdateFee *result;
5876 * A pointer to the contents in the error state.
5877 * Reading from this pointer when `result_ok` is set is undefined.
5879 struct LDKDecodeError *err;
5880 } LDKCResult_UpdateFeeDecodeErrorZPtr;
5883 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
5884 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
5885 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5887 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
5889 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
5890 * `err` or `result` depending on the state of `result_ok`.
5892 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
5894 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
5897 } LDKCResult_UpdateFeeDecodeErrorZ;
5900 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
5902 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
5904 * A pointer to the contents in the success state.
5905 * Reading from this pointer when `result_ok` is not set is undefined.
5907 struct LDKUpdateFulfillHTLC *result;
5909 * A pointer to the contents in the error state.
5910 * Reading from this pointer when `result_ok` is set is undefined.
5912 struct LDKDecodeError *err;
5913 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
5916 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
5917 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5918 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5920 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
5922 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
5923 * `err` or `result` depending on the state of `result_ok`.
5925 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
5927 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
5930 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
5933 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
5935 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
5937 * A pointer to the contents in the success state.
5938 * Reading from this pointer when `result_ok` is not set is undefined.
5940 struct LDKUpdateAddHTLC *result;
5942 * A pointer to the contents in the error state.
5943 * Reading from this pointer when `result_ok` is set is undefined.
5945 struct LDKDecodeError *err;
5946 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
5949 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
5950 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5951 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5953 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
5955 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
5956 * `err` or `result` depending on the state of `result_ok`.
5958 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
5960 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
5963 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
5968 * A ping message to be sent or received from a peer
5970 typedef struct MUST_USE_STRUCT LDKPing {
5972 * A pointer to the opaque Rust object.
5973 * Nearly everywhere, inner must be non-null, however in places where
5974 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5976 LDKnativePing *inner;
5978 * Indicates that this is the only struct which contains the same pointer.
5979 * Rust functions which take ownership of an object provided via an argument require
5980 * this to be true and invalidate the object pointed to by inner.
5986 * The contents of CResult_PingDecodeErrorZ
5988 typedef union LDKCResult_PingDecodeErrorZPtr {
5990 * A pointer to the contents in the success state.
5991 * Reading from this pointer when `result_ok` is not set is undefined.
5993 struct LDKPing *result;
5995 * A pointer to the contents in the error state.
5996 * Reading from this pointer when `result_ok` is set is undefined.
5998 struct LDKDecodeError *err;
5999 } LDKCResult_PingDecodeErrorZPtr;
6002 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
6003 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
6004 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6006 typedef struct LDKCResult_PingDecodeErrorZ {
6008 * The contents of this CResult_PingDecodeErrorZ, accessible via either
6009 * `err` or `result` depending on the state of `result_ok`.
6011 union LDKCResult_PingDecodeErrorZPtr contents;
6013 * Whether this CResult_PingDecodeErrorZ represents a success state.
6016 } LDKCResult_PingDecodeErrorZ;
6021 * A pong message to be sent or received from a peer
6023 typedef struct MUST_USE_STRUCT LDKPong {
6025 * A pointer to the opaque Rust object.
6026 * Nearly everywhere, inner must be non-null, however in places where
6027 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6029 LDKnativePong *inner;
6031 * Indicates that this is the only struct which contains the same pointer.
6032 * Rust functions which take ownership of an object provided via an argument require
6033 * this to be true and invalidate the object pointed to by inner.
6039 * The contents of CResult_PongDecodeErrorZ
6041 typedef union LDKCResult_PongDecodeErrorZPtr {
6043 * A pointer to the contents in the success state.
6044 * Reading from this pointer when `result_ok` is not set is undefined.
6046 struct LDKPong *result;
6048 * A pointer to the contents in the error state.
6049 * Reading from this pointer when `result_ok` is set is undefined.
6051 struct LDKDecodeError *err;
6052 } LDKCResult_PongDecodeErrorZPtr;
6055 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
6056 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
6057 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6059 typedef struct LDKCResult_PongDecodeErrorZ {
6061 * The contents of this CResult_PongDecodeErrorZ, accessible via either
6062 * `err` or `result` depending on the state of `result_ok`.
6064 union LDKCResult_PongDecodeErrorZPtr contents;
6066 * Whether this CResult_PongDecodeErrorZ represents a success state.
6069 } LDKCResult_PongDecodeErrorZ;
6072 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
6074 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
6076 * A pointer to the contents in the success state.
6077 * Reading from this pointer when `result_ok` is not set is undefined.
6079 struct LDKUnsignedChannelAnnouncement *result;
6081 * A pointer to the contents in the error state.
6082 * Reading from this pointer when `result_ok` is set is undefined.
6084 struct LDKDecodeError *err;
6085 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
6088 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
6089 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
6090 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6092 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
6094 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
6095 * `err` or `result` depending on the state of `result_ok`.
6097 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
6099 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
6102 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
6105 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
6107 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
6109 * A pointer to the contents in the success state.
6110 * Reading from this pointer when `result_ok` is not set is undefined.
6112 struct LDKChannelAnnouncement *result;
6114 * A pointer to the contents in the error state.
6115 * Reading from this pointer when `result_ok` is set is undefined.
6117 struct LDKDecodeError *err;
6118 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
6121 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
6122 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
6123 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6125 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
6127 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
6128 * `err` or `result` depending on the state of `result_ok`.
6130 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
6132 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
6135 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
6140 * The unsigned part of a channel_update
6142 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
6144 * A pointer to the opaque Rust object.
6145 * Nearly everywhere, inner must be non-null, however in places where
6146 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6148 LDKnativeUnsignedChannelUpdate *inner;
6150 * Indicates that this is the only struct which contains the same pointer.
6151 * Rust functions which take ownership of an object provided via an argument require
6152 * this to be true and invalidate the object pointed to by inner.
6155 } LDKUnsignedChannelUpdate;
6158 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
6160 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
6162 * A pointer to the contents in the success state.
6163 * Reading from this pointer when `result_ok` is not set is undefined.
6165 struct LDKUnsignedChannelUpdate *result;
6167 * A pointer to the contents in the error state.
6168 * Reading from this pointer when `result_ok` is set is undefined.
6170 struct LDKDecodeError *err;
6171 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
6174 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
6175 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
6176 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6178 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
6180 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
6181 * `err` or `result` depending on the state of `result_ok`.
6183 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
6185 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
6188 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
6191 * The contents of CResult_ChannelUpdateDecodeErrorZ
6193 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
6195 * A pointer to the contents in the success state.
6196 * Reading from this pointer when `result_ok` is not set is undefined.
6198 struct LDKChannelUpdate *result;
6200 * A pointer to the contents in the error state.
6201 * Reading from this pointer when `result_ok` is set is undefined.
6203 struct LDKDecodeError *err;
6204 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
6207 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
6208 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
6209 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6211 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
6213 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
6214 * `err` or `result` depending on the state of `result_ok`.
6216 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
6218 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
6221 } LDKCResult_ChannelUpdateDecodeErrorZ;
6224 * The contents of CResult_ErrorMessageDecodeErrorZ
6226 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
6228 * A pointer to the contents in the success state.
6229 * Reading from this pointer when `result_ok` is not set is undefined.
6231 struct LDKErrorMessage *result;
6233 * A pointer to the contents in the error state.
6234 * Reading from this pointer when `result_ok` is set is undefined.
6236 struct LDKDecodeError *err;
6237 } LDKCResult_ErrorMessageDecodeErrorZPtr;
6240 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
6241 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
6242 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6244 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
6246 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
6247 * `err` or `result` depending on the state of `result_ok`.
6249 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
6251 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
6254 } LDKCResult_ErrorMessageDecodeErrorZ;
6259 * The unsigned part of a node_announcement
6261 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
6263 * A pointer to the opaque Rust object.
6264 * Nearly everywhere, inner must be non-null, however in places where
6265 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6267 LDKnativeUnsignedNodeAnnouncement *inner;
6269 * Indicates that this is the only struct which contains the same pointer.
6270 * Rust functions which take ownership of an object provided via an argument require
6271 * this to be true and invalidate the object pointed to by inner.
6274 } LDKUnsignedNodeAnnouncement;
6277 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
6279 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
6281 * A pointer to the contents in the success state.
6282 * Reading from this pointer when `result_ok` is not set is undefined.
6284 struct LDKUnsignedNodeAnnouncement *result;
6286 * A pointer to the contents in the error state.
6287 * Reading from this pointer when `result_ok` is set is undefined.
6289 struct LDKDecodeError *err;
6290 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
6293 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
6294 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
6295 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6297 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
6299 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
6300 * `err` or `result` depending on the state of `result_ok`.
6302 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
6304 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
6307 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
6310 * The contents of CResult_NodeAnnouncementDecodeErrorZ
6312 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
6314 * A pointer to the contents in the success state.
6315 * Reading from this pointer when `result_ok` is not set is undefined.
6317 struct LDKNodeAnnouncement *result;
6319 * A pointer to the contents in the error state.
6320 * Reading from this pointer when `result_ok` is set is undefined.
6322 struct LDKDecodeError *err;
6323 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
6326 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
6327 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
6328 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6330 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
6332 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
6333 * `err` or `result` depending on the state of `result_ok`.
6335 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
6337 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
6340 } LDKCResult_NodeAnnouncementDecodeErrorZ;
6343 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
6345 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
6347 * A pointer to the contents in the success state.
6348 * Reading from this pointer when `result_ok` is not set is undefined.
6350 struct LDKQueryShortChannelIds *result;
6352 * A pointer to the contents in the error state.
6353 * Reading from this pointer when `result_ok` is set is undefined.
6355 struct LDKDecodeError *err;
6356 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
6359 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
6360 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
6361 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6363 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
6365 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
6366 * `err` or `result` depending on the state of `result_ok`.
6368 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
6370 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
6373 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
6378 * A reply_short_channel_ids_end message is sent as a reply to a
6379 * query_short_channel_ids message. The query recipient makes a best
6380 * effort to respond based on their local network view which may not be
6381 * a perfect view of the network.
6383 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
6385 * A pointer to the opaque Rust object.
6386 * Nearly everywhere, inner must be non-null, however in places where
6387 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6389 LDKnativeReplyShortChannelIdsEnd *inner;
6391 * Indicates that this is the only struct which contains the same pointer.
6392 * Rust functions which take ownership of an object provided via an argument require
6393 * this to be true and invalidate the object pointed to by inner.
6396 } LDKReplyShortChannelIdsEnd;
6399 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
6401 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
6403 * A pointer to the contents in the success state.
6404 * Reading from this pointer when `result_ok` is not set is undefined.
6406 struct LDKReplyShortChannelIdsEnd *result;
6408 * A pointer to the contents in the error state.
6409 * Reading from this pointer when `result_ok` is set is undefined.
6411 struct LDKDecodeError *err;
6412 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
6415 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
6416 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
6417 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6419 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
6421 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
6422 * `err` or `result` depending on the state of `result_ok`.
6424 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
6426 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
6429 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
6432 * The contents of CResult_QueryChannelRangeDecodeErrorZ
6434 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
6436 * A pointer to the contents in the success state.
6437 * Reading from this pointer when `result_ok` is not set is undefined.
6439 struct LDKQueryChannelRange *result;
6441 * A pointer to the contents in the error state.
6442 * Reading from this pointer when `result_ok` is set is undefined.
6444 struct LDKDecodeError *err;
6445 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
6448 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
6449 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
6450 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6452 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
6454 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
6455 * `err` or `result` depending on the state of `result_ok`.
6457 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
6459 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
6462 } LDKCResult_QueryChannelRangeDecodeErrorZ;
6465 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
6467 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
6469 * A pointer to the contents in the success state.
6470 * Reading from this pointer when `result_ok` is not set is undefined.
6472 struct LDKReplyChannelRange *result;
6474 * A pointer to the contents in the error state.
6475 * Reading from this pointer when `result_ok` is set is undefined.
6477 struct LDKDecodeError *err;
6478 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
6481 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
6482 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
6483 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6485 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
6487 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
6488 * `err` or `result` depending on the state of `result_ok`.
6490 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
6492 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
6495 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
6500 * A gossip_timestamp_filter message is used by a node to request
6501 * gossip relay for messages in the requested time range when the
6502 * gossip_queries feature has been negotiated.
6504 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
6506 * A pointer to the opaque Rust object.
6507 * Nearly everywhere, inner must be non-null, however in places where
6508 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6510 LDKnativeGossipTimestampFilter *inner;
6512 * Indicates that this is the only struct which contains the same pointer.
6513 * Rust functions which take ownership of an object provided via an argument require
6514 * this to be true and invalidate the object pointed to by inner.
6517 } LDKGossipTimestampFilter;
6520 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
6522 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
6524 * A pointer to the contents in the success state.
6525 * Reading from this pointer when `result_ok` is not set is undefined.
6527 struct LDKGossipTimestampFilter *result;
6529 * A pointer to the contents in the error state.
6530 * Reading from this pointer when `result_ok` is set is undefined.
6532 struct LDKDecodeError *err;
6533 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
6536 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
6537 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
6538 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6540 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
6542 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
6543 * `err` or `result` depending on the state of `result_ok`.
6545 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
6547 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
6550 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
6553 * When signing using a fallible method either an user-supplied `SignError` or a `CreationError`
6556 typedef enum LDKSignOrCreationError_Tag {
6558 * An error occurred during signing
6560 LDKSignOrCreationError_SignError,
6562 * An error occurred while building the transaction
6564 LDKSignOrCreationError_CreationError,
6566 * Must be last for serialization purposes
6568 LDKSignOrCreationError_Sentinel,
6569 } LDKSignOrCreationError_Tag;
6571 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
6572 LDKSignOrCreationError_Tag tag;
6575 enum LDKCreationError creation_error;
6578 } LDKSignOrCreationError;
6581 * The contents of CResult_InvoiceSignOrCreationErrorZ
6583 typedef union LDKCResult_InvoiceSignOrCreationErrorZPtr {
6585 * A pointer to the contents in the success state.
6586 * Reading from this pointer when `result_ok` is not set is undefined.
6588 struct LDKInvoice *result;
6590 * A pointer to the contents in the error state.
6591 * Reading from this pointer when `result_ok` is set is undefined.
6593 struct LDKSignOrCreationError *err;
6594 } LDKCResult_InvoiceSignOrCreationErrorZPtr;
6597 * A CResult_InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
6598 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
6599 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6601 typedef struct LDKCResult_InvoiceSignOrCreationErrorZ {
6603 * The contents of this CResult_InvoiceSignOrCreationErrorZ, accessible via either
6604 * `err` or `result` depending on the state of `result_ok`.
6606 union LDKCResult_InvoiceSignOrCreationErrorZPtr contents;
6608 * Whether this CResult_InvoiceSignOrCreationErrorZ represents a success state.
6611 } LDKCResult_InvoiceSignOrCreationErrorZ;
6614 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
6616 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
6618 * A pointer to the contents in the success state.
6619 * Reading from this pointer when `result_ok` is not set is undefined.
6621 struct LDKSpendableOutputDescriptor *result;
6623 * A pointer to the contents in the error state.
6624 * Reading from this pointer when `result_ok` is set is undefined.
6626 struct LDKDecodeError *err;
6627 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
6630 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
6631 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
6632 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6634 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
6636 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
6637 * `err` or `result` depending on the state of `result_ok`.
6639 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
6641 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
6644 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
6647 * The contents of CResult_SignDecodeErrorZ
6649 typedef union LDKCResult_SignDecodeErrorZPtr {
6651 * A pointer to the contents in the success state.
6652 * Reading from this pointer when `result_ok` is not set is undefined.
6654 struct LDKSign *result;
6656 * A pointer to the contents in the error state.
6657 * Reading from this pointer when `result_ok` is set is undefined.
6659 struct LDKDecodeError *err;
6660 } LDKCResult_SignDecodeErrorZPtr;
6663 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
6664 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
6665 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6667 typedef struct LDKCResult_SignDecodeErrorZ {
6669 * The contents of this CResult_SignDecodeErrorZ, accessible via either
6670 * `err` or `result` depending on the state of `result_ok`.
6672 union LDKCResult_SignDecodeErrorZPtr contents;
6674 * Whether this CResult_SignDecodeErrorZ represents a success state.
6677 } LDKCResult_SignDecodeErrorZ;
6680 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
6681 * allows recovering the exact public key which created the signature given the message.
6683 typedef struct LDKRecoverableSignature {
6685 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
6688 uint8_t serialized_form[68];
6689 } LDKRecoverableSignature;
6692 * The contents of CResult_RecoverableSignatureNoneZ
6694 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
6696 * A pointer to the contents in the success state.
6697 * Reading from this pointer when `result_ok` is not set is undefined.
6699 struct LDKRecoverableSignature *result;
6701 * Note that this value is always NULL, as there are no contents in the Err variant
6704 } LDKCResult_RecoverableSignatureNoneZPtr;
6707 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
6708 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
6709 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6711 typedef struct LDKCResult_RecoverableSignatureNoneZ {
6713 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
6714 * `err` or `result` depending on the state of `result_ok`.
6716 union LDKCResult_RecoverableSignatureNoneZPtr contents;
6718 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
6721 } LDKCResult_RecoverableSignatureNoneZ;
6724 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
6725 * This corresponds to std::vector in C++
6727 typedef struct LDKCVec_CVec_u8ZZ {
6729 * The elements in the array.
6730 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6732 struct LDKCVec_u8Z *data;
6734 * The number of elements pointed to by `data`.
6737 } LDKCVec_CVec_u8ZZ;
6740 * The contents of CResult_CVec_CVec_u8ZZNoneZ
6742 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
6744 * A pointer to the contents in the success state.
6745 * Reading from this pointer when `result_ok` is not set is undefined.
6747 struct LDKCVec_CVec_u8ZZ *result;
6749 * Note that this value is always NULL, as there are no contents in the Err variant
6752 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
6755 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
6756 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
6757 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6759 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
6761 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
6762 * `err` or `result` depending on the state of `result_ok`.
6764 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
6766 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
6769 } LDKCResult_CVec_CVec_u8ZZNoneZ;
6774 * A simple implementation of Sign that just keeps the private keys in memory.
6776 * This implementation performs no policy checks and is insufficient by itself as
6777 * a secure external signer.
6779 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
6781 * A pointer to the opaque Rust object.
6782 * Nearly everywhere, inner must be non-null, however in places where
6783 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6785 LDKnativeInMemorySigner *inner;
6787 * Indicates that this is the only struct which contains the same pointer.
6788 * Rust functions which take ownership of an object provided via an argument require
6789 * this to be true and invalidate the object pointed to by inner.
6792 } LDKInMemorySigner;
6795 * The contents of CResult_InMemorySignerDecodeErrorZ
6797 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
6799 * A pointer to the contents in the success state.
6800 * Reading from this pointer when `result_ok` is not set is undefined.
6802 struct LDKInMemorySigner *result;
6804 * A pointer to the contents in the error state.
6805 * Reading from this pointer when `result_ok` is set is undefined.
6807 struct LDKDecodeError *err;
6808 } LDKCResult_InMemorySignerDecodeErrorZPtr;
6811 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
6812 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
6813 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6815 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
6817 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
6818 * `err` or `result` depending on the state of `result_ok`.
6820 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
6822 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
6825 } LDKCResult_InMemorySignerDecodeErrorZ;
6828 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
6829 * This corresponds to std::vector in C++
6831 typedef struct LDKCVec_TxOutZ {
6833 * The elements in the array.
6834 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6836 struct LDKTxOut *data;
6838 * The number of elements pointed to by `data`.
6844 * The contents of CResult_TransactionNoneZ
6846 typedef union LDKCResult_TransactionNoneZPtr {
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 LDKTransaction *result;
6853 * Note that this value is always NULL, as there are no contents in the Err variant
6856 } LDKCResult_TransactionNoneZPtr;
6859 * A CResult_TransactionNoneZ represents the result of a fallible operation,
6860 * containing a crate::c_types::Transaction on success and a () on failure.
6861 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6863 typedef struct LDKCResult_TransactionNoneZ {
6865 * The contents of this CResult_TransactionNoneZ, accessible via either
6866 * `err` or `result` depending on the state of `result_ok`.
6868 union LDKCResult_TransactionNoneZPtr contents;
6870 * Whether this CResult_TransactionNoneZ represents a success state.
6873 } LDKCResult_TransactionNoneZ;
6876 * The contents of CResult_NoneErrorZ
6878 typedef union LDKCResult_NoneErrorZPtr {
6880 * Note that this value is always NULL, as there are no contents in the OK variant
6884 * A pointer to the contents in the error state.
6885 * Reading from this pointer when `result_ok` is set is undefined.
6887 enum LDKIOError *err;
6888 } LDKCResult_NoneErrorZPtr;
6891 * A CResult_NoneErrorZ represents the result of a fallible operation,
6892 * containing a () on success and a crate::c_types::IOError on failure.
6893 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6895 typedef struct LDKCResult_NoneErrorZ {
6897 * The contents of this CResult_NoneErrorZ, accessible via either
6898 * `err` or `result` depending on the state of `result_ok`.
6900 union LDKCResult_NoneErrorZPtr contents;
6902 * Whether this CResult_NoneErrorZ represents a success state.
6905 } LDKCResult_NoneErrorZ;
6908 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
6909 * This corresponds to std::vector in C++
6911 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
6913 * The elements in the array.
6914 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6916 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
6918 * The number of elements pointed to by `data`.
6921 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
6924 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
6926 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
6928 * A pointer to the contents in the success state.
6929 * Reading from this pointer when `result_ok` is not set is undefined.
6931 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
6933 * A pointer to the contents in the error state.
6934 * Reading from this pointer when `result_ok` is set is undefined.
6936 enum LDKIOError *err;
6937 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
6940 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
6941 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
6942 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6944 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
6946 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
6947 * `err` or `result` depending on the state of `result_ok`.
6949 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
6951 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
6954 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
6957 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
6960 typedef enum LDKAPIError_Tag {
6962 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
6963 * are documented, but generally indicates some precondition of a function was violated.
6965 LDKAPIError_APIMisuseError,
6967 * Due to a high feerate, we were unable to complete the request.
6968 * For example, this may be returned if the feerate implies we cannot open a channel at the
6969 * requested value, but opening a larger channel would succeed.
6971 LDKAPIError_FeeRateTooHigh,
6973 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
6974 * too-many-hops, etc).
6976 LDKAPIError_RouteError,
6978 * We were unable to complete the request as the Channel required to do so is unable to
6979 * complete the request (or was not found). This can take many forms, including disconnected
6980 * peer, channel at capacity, channel shutting down, etc.
6982 LDKAPIError_ChannelUnavailable,
6984 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
6985 * attempted action to fail.
6987 LDKAPIError_MonitorUpdateFailed,
6989 * Must be last for serialization purposes
6991 LDKAPIError_Sentinel,
6994 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
6996 * A human-readable error message
6999 } LDKAPIError_LDKAPIMisuseError_Body;
7001 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
7003 * A human-readable error message
7007 * The feerate which was too high.
7010 } LDKAPIError_LDKFeeRateTooHigh_Body;
7012 typedef struct LDKAPIError_LDKRouteError_Body {
7014 * A human-readable error message
7017 } LDKAPIError_LDKRouteError_Body;
7019 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
7021 * A human-readable error message
7024 } LDKAPIError_LDKChannelUnavailable_Body;
7026 typedef struct MUST_USE_STRUCT LDKAPIError {
7027 LDKAPIError_Tag tag;
7029 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
7030 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
7031 LDKAPIError_LDKRouteError_Body route_error;
7032 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
7037 * The contents of CResult_NoneAPIErrorZ
7039 typedef union LDKCResult_NoneAPIErrorZPtr {
7041 * Note that this value is always NULL, as there are no contents in the OK variant
7045 * A pointer to the contents in the error state.
7046 * Reading from this pointer when `result_ok` is set is undefined.
7048 struct LDKAPIError *err;
7049 } LDKCResult_NoneAPIErrorZPtr;
7052 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
7053 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
7054 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7056 typedef struct LDKCResult_NoneAPIErrorZ {
7058 * The contents of this CResult_NoneAPIErrorZ, accessible via either
7059 * `err` or `result` depending on the state of `result_ok`.
7061 union LDKCResult_NoneAPIErrorZPtr contents;
7063 * Whether this CResult_NoneAPIErrorZ represents a success state.
7066 } LDKCResult_NoneAPIErrorZ;
7069 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
7070 * This corresponds to std::vector in C++
7072 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
7074 * The elements in the array.
7075 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7077 struct LDKCResult_NoneAPIErrorZ *data;
7079 * The number of elements pointed to by `data`.
7082 } LDKCVec_CResult_NoneAPIErrorZZ;
7085 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
7086 * This corresponds to std::vector in C++
7088 typedef struct LDKCVec_APIErrorZ {
7090 * The elements in the array.
7091 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7093 struct LDKAPIError *data;
7095 * The number of elements pointed to by `data`.
7098 } LDKCVec_APIErrorZ;
7101 * If a payment fails to send, it can be in one of several states. This enum is returned as the
7102 * Err() type describing which state the payment is in, see the description of individual enum
7105 typedef enum LDKPaymentSendFailure_Tag {
7107 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
7108 * send the payment at all. No channel state has been changed or messages sent to peers, and
7109 * once you've changed the parameter at error, you can freely retry the payment in full.
7111 LDKPaymentSendFailure_ParameterError,
7113 * A parameter in a single path which was passed to send_payment was invalid, preventing us
7114 * from attempting to send the payment at all. No channel state has been changed or messages
7115 * sent to peers, and once you've changed the parameter at error, you can freely retry the
7118 * The results here are ordered the same as the paths in the route object which was passed to
7121 LDKPaymentSendFailure_PathParameterError,
7123 * All paths which were attempted failed to send, with no channel state change taking place.
7124 * You can freely retry the payment in full (though you probably want to do so over different
7125 * paths than the ones selected).
7127 LDKPaymentSendFailure_AllFailedRetrySafe,
7129 * Some paths which were attempted failed to send, though possibly not all. At least some
7130 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
7131 * in over-/re-payment.
7133 * The results here are ordered the same as the paths in the route object which was passed to
7134 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
7135 * retried (though there is currently no API with which to do so).
7137 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
7138 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
7139 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
7140 * with the latest update_id.
7142 LDKPaymentSendFailure_PartialFailure,
7144 * Must be last for serialization purposes
7146 LDKPaymentSendFailure_Sentinel,
7147 } LDKPaymentSendFailure_Tag;
7149 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
7150 LDKPaymentSendFailure_Tag tag;
7153 struct LDKAPIError parameter_error;
7156 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
7159 struct LDKCVec_APIErrorZ all_failed_retry_safe;
7162 struct LDKCVec_CResult_NoneAPIErrorZZ partial_failure;
7165 } LDKPaymentSendFailure;
7168 * The contents of CResult_NonePaymentSendFailureZ
7170 typedef union LDKCResult_NonePaymentSendFailureZPtr {
7172 * Note that this value is always NULL, as there are no contents in the OK variant
7176 * A pointer to the contents in the error state.
7177 * Reading from this pointer when `result_ok` is set is undefined.
7179 struct LDKPaymentSendFailure *err;
7180 } LDKCResult_NonePaymentSendFailureZPtr;
7183 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
7184 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
7185 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7187 typedef struct LDKCResult_NonePaymentSendFailureZ {
7189 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
7190 * `err` or `result` depending on the state of `result_ok`.
7192 union LDKCResult_NonePaymentSendFailureZPtr contents;
7194 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
7197 } LDKCResult_NonePaymentSendFailureZ;
7200 * A tuple of 2 elements. See the individual fields for the types contained.
7202 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
7204 * The element at position 0
7206 struct LDKThirtyTwoBytes a;
7208 * The element at position 1
7210 struct LDKThirtyTwoBytes b;
7211 } LDKC2Tuple_PaymentHashPaymentSecretZ;
7214 * The contents of CResult_PaymentSecretAPIErrorZ
7216 typedef union LDKCResult_PaymentSecretAPIErrorZPtr {
7218 * A pointer to the contents in the success state.
7219 * Reading from this pointer when `result_ok` is not set is undefined.
7221 struct LDKThirtyTwoBytes *result;
7223 * A pointer to the contents in the error state.
7224 * Reading from this pointer when `result_ok` is set is undefined.
7226 struct LDKAPIError *err;
7227 } LDKCResult_PaymentSecretAPIErrorZPtr;
7230 * A CResult_PaymentSecretAPIErrorZ represents the result of a fallible operation,
7231 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7232 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7234 typedef struct LDKCResult_PaymentSecretAPIErrorZ {
7236 * The contents of this CResult_PaymentSecretAPIErrorZ, accessible via either
7237 * `err` or `result` depending on the state of `result_ok`.
7239 union LDKCResult_PaymentSecretAPIErrorZPtr contents;
7241 * Whether this CResult_PaymentSecretAPIErrorZ represents a success state.
7244 } LDKCResult_PaymentSecretAPIErrorZ;
7247 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
7248 * This corresponds to std::vector in C++
7250 typedef struct LDKCVec_ChannelMonitorZ {
7252 * The elements in the array.
7253 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7255 struct LDKChannelMonitor *data;
7257 * The number of elements pointed to by `data`.
7260 } LDKCVec_ChannelMonitorZ;
7263 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
7264 * blocks are connected and disconnected.
7266 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
7267 * responsible for maintaining a set of monitors such that they can be updated accordingly as
7268 * channel state changes and HTLCs are resolved. See method documentation for specific
7271 * Implementations **must** ensure that updates are successfully applied and persisted upon method
7272 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
7273 * without taking any further action such as persisting the current state.
7275 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
7276 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
7277 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
7278 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
7279 * multiple instances.
7281 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
7282 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
7283 * [`PermanentFailure`]: channelmonitor::ChannelMonitorUpdateErr::PermanentFailure
7285 typedef struct LDKWatch {
7287 * An opaque pointer which is passed to your function implementations as an argument.
7288 * This has no meaning in the LDK, and can be NULL or any other value.
7292 * Watches a channel identified by `funding_txo` using `monitor`.
7294 * Implementations are responsible for watching the chain for the funding transaction along
7295 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
7296 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
7298 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
7299 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
7300 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
7302 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
7304 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
7306 * Implementations must call [`update_monitor`] with the given update. See
7307 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
7309 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
7310 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
7312 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
7314 * Returns any monitor events since the last call. Subsequent calls must only return new
7317 struct LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
7319 * Frees any resources associated with this object given its this_arg pointer.
7320 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7322 void (*free)(void *this_arg);
7326 * An interface to send a transaction to the Bitcoin network.
7328 typedef struct LDKBroadcasterInterface {
7330 * An opaque pointer which is passed to your function implementations as an argument.
7331 * This has no meaning in the LDK, and can be NULL or any other value.
7335 * Sends a transaction out to (hopefully) be mined.
7337 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
7339 * Frees any resources associated with this object given its this_arg pointer.
7340 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7342 void (*free)(void *this_arg);
7343 } LDKBroadcasterInterface;
7346 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
7347 * own the memory pointed to by data.
7349 typedef struct LDKu8slice {
7351 * A pointer to the byte buffer
7353 const uint8_t *data;
7355 * The number of bytes pointed to by `data`.
7361 * A trait to describe an object which can get user secrets and key material.
7363 typedef struct LDKKeysInterface {
7365 * An opaque pointer which is passed to your function implementations as an argument.
7366 * This has no meaning in the LDK, and can be NULL or any other value.
7370 * Get node secret key (aka node_id or network_key).
7372 * This method must return the same value each time it is called.
7374 struct LDKSecretKey (*get_node_secret)(const void *this_arg);
7376 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
7378 * This method should return a different value each time it is called, to avoid linking
7379 * on-chain funds across channels as controlled to the same user.
7381 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
7383 * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing
7386 * This method should return a different value each time it is called, to avoid linking
7387 * on-chain funds across channels as controlled to the same user.
7389 struct LDKPublicKey (*get_shutdown_pubkey)(const void *this_arg);
7391 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
7392 * restarted with some stale data!
7394 * This method must return a different value each time it is called.
7396 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
7398 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
7399 * onion packets and for temporary channel IDs. There is no requirement that these be
7400 * persisted anywhere, though they must be unique across restarts.
7402 * This method must return a different value each time it is called.
7404 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
7406 * Reads a `Signer` for this `KeysInterface` from the given input stream.
7407 * This is only called during deserialization of other objects which contain
7408 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
7409 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
7410 * contain no versioning scheme. You may wish to include your own version prefix and ensure
7411 * you've read all of the provided bytes to ensure no corruption occurred.
7413 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
7415 * Sign an invoice's preimage (note that this is the preimage of the invoice, not the HTLC's
7416 * preimage). By parameterizing by the preimage instead of the hash, we allow implementors of
7417 * this trait to parse the invoice and make sure they're signing what they expect, rather than
7418 * blindly signing the hash.
7420 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKCVec_u8Z invoice_preimage);
7422 * Frees any resources associated with this object given its this_arg pointer.
7423 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7425 void (*free)(void *this_arg);
7429 * A trait which should be implemented to provide feerate information on a number of time
7432 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
7433 * called from inside the library in response to chain events, P2P events, or timer events).
7435 typedef struct LDKFeeEstimator {
7437 * An opaque pointer which is passed to your function implementations as an argument.
7438 * This has no meaning in the LDK, and can be NULL or any other value.
7442 * Gets estimated satoshis of fee required per 1000 Weight-Units.
7444 * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
7445 * don't put us below 1 satoshi-per-byte).
7447 * This translates to:
7448 * * satoshis-per-byte * 250
7449 * * ceil(satoshis-per-kbyte / 4)
7451 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
7453 * Frees any resources associated with this object given its this_arg pointer.
7454 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7456 void (*free)(void *this_arg);
7460 * A trait encapsulating the operations required of a logger
7462 typedef struct LDKLogger {
7464 * An opaque pointer which is passed to your function implementations as an argument.
7465 * This has no meaning in the LDK, and can be NULL or any other value.
7471 void (*log)(const void *this_arg, const char *record);
7473 * Frees any resources associated with this object given its this_arg pointer.
7474 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7476 void (*free)(void *this_arg);
7482 * Manager which keeps track of a number of channels and sends messages to the appropriate
7483 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
7485 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
7486 * to individual Channels.
7488 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
7489 * all peers during write/read (though does not modify this instance, only the instance being
7490 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
7491 * called funding_transaction_generated for outbound channels).
7493 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
7494 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
7495 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
7496 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
7497 * the serialization process). If the deserialized version is out-of-date compared to the
7498 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
7499 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
7501 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
7502 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
7503 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
7504 * block_connected() to step towards your best block) upon deserialization before using the
7507 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
7508 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
7509 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
7510 * offline for a full minute. In order to track this, you must call
7511 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
7513 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
7514 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
7515 * essentially you should default to using a SimpleRefChannelManager, and use a
7516 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
7517 * you're using lightning-net-tokio.
7519 typedef struct MUST_USE_STRUCT LDKChannelManager {
7521 * A pointer to the opaque Rust object.
7522 * Nearly everywhere, inner must be non-null, however in places where
7523 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7525 LDKnativeChannelManager *inner;
7527 * Indicates that this is the only struct which contains the same pointer.
7528 * Rust functions which take ownership of an object provided via an argument require
7529 * this to be true and invalidate the object pointed to by inner.
7532 } LDKChannelManager;
7535 * A tuple of 2 elements. See the individual fields for the types contained.
7537 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
7539 * The element at position 0
7541 struct LDKThirtyTwoBytes a;
7543 * The element at position 1
7545 struct LDKChannelManager b;
7546 } LDKC2Tuple_BlockHashChannelManagerZ;
7549 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
7551 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
7553 * A pointer to the contents in the success state.
7554 * Reading from this pointer when `result_ok` is not set is undefined.
7556 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
7558 * A pointer to the contents in the error state.
7559 * Reading from this pointer when `result_ok` is set is undefined.
7561 struct LDKDecodeError *err;
7562 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
7565 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
7566 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
7567 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7569 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
7571 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
7572 * `err` or `result` depending on the state of `result_ok`.
7574 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
7576 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
7579 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
7582 * A trait indicating an object may generate message send events
7584 typedef struct LDKMessageSendEventsProvider {
7586 * An opaque pointer which is passed to your function implementations as an argument.
7587 * This has no meaning in the LDK, and can be NULL or any other value.
7591 * Gets the list of pending events which were generated by previous actions, clearing the list
7594 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
7596 * Frees any resources associated with this object given its this_arg pointer.
7597 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7599 void (*free)(void *this_arg);
7600 } LDKMessageSendEventsProvider;
7603 * A trait indicating an object may generate events
7605 typedef struct LDKEventsProvider {
7607 * An opaque pointer which is passed to your function implementations as an argument.
7608 * This has no meaning in the LDK, and can be NULL or any other value.
7612 * Gets the list of pending events which were generated by previous actions, clearing the list
7615 struct LDKCVec_EventZ (*get_and_clear_pending_events)(const void *this_arg);
7617 * Frees any resources associated with this object given its this_arg pointer.
7618 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7620 void (*free)(void *this_arg);
7621 } LDKEventsProvider;
7626 * Configuration we set when applicable.
7628 * Default::default() provides sane defaults.
7630 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
7632 * A pointer to the opaque Rust object.
7633 * Nearly everywhere, inner must be non-null, however in places where
7634 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7636 LDKnativeChannelHandshakeConfig *inner;
7638 * Indicates that this is the only struct which contains the same pointer.
7639 * Rust functions which take ownership of an object provided via an argument require
7640 * this to be true and invalidate the object pointed to by inner.
7643 } LDKChannelHandshakeConfig;
7648 * Optional channel limits which are applied during channel creation.
7650 * These limits are only applied to our counterparty's limits, not our own.
7652 * Use 0/<type>::max_value() as appropriate to skip checking.
7654 * Provides sane defaults for most configurations.
7656 * Most additional limits are disabled except those with which specify a default in individual
7657 * field documentation. Note that this may result in barely-usable channels, but since they
7658 * are applied mostly only to incoming channels that's not much of a problem.
7660 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
7662 * A pointer to the opaque Rust object.
7663 * Nearly everywhere, inner must be non-null, however in places where
7664 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7666 LDKnativeChannelHandshakeLimits *inner;
7668 * Indicates that this is the only struct which contains the same pointer.
7669 * Rust functions which take ownership of an object provided via an argument require
7670 * this to be true and invalidate the object pointed to by inner.
7673 } LDKChannelHandshakeLimits;
7678 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
7680 * Default::default() provides sane defaults for most configurations
7681 * (but currently with 0 relay fees!)
7683 typedef struct MUST_USE_STRUCT LDKUserConfig {
7685 * A pointer to the opaque Rust object.
7686 * Nearly everywhere, inner must be non-null, however in places where
7687 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7689 LDKnativeUserConfig *inner;
7691 * Indicates that this is the only struct which contains the same pointer.
7692 * Rust functions which take ownership of an object provided via an argument require
7693 * this to be true and invalidate the object pointed to by inner.
7699 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
7702 typedef struct LDKAccess {
7704 * An opaque pointer which is passed to your function implementations as an argument.
7705 * This has no meaning in the LDK, and can be NULL or any other value.
7709 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
7710 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
7713 * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
7715 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
7717 * Frees any resources associated with this object given its this_arg pointer.
7718 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7720 void (*free)(void *this_arg);
7724 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
7727 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
7728 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
7729 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
7732 typedef struct LDKListen {
7734 * An opaque pointer which is passed to your function implementations as an argument.
7735 * This has no meaning in the LDK, and can be NULL or any other value.
7739 * Notifies the listener that a block was added at the given height.
7741 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
7743 * Notifies the listener that a block was removed at the given height.
7745 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
7747 * Frees any resources associated with this object given its this_arg pointer.
7748 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7750 void (*free)(void *this_arg);
7754 * The `Confirm` trait is used to notify when transactions have been confirmed on chain or
7755 * unconfirmed during a chain reorganization.
7757 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
7758 * [`Listen`]. For instance, an Electrum client may implement [`Filter`] by subscribing to activity
7759 * related to registered transactions and outputs. Upon notification, it would pass along the
7760 * matching transactions using this interface.
7764 * The intended use is as follows:
7765 * - Call [`transactions_confirmed`] to process any on-chain activity of interest.
7766 * - Call [`transaction_unconfirmed`] to process any transaction returned by [`get_relevant_txids`]
7767 * that has been reorganized out of the chain.
7768 * - Call [`best_block_updated`] whenever a new chain tip becomes available.
7772 * Clients must call these methods in chain order. Specifically:
7773 * - Transactions confirmed in a block must be given before transactions confirmed in a later
7775 * - Dependent transactions within the same block must be given in topological order, possibly in
7777 * - Unconfirmed transactions must be given after the original confirmations and before any
7780 * See individual method documentation for further details.
7782 * [`transactions_confirmed`]: Self::transactions_confirmed
7783 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
7784 * [`best_block_updated`]: Self::best_block_updated
7785 * [`get_relevant_txids`]: Self::get_relevant_txids
7787 typedef struct LDKConfirm {
7789 * An opaque pointer which is passed to your function implementations as an argument.
7790 * This has no meaning in the LDK, and can be NULL or any other value.
7794 * Processes transactions confirmed in a block with a given header and height.
7796 * Should be called for any transactions registered by [`Filter::register_tx`] or any
7797 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
7798 * appearing in the same block do not need to be included in the same call; instead, multiple
7799 * calls with additional transactions may be made so long as they are made in [chain order].
7801 * May be called before or after [`best_block_updated`] for the corresponding block. However,
7802 * in the event of a chain reorganization, it must not be called with a `header` that is no
7803 * longer in the chain as of the last call to [`best_block_updated`].
7805 * [chain order]: Confirm#Order
7806 * [`best_block_updated`]: Self::best_block_updated
7808 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
7810 * Processes a transaction that is no longer confirmed as result of a chain reorganization.
7812 * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
7813 * reorganized out of the best chain. Once called, the given transaction should not be returned
7814 * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`].
7816 * [`get_relevant_txids`]: Self::get_relevant_txids
7817 * [`transactions_confirmed`]: Self::transactions_confirmed
7819 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
7821 * Processes an update to the best header connected at the given height.
7823 * Should be called when a new header is available but may be skipped for intermediary blocks
7824 * if they become available at the same time.
7826 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
7828 * Returns transactions that should be monitored for reorganization out of the chain.
7830 * Should include any transactions passed to [`transactions_confirmed`] that have insufficient
7831 * confirmations to be safe from a chain reorganization. Should not include any transactions
7832 * passed to [`transaction_unconfirmed`] unless later reconfirmed.
7834 * May be called to determine the subset of transactions that must still be monitored for
7835 * reorganization. Will be idempotent between calls but may change as a result of calls to the
7836 * other interface methods. Thus, this is useful to determine which transactions may need to be
7837 * given to [`transaction_unconfirmed`].
7839 * [`transactions_confirmed`]: Self::transactions_confirmed
7840 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
7842 struct LDKCVec_TxidZ (*get_relevant_txids)(const void *this_arg);
7844 * Frees any resources associated with this object given its this_arg pointer.
7845 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7847 void (*free)(void *this_arg);
7853 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
7855 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
7856 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
7857 * the return value of [`Filter::register_output`].
7859 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
7860 * may have been spent there. See [`Filter::register_output`] for details.
7862 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
7863 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
7865 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
7867 * A pointer to the opaque Rust object.
7868 * Nearly everywhere, inner must be non-null, however in places where
7869 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7871 LDKnativeWatchedOutput *inner;
7873 * Indicates that this is the only struct which contains the same pointer.
7874 * Rust functions which take ownership of an object provided via an argument require
7875 * this to be true and invalidate the object pointed to by inner.
7881 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
7884 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
7885 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
7886 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
7887 * receiving full blocks from a chain source, any further filtering is unnecessary.
7889 * After an output has been registered, subsequent block retrievals from the chain source must not
7890 * exclude any transactions matching the new criteria nor any in-block descendants of such
7893 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
7894 * should not block on I/O. Implementations should instead queue the newly monitored data to be
7895 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
7896 * invocation that has called the `Filter` must return [`TemporaryFailure`].
7898 * [`TemporaryFailure`]: channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure
7899 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
7900 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
7902 typedef struct LDKFilter {
7904 * An opaque pointer which is passed to your function implementations as an argument.
7905 * This has no meaning in the LDK, and can be NULL or any other value.
7909 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
7910 * a spending condition.
7912 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
7914 * Registers interest in spends of a transaction output.
7916 * Optionally, when `output.block_hash` is set, should return any transaction spending the
7917 * output that is found in the corresponding block along with its index.
7919 * This return value is useful for Electrum clients in order to supply in-block descendant
7920 * transactions which otherwise were not included. This is not necessary for other clients if
7921 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
7924 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
7926 * Frees any resources associated with this object given its this_arg pointer.
7927 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7929 void (*free)(void *this_arg);
7933 * `Persist` defines behavior for persisting channel monitors: this could mean
7934 * writing once to disk, and/or uploading to one or more backup services.
7936 * Note that for every new monitor, you **must** persist the new `ChannelMonitor`
7937 * to disk/backups. And, on every update, you **must** persist either the
7938 * `ChannelMonitorUpdate` or the updated monitor itself. Otherwise, there is risk
7939 * of situations such as revoking a transaction, then crashing before this
7940 * revocation can be persisted, then unintentionally broadcasting a revoked
7941 * transaction and losing money. This is a risk because previous channel states
7942 * are toxic, so it's important that whatever channel state is persisted is
7945 typedef struct LDKPersist {
7947 * An opaque pointer which is passed to your function implementations as an argument.
7948 * This has no meaning in the LDK, and can be NULL or any other value.
7952 * Persist a new channel's data. The data can be stored any way you want, but
7953 * the identifier provided by Rust-Lightning is the channel's outpoint (and
7954 * it is up to you to maintain a correct mapping between the outpoint and the
7955 * stored channel data). Note that you **must** persist every new monitor to
7956 * disk. See the `Persist` trait documentation for more details.
7958 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
7959 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
7961 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data);
7963 * Update one channel's data. The provided `ChannelMonitor` has already
7964 * applied the given update.
7966 * Note that on every update, you **must** persist either the
7967 * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See
7968 * the `Persist` trait documentation for more details.
7970 * If an implementer chooses to persist the updates only, they need to make
7971 * sure that all the updates are applied to the `ChannelMonitors` *before*
7972 * the set of channel monitors is given to the `ChannelManager`
7973 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
7974 * applying a monitor update to a monitor. If full `ChannelMonitors` are
7975 * persisted, then there is no need to persist individual updates.
7977 * Note that there could be a performance tradeoff between persisting complete
7978 * channel monitors on every update vs. persisting only updates and applying
7979 * them in batches. The size of each monitor grows `O(number of state updates)`
7980 * whereas updates are small and `O(1)`.
7982 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
7983 * [`ChannelMonitorUpdate::write`] for writing out an update, and
7984 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
7986 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);
7988 * Frees any resources associated with this object given its this_arg pointer.
7989 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7991 void (*free)(void *this_arg);
7997 * An implementation of [`chain::Watch`] for monitoring channels.
7999 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
8000 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
8001 * or used independently to monitor channels remotely. See the [module-level documentation] for
8004 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
8005 * [module-level documentation]: crate::chain::chainmonitor
8007 typedef struct MUST_USE_STRUCT LDKChainMonitor {
8009 * A pointer to the opaque Rust object.
8010 * Nearly everywhere, inner must be non-null, however in places where
8011 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8013 LDKnativeChainMonitor *inner;
8015 * Indicates that this is the only struct which contains the same pointer.
8016 * Rust functions which take ownership of an object provided via an argument require
8017 * this to be true and invalidate the object pointed to by inner.
8025 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
8026 * and derives keys from that.
8028 * Your node_id is seed/0'
8029 * ChannelMonitor closes may use seed/1'
8030 * Cooperative closes may use seed/2'
8031 * The two close keys may be needed to claim on-chain funds!
8033 typedef struct MUST_USE_STRUCT LDKKeysManager {
8035 * A pointer to the opaque Rust object.
8036 * Nearly everywhere, inner must be non-null, however in places where
8037 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8039 LDKnativeKeysManager *inner;
8041 * Indicates that this is the only struct which contains the same pointer.
8042 * Rust functions which take ownership of an object provided via an argument require
8043 * this to be true and invalidate the object pointed to by inner.
8051 * Chain-related parameters used to construct a new `ChannelManager`.
8053 * Typically, the block-specific parameters are derived from the best block hash for the network,
8054 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
8055 * are not needed when deserializing a previously constructed `ChannelManager`.
8057 typedef struct MUST_USE_STRUCT LDKChainParameters {
8059 * A pointer to the opaque Rust object.
8060 * Nearly everywhere, inner must be non-null, however in places where
8061 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8063 LDKnativeChainParameters *inner;
8065 * Indicates that this is the only struct which contains the same pointer.
8066 * Rust functions which take ownership of an object provided via an argument require
8067 * this to be true and invalidate the object pointed to by inner.
8070 } LDKChainParameters;
8075 * The best known block as identified by its hash and height.
8077 typedef struct MUST_USE_STRUCT LDKBestBlock {
8079 * A pointer to the opaque Rust object.
8080 * Nearly everywhere, inner must be non-null, however in places where
8081 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8083 LDKnativeBestBlock *inner;
8085 * Indicates that this is the only struct which contains the same pointer.
8086 * Rust functions which take ownership of an object provided via an argument require
8087 * this to be true and invalidate the object pointed to by inner.
8093 * A 3-byte byte array.
8095 typedef struct LDKThreeBytes {
8103 * A trait to describe an object which can receive channel messages.
8105 * Messages MAY be called in parallel when they originate from different their_node_ids, however
8106 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
8108 typedef struct LDKChannelMessageHandler {
8110 * An opaque pointer which is passed to your function implementations as an argument.
8111 * This has no meaning in the LDK, and can be NULL or any other value.
8115 * Handle an incoming open_channel message from the given peer.
8117 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
8119 * Handle an incoming accept_channel message from the given peer.
8121 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
8123 * Handle an incoming funding_created message from the given peer.
8125 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
8127 * Handle an incoming funding_signed message from the given peer.
8129 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
8131 * Handle an incoming funding_locked message from the given peer.
8133 void (*handle_funding_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg);
8135 * Handle an incoming shutdown message from the given peer.
8137 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);
8139 * Handle an incoming closing_signed message from the given peer.
8141 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
8143 * Handle an incoming update_add_htlc message from the given peer.
8145 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
8147 * Handle an incoming update_fulfill_htlc message from the given peer.
8149 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
8151 * Handle an incoming update_fail_htlc message from the given peer.
8153 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
8155 * Handle an incoming update_fail_malformed_htlc message from the given peer.
8157 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
8159 * Handle an incoming commitment_signed message from the given peer.
8161 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
8163 * Handle an incoming revoke_and_ack message from the given peer.
8165 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
8167 * Handle an incoming update_fee message from the given peer.
8169 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
8171 * Handle an incoming announcement_signatures message from the given peer.
8173 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
8175 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
8176 * is believed to be possible in the future (eg they're sending us messages we don't
8177 * understand or indicate they require unknown feature bits), no_connection_possible is set
8178 * and any outstanding channels should be failed.
8180 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
8182 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
8184 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
8186 * Handle an incoming channel_reestablish message from the given peer.
8188 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
8190 * Handle an incoming channel update from the given peer.
8192 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
8194 * Handle an incoming error message from the given peer.
8196 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
8198 * Implementation of MessageSendEventsProvider for this object.
8200 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
8202 * Frees any resources associated with this object given its this_arg pointer.
8203 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8205 void (*free)(void *this_arg);
8206 } LDKChannelMessageHandler;
8211 * Arguments for the creation of a ChannelManager that are not deserialized.
8213 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
8215 * 1) Deserialize all stored ChannelMonitors.
8216 * 2) Deserialize the ChannelManager by filling in this struct and calling:
8217 * <(BlockHash, ChannelManager)>::read(reader, args)
8218 * This may result in closing some Channels if the ChannelMonitor is newer than the stored
8219 * ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted.
8220 * 3) If you are not fetching full blocks, register all relevant ChannelMonitor outpoints the same
8221 * way you would handle a `chain::Filter` call using ChannelMonitor::get_outputs_to_watch() and
8222 * ChannelMonitor::get_funding_txo().
8223 * 4) Reconnect blocks on your ChannelMonitors.
8224 * 5) Disconnect/connect blocks on the ChannelManager.
8225 * 6) Move the ChannelMonitors into your local chain::Watch.
8227 * Note that the ordering of #4-6 is not of importance, however all three must occur before you
8228 * call any other methods on the newly-deserialized ChannelManager.
8230 * Note that because some channels may be closed during deserialization, it is critical that you
8231 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
8232 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
8233 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
8234 * not force-close the same channels but consider them live), you may end up revoking a state for
8235 * which you've already broadcasted the transaction.
8237 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
8239 * A pointer to the opaque Rust object.
8240 * Nearly everywhere, inner must be non-null, however in places where
8241 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8243 LDKnativeChannelManagerReadArgs *inner;
8245 * Indicates that this is the only struct which contains the same pointer.
8246 * Rust functions which take ownership of an object provided via an argument require
8247 * this to be true and invalidate the object pointed to by inner.
8250 } LDKChannelManagerReadArgs;
8255 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
8256 * This is used to convince the recipient that the channel is at a certain commitment
8257 * number even if they lost that data due to a local failure. Of course, the peer may lie
8258 * and even later commitments may have been revoked.
8260 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
8262 * A pointer to the opaque Rust object.
8263 * Nearly everywhere, inner must be non-null, however in places where
8264 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8266 LDKnativeDataLossProtect *inner;
8268 * Indicates that this is the only struct which contains the same pointer.
8269 * Rust functions which take ownership of an object provided via an argument require
8270 * this to be true and invalidate the object pointed to by inner.
8273 } LDKDataLossProtect;
8276 * A trait to describe an object which can receive routing messages.
8278 * # Implementor DoS Warnings
8280 * For `gossip_queries` messages there are potential DoS vectors when handling
8281 * inbound queries. Implementors using an on-disk network graph should be aware of
8282 * repeated disk I/O for queries accessing different parts of the network graph.
8284 typedef struct LDKRoutingMessageHandler {
8286 * An opaque pointer which is passed to your function implementations as an argument.
8287 * This has no meaning in the LDK, and can be NULL or any other value.
8291 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
8292 * false or returning an Err otherwise.
8294 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
8296 * Handle a channel_announcement message, returning true if it should be forwarded on, false
8297 * or returning an Err otherwise.
8299 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
8301 * Handle an incoming channel_update message, returning true if it should be forwarded on,
8302 * false or returning an Err otherwise.
8304 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
8306 * Handle some updates to the route graph that we learned due to an outbound failed payment.
8308 void (*handle_htlc_fail_channel_update)(const void *this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update);
8310 * Gets a subset of the channel announcements and updates required to dump our routing table
8311 * to a remote node, starting at the short_channel_id indicated by starting_point and
8312 * including the batch_amount entries immediately higher in numerical value than starting_point.
8314 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
8316 * Gets a subset of the node announcements required to dump our routing table to a remote node,
8317 * starting at the node *after* the provided publickey and including batch_amount entries
8318 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
8319 * If None is provided for starting_point, we start at the first node.
8321 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
8323 * Called when a connection is established with a peer. This can be used to
8324 * perform routing table synchronization using a strategy defined by the
8327 void (*sync_routing_table)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
8329 * Handles the reply of a query we initiated to learn about channels
8330 * for a given range of blocks. We can expect to receive one or more
8331 * replies to a single query.
8333 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
8335 * Handles the reply of a query we initiated asking for routing gossip
8336 * messages for a list of channels. We should receive this message when
8337 * a node has completed its best effort to send us the pertaining routing
8340 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
8342 * Handles when a peer asks us to send a list of short_channel_ids
8343 * for the requested range of blocks.
8345 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
8347 * Handles when a peer asks us to send routing gossip messages for a
8348 * list of short_channel_ids.
8350 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
8352 * Implementation of MessageSendEventsProvider for this object.
8354 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
8356 * Frees any resources associated with this object given its this_arg pointer.
8357 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8359 void (*free)(void *this_arg);
8360 } LDKRoutingMessageHandler;
8365 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
8366 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
8368 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
8370 * A pointer to the opaque Rust object.
8371 * Nearly everywhere, inner must be non-null, however in places where
8372 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8374 LDKnativeIgnoringMessageHandler *inner;
8376 * Indicates that this is the only struct which contains the same pointer.
8377 * Rust functions which take ownership of an object provided via an argument require
8378 * this to be true and invalidate the object pointed to by inner.
8381 } LDKIgnoringMessageHandler;
8386 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
8387 * You can provide one of these as the route_handler in a MessageHandler.
8389 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
8391 * A pointer to the opaque Rust object.
8392 * Nearly everywhere, inner must be non-null, however in places where
8393 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8395 LDKnativeErroringMessageHandler *inner;
8397 * Indicates that this is the only struct which contains the same pointer.
8398 * Rust functions which take ownership of an object provided via an argument require
8399 * this to be true and invalidate the object pointed to by inner.
8402 } LDKErroringMessageHandler;
8407 * Provides references to trait impls which handle different types of messages.
8409 typedef struct MUST_USE_STRUCT LDKMessageHandler {
8411 * A pointer to the opaque Rust object.
8412 * Nearly everywhere, inner must be non-null, however in places where
8413 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8415 LDKnativeMessageHandler *inner;
8417 * Indicates that this is the only struct which contains the same pointer.
8418 * Rust functions which take ownership of an object provided via an argument require
8419 * this to be true and invalidate the object pointed to by inner.
8422 } LDKMessageHandler;
8425 * Provides an object which can be used to send data to and which uniquely identifies a connection
8426 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
8427 * implement Hash to meet the PeerManager API.
8429 * For efficiency, Clone should be relatively cheap for this type.
8431 * You probably want to just extend an int and put a file descriptor in a struct and implement
8432 * send_data. Note that if you are using a higher-level net library that may call close() itself,
8433 * be careful to ensure you don't have races whereby you might register a new connection with an
8434 * fd which is the same as a previous one which has yet to be removed via
8435 * PeerManager::socket_disconnected().
8437 typedef struct LDKSocketDescriptor {
8439 * An opaque pointer which is passed to your function implementations as an argument.
8440 * This has no meaning in the LDK, and can be NULL or any other value.
8444 * Attempts to send some data from the given slice to the peer.
8446 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
8447 * Note that in the disconnected case, socket_disconnected must still fire and further write
8448 * attempts may occur until that time.
8450 * If the returned size is smaller than data.len(), a write_available event must
8451 * trigger the next time more data can be written. Additionally, until the a send_data event
8452 * completes fully, no further read_events should trigger on the same peer!
8454 * If a read_event on this descriptor had previously returned true (indicating that read
8455 * events should be paused to prevent DoS in the send buffer), resume_read may be set
8456 * indicating that read events on this descriptor should resume. A resume_read of false does
8457 * *not* imply that further read events should be paused.
8459 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
8461 * Disconnect the socket pointed to by this SocketDescriptor. Once this function returns, no
8462 * more calls to write_buffer_space_avail, read_event or socket_disconnected may be made with
8463 * this descriptor. No socket_disconnected call should be generated as a result of this call,
8464 * though races may occur whereby disconnect_socket is called after a call to
8465 * socket_disconnected but prior to socket_disconnected returning.
8467 void (*disconnect_socket)(void *this_arg);
8469 * Checks if two objects are equal given this object's this_arg pointer and another object.
8471 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
8473 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
8474 * This is used, for example, for inclusion of this object in a hash map.
8476 uint64_t (*hash)(const void *this_arg);
8478 * Creates a copy of the object pointed to by this_arg, for a copy of this SocketDescriptor.
8479 * Note that the ultimate copy of the SocketDescriptor will have all function pointers the same as the original.
8480 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new SocketDescriptor.
8482 void *(*clone)(const void *this_arg);
8484 * Frees any resources associated with this object given its this_arg pointer.
8485 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8487 void (*free)(void *this_arg);
8488 } LDKSocketDescriptor;
8493 * A PeerManager manages a set of peers, described by their SocketDescriptor and marshalls socket
8494 * events into messages which it passes on to its MessageHandlers.
8496 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
8497 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
8498 * essentially you should default to using a SimpleRefPeerManager, and use a
8499 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
8500 * you're using lightning-net-tokio.
8502 typedef struct MUST_USE_STRUCT LDKPeerManager {
8504 * A pointer to the opaque Rust object.
8505 * Nearly everywhere, inner must be non-null, however in places where
8506 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8508 LDKnativePeerManager *inner;
8510 * Indicates that this is the only struct which contains the same pointer.
8511 * Rust functions which take ownership of an object provided via an argument require
8512 * this to be true and invalidate the object pointed to by inner.
8520 * Static channel fields used to build transactions given per-commitment fields, organized by
8521 * broadcaster/countersignatory.
8523 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
8524 * as_holder_broadcastable and as_counterparty_broadcastable functions.
8526 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
8528 * A pointer to the opaque Rust object.
8529 * Nearly everywhere, inner must be non-null, however in places where
8530 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8532 LDKnativeDirectedChannelTransactionParameters *inner;
8534 * Indicates that this is the only struct which contains the same pointer.
8535 * Rust functions which take ownership of an object provided via an argument require
8536 * this to be true and invalidate the object pointed to by inner.
8539 } LDKDirectedChannelTransactionParameters;
8544 * A simple newtype for RwLockReadGuard<'a, NetworkGraph>.
8545 * This exists only to make accessing a RwLock<NetworkGraph> possible from
8546 * the C bindings, as it can be done directly in Rust code.
8548 typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
8550 * A pointer to the opaque Rust object.
8551 * Nearly everywhere, inner must be non-null, however in places where
8552 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8554 LDKnativeLockedNetworkGraph *inner;
8556 * Indicates that this is the only struct which contains the same pointer.
8557 * Rust functions which take ownership of an object provided via an argument require
8558 * this to be true and invalidate the object pointed to by inner.
8561 } LDKLockedNetworkGraph;
8566 * Receives and validates network updates from peers,
8567 * stores authentic and relevant data as a network graph.
8568 * This network graph is then used for routing payments.
8569 * Provides interface to help with initial routing sync by
8570 * serving historical announcements.
8572 typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
8574 * A pointer to the opaque Rust object.
8575 * Nearly everywhere, inner must be non-null, however in places where
8576 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8578 LDKnativeNetGraphMsgHandler *inner;
8580 * Indicates that this is the only struct which contains the same pointer.
8581 * Rust functions which take ownership of an object provided via an argument require
8582 * this to be true and invalidate the object pointed to by inner.
8585 } LDKNetGraphMsgHandler;
8590 * FilesystemPersister persists channel data on disk, where each channel's
8591 * data is stored in a file named after its funding outpoint.
8593 * Warning: this module does the best it can with calls to persist data, but it
8594 * can only guarantee that the data is passed to the drive. It is up to the
8595 * drive manufacturers to do the actual persistence properly, which they often
8596 * don't (especially on consumer-grade hardware). Therefore, it is up to the
8597 * user to validate their entire storage stack, to ensure the writes are
8599 * Corollary: especially when dealing with larger amounts of money, it is best
8600 * practice to have multiple channel data backups and not rely only on one
8601 * FilesystemPersister.
8603 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
8605 * A pointer to the opaque Rust object.
8606 * Nearly everywhere, inner must be non-null, however in places where
8607 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8609 LDKnativeFilesystemPersister *inner;
8611 * Indicates that this is the only struct which contains the same pointer.
8612 * Rust functions which take ownership of an object provided via an argument require
8613 * this to be true and invalidate the object pointed to by inner.
8616 } LDKFilesystemPersister;
8621 * Data of the `RawInvoice` that is encoded in the data part
8623 typedef struct MUST_USE_STRUCT LDKRawDataPart {
8625 * A pointer to the opaque Rust object.
8626 * Nearly everywhere, inner must be non-null, however in places where
8627 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8629 LDKnativeRawDataPart *inner;
8631 * Indicates that this is the only struct which contains the same pointer.
8632 * Rust functions which take ownership of an object provided via an argument require
8633 * this to be true and invalidate the object pointed to by inner.
8643 typedef struct MUST_USE_STRUCT LDKSha256 {
8645 * A pointer to the opaque Rust object.
8646 * Nearly everywhere, inner must be non-null, however in places where
8647 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8649 LDKnativeSha256 *inner;
8651 * Indicates that this is the only struct which contains the same pointer.
8652 * Rust functions which take ownership of an object provided via an argument require
8653 * this to be true and invalidate the object pointed to by inner.
8661 * `min_final_cltv_expiry` to use for the last HTLC in the route
8663 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiry {
8665 * A pointer to the opaque Rust object.
8666 * Nearly everywhere, inner must be non-null, however in places where
8667 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8669 LDKnativeMinFinalCltvExpiry *inner;
8671 * Indicates that this is the only struct which contains the same pointer.
8672 * Rust functions which take ownership of an object provided via an argument require
8673 * this to be true and invalidate the object pointed to by inner.
8676 } LDKMinFinalCltvExpiry;
8679 * Integer in the range `0..32`
8681 typedef struct LDKu5 {
8686 * A 20-byte byte array.
8688 typedef struct LDKTwentyBytes {
8696 * Fallback address in case no LN payment is possible
8698 typedef enum LDKFallback_Tag {
8699 LDKFallback_SegWitProgram,
8700 LDKFallback_PubKeyHash,
8701 LDKFallback_ScriptHash,
8703 * Must be last for serialization purposes
8705 LDKFallback_Sentinel,
8708 typedef struct LDKFallback_LDKSegWitProgram_Body {
8709 struct LDKu5 version;
8710 struct LDKCVec_u8Z program;
8711 } LDKFallback_LDKSegWitProgram_Body;
8713 typedef struct MUST_USE_STRUCT LDKFallback {
8714 LDKFallback_Tag tag;
8716 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
8718 struct LDKTwentyBytes pub_key_hash;
8721 struct LDKTwentyBytes script_hash;
8726 extern const uintptr_t MAX_BUF_SIZE;
8728 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
8730 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
8732 extern const uint16_t BREAKDOWN_TIMEOUT;
8734 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
8736 extern const uint32_t MIN_FINAL_CLTV_EXPIRY;
8738 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
8740 extern const uint8_t TAG_PAYMENT_HASH;
8742 extern const uint8_t TAG_DESCRIPTION;
8744 extern const uint8_t TAG_PAYEE_PUB_KEY;
8746 extern const uint8_t TAG_DESCRIPTION_HASH;
8748 extern const uint8_t TAG_EXPIRY_TIME;
8750 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY;
8752 extern const uint8_t TAG_FALLBACK;
8754 extern const uint8_t TAG_ROUTE;
8756 extern const uint8_t TAG_PAYMENT_SECRET;
8758 extern const uint8_t TAG_FEATURES;
8760 struct LDKStr _ldk_get_compiled_version(void);
8762 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
8765 * Frees the data buffer, if data_is_owned is set and datalen > 0.
8767 void Transaction_free(struct LDKTransaction _res);
8770 * Frees the data pointed to by script_pubkey.
8772 void TxOut_free(struct LDKTxOut _res);
8775 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
8777 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
8780 * Frees the data buffer, if chars_is_owned is set and len > 0.
8782 void Str_free(struct LDKStr _res);
8785 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
8787 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
8790 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
8792 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
8795 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
8797 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
8800 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
8801 * but with all dynamically-allocated buffers duplicated in new buffers.
8803 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
8806 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
8808 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
8811 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
8813 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
8816 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
8818 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
8821 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
8822 * but with all dynamically-allocated buffers duplicated in new buffers.
8824 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
8827 * Creates a new CResult_SecretKeyErrorZ in the success state.
8829 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
8832 * Creates a new CResult_SecretKeyErrorZ in the error state.
8834 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
8837 * Frees any resources used by the CResult_SecretKeyErrorZ.
8839 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
8842 * Creates a new CResult_PublicKeyErrorZ in the success state.
8844 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
8847 * Creates a new CResult_PublicKeyErrorZ in the error state.
8849 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
8852 * Frees any resources used by the CResult_PublicKeyErrorZ.
8854 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
8857 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
8859 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
8862 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
8864 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
8867 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
8869 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
8872 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
8873 * but with all dynamically-allocated buffers duplicated in new buffers.
8875 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
8878 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
8880 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
8883 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
8885 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
8888 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
8890 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
8893 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
8894 * but with all dynamically-allocated buffers duplicated in new buffers.
8896 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
8899 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
8901 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
8904 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
8906 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
8909 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
8911 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
8914 * Constructs a new COption_u32Z containing a u32
8916 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
8919 * Constructs a new COption_u32Z containing nothing
8921 struct LDKCOption_u32Z COption_u32Z_none(void);
8924 * Frees any resources associated with the u32, if we are in the Some state
8926 void COption_u32Z_free(struct LDKCOption_u32Z _res);
8929 * Creates a new COption_u32Z which has the same data as `orig`
8930 * but with all dynamically-allocated buffers duplicated in new buffers.
8932 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
8935 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
8937 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
8940 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
8942 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
8945 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
8947 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
8950 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
8951 * but with all dynamically-allocated buffers duplicated in new buffers.
8953 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
8956 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
8958 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
8961 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
8963 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
8966 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
8968 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
8971 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
8972 * but with all dynamically-allocated buffers duplicated in new buffers.
8974 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
8977 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
8979 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
8982 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
8984 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
8987 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
8989 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
8992 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
8993 * but with all dynamically-allocated buffers duplicated in new buffers.
8995 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
8998 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9000 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
9003 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
9005 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
9008 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
9010 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
9013 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
9015 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
9018 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
9019 * but with all dynamically-allocated buffers duplicated in new buffers.
9021 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
9024 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
9026 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
9029 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
9031 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
9034 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
9036 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
9039 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
9040 * but with all dynamically-allocated buffers duplicated in new buffers.
9042 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
9045 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
9047 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
9050 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
9052 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
9055 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
9057 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
9060 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
9061 * but with all dynamically-allocated buffers duplicated in new buffers.
9063 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
9066 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
9068 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
9071 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
9073 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
9076 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
9078 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
9081 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
9083 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
9086 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
9088 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
9091 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
9093 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
9096 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
9097 * but with all dynamically-allocated buffers duplicated in new buffers.
9099 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
9102 * Creates a new CResult_SiPrefixNoneZ in the success state.
9104 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_ok(enum LDKSiPrefix o);
9107 * Creates a new CResult_SiPrefixNoneZ in the error state.
9109 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_err(void);
9112 * Frees any resources used by the CResult_SiPrefixNoneZ.
9114 void CResult_SiPrefixNoneZ_free(struct LDKCResult_SiPrefixNoneZ _res);
9117 * Creates a new CResult_SiPrefixNoneZ which has the same data as `orig`
9118 * but with all dynamically-allocated buffers duplicated in new buffers.
9120 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_clone(const struct LDKCResult_SiPrefixNoneZ *NONNULL_PTR orig);
9123 * Creates a new CResult_InvoiceNoneZ in the success state.
9125 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_ok(struct LDKInvoice o);
9128 * Creates a new CResult_InvoiceNoneZ in the error state.
9130 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_err(void);
9133 * Frees any resources used by the CResult_InvoiceNoneZ.
9135 void CResult_InvoiceNoneZ_free(struct LDKCResult_InvoiceNoneZ _res);
9138 * Creates a new CResult_InvoiceNoneZ which has the same data as `orig`
9139 * but with all dynamically-allocated buffers duplicated in new buffers.
9141 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_clone(const struct LDKCResult_InvoiceNoneZ *NONNULL_PTR orig);
9144 * Creates a new CResult_SignedRawInvoiceNoneZ in the success state.
9146 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_ok(struct LDKSignedRawInvoice o);
9149 * Creates a new CResult_SignedRawInvoiceNoneZ in the error state.
9151 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_err(void);
9154 * Frees any resources used by the CResult_SignedRawInvoiceNoneZ.
9156 void CResult_SignedRawInvoiceNoneZ_free(struct LDKCResult_SignedRawInvoiceNoneZ _res);
9159 * Creates a new CResult_SignedRawInvoiceNoneZ which has the same data as `orig`
9160 * but with all dynamically-allocated buffers duplicated in new buffers.
9162 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_clone(const struct LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR orig);
9165 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9167 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
9170 * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements.
9172 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c);
9175 * Frees any resources used by the C3Tuple_RawInvoice_u832InvoiceSignatureZ.
9177 void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res);
9180 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
9182 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
9185 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
9187 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
9190 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
9192 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
9195 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9197 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
9200 * Constructs a new COption_u64Z containing a u64
9202 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
9205 * Constructs a new COption_u64Z containing nothing
9207 struct LDKCOption_u64Z COption_u64Z_none(void);
9210 * Frees any resources associated with the u64, if we are in the Some state
9212 void COption_u64Z_free(struct LDKCOption_u64Z _res);
9215 * Creates a new COption_u64Z which has the same data as `orig`
9216 * but with all dynamically-allocated buffers duplicated in new buffers.
9218 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
9221 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
9223 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
9226 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
9228 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
9231 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
9233 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
9236 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
9237 * but with all dynamically-allocated buffers duplicated in new buffers.
9239 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
9242 * Creates a new CResult_NoneSemanticErrorZ in the success state.
9244 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void);
9247 * Creates a new CResult_NoneSemanticErrorZ in the error state.
9249 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e);
9252 * Frees any resources used by the CResult_NoneSemanticErrorZ.
9254 void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res);
9257 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
9258 * but with all dynamically-allocated buffers duplicated in new buffers.
9260 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig);
9263 * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
9265 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o);
9268 * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
9270 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e);
9273 * Frees any resources used by the CResult_InvoiceSemanticErrorZ.
9275 void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res);
9278 * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig`
9279 * but with all dynamically-allocated buffers duplicated in new buffers.
9281 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig);
9284 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
9286 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
9289 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
9291 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
9294 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
9296 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
9299 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
9300 * but with all dynamically-allocated buffers duplicated in new buffers.
9302 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
9305 * Creates a new CResult_ExpiryTimeCreationErrorZ in the success state.
9307 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_ok(struct LDKExpiryTime o);
9310 * Creates a new CResult_ExpiryTimeCreationErrorZ in the error state.
9312 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_err(enum LDKCreationError e);
9315 * Frees any resources used by the CResult_ExpiryTimeCreationErrorZ.
9317 void CResult_ExpiryTimeCreationErrorZ_free(struct LDKCResult_ExpiryTimeCreationErrorZ _res);
9320 * Creates a new CResult_ExpiryTimeCreationErrorZ which has the same data as `orig`
9321 * but with all dynamically-allocated buffers duplicated in new buffers.
9323 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_clone(const struct LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR orig);
9326 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9328 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
9331 * Creates a new CResult_RouteHintCreationErrorZ in the success state.
9333 struct LDKCResult_RouteHintCreationErrorZ CResult_RouteHintCreationErrorZ_ok(struct LDKRouteHint o);
9336 * Creates a new CResult_RouteHintCreationErrorZ in the error state.
9338 struct LDKCResult_RouteHintCreationErrorZ CResult_RouteHintCreationErrorZ_err(enum LDKCreationError e);
9341 * Frees any resources used by the CResult_RouteHintCreationErrorZ.
9343 void CResult_RouteHintCreationErrorZ_free(struct LDKCResult_RouteHintCreationErrorZ _res);
9346 * Creates a new CResult_RouteHintCreationErrorZ which has the same data as `orig`
9347 * but with all dynamically-allocated buffers duplicated in new buffers.
9349 struct LDKCResult_RouteHintCreationErrorZ CResult_RouteHintCreationErrorZ_clone(const struct LDKCResult_RouteHintCreationErrorZ *NONNULL_PTR orig);
9352 * Creates a new CResult_StringErrorZ in the success state.
9354 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o);
9357 * Creates a new CResult_StringErrorZ in the error state.
9359 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
9362 * Frees any resources used by the CResult_StringErrorZ.
9364 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
9367 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
9369 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
9372 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
9374 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
9377 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
9379 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
9382 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
9383 * but with all dynamically-allocated buffers duplicated in new buffers.
9385 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
9388 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
9390 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
9393 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
9395 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
9398 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
9400 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
9403 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
9404 * but with all dynamically-allocated buffers duplicated in new buffers.
9406 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
9409 * Creates a new CResult_NoneMonitorUpdateErrorZ in the success state.
9411 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
9414 * Creates a new CResult_NoneMonitorUpdateErrorZ in the error state.
9416 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e);
9419 * Frees any resources used by the CResult_NoneMonitorUpdateErrorZ.
9421 void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res);
9424 * Creates a new CResult_NoneMonitorUpdateErrorZ which has the same data as `orig`
9425 * but with all dynamically-allocated buffers duplicated in new buffers.
9427 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig);
9430 * Creates a new tuple which has the same data as `orig`
9431 * but with all dynamically-allocated buffers duplicated in new buffers.
9433 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
9436 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
9438 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
9441 * Frees any resources used by the C2Tuple_OutPointScriptZ.
9443 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
9446 * Creates a new tuple which has the same data as `orig`
9447 * but with all dynamically-allocated buffers duplicated in new buffers.
9449 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
9452 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
9454 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
9457 * Frees any resources used by the C2Tuple_u32ScriptZ.
9459 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
9462 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9464 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
9467 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
9469 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
9472 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
9474 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
9477 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9479 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
9482 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9484 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
9487 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9489 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
9492 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9494 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
9497 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
9499 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
9502 * Frees any resources used by the C2Tuple_usizeTransactionZ.
9504 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
9507 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9509 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
9512 * Creates a new tuple which has the same data as `orig`
9513 * but with all dynamically-allocated buffers duplicated in new buffers.
9515 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
9518 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
9520 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
9523 * Frees any resources used by the C2Tuple_u32TxOutZ.
9525 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
9528 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9530 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
9533 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
9535 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
9538 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
9540 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
9543 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9545 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
9548 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9550 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
9553 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
9555 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
9558 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
9560 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
9563 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
9565 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
9568 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
9569 * but with all dynamically-allocated buffers duplicated in new buffers.
9571 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
9574 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
9576 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
9579 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
9581 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
9584 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
9586 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
9589 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
9591 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
9594 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
9596 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
9599 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9601 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
9604 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9606 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
9609 * Creates a new CResult_RouteDecodeErrorZ in the success state.
9611 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
9614 * Creates a new CResult_RouteDecodeErrorZ in the error state.
9616 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
9619 * Frees any resources used by the CResult_RouteDecodeErrorZ.
9621 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
9624 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
9625 * but with all dynamically-allocated buffers duplicated in new buffers.
9627 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
9630 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9632 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
9635 * Creates a new CResult_RouteLightningErrorZ in the success state.
9637 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
9640 * Creates a new CResult_RouteLightningErrorZ in the error state.
9642 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
9645 * Frees any resources used by the CResult_RouteLightningErrorZ.
9647 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
9650 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
9651 * but with all dynamically-allocated buffers duplicated in new buffers.
9653 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
9656 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9658 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
9661 * Creates a new CResult_boolLightningErrorZ in the success state.
9663 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
9666 * Creates a new CResult_boolLightningErrorZ in the error state.
9668 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
9671 * Frees any resources used by the CResult_boolLightningErrorZ.
9673 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
9676 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
9677 * but with all dynamically-allocated buffers duplicated in new buffers.
9679 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
9682 * Creates a new tuple which has the same data as `orig`
9683 * but with all dynamically-allocated buffers duplicated in new buffers.
9685 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
9688 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
9690 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
9693 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
9695 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
9698 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9700 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
9703 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9705 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
9708 * Creates a new CResult_NoneLightningErrorZ in the success state.
9710 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
9713 * Creates a new CResult_NoneLightningErrorZ in the error state.
9715 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
9718 * Frees any resources used by the CResult_NoneLightningErrorZ.
9720 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
9723 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
9724 * but with all dynamically-allocated buffers duplicated in new buffers.
9726 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
9729 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9731 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
9734 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
9736 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
9739 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
9741 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
9744 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
9746 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
9749 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
9750 * but with all dynamically-allocated buffers duplicated in new buffers.
9752 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
9755 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
9757 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
9760 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
9762 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
9765 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
9767 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
9770 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
9771 * but with all dynamically-allocated buffers duplicated in new buffers.
9773 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
9776 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
9778 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
9781 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
9783 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
9786 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
9788 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
9791 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
9792 * but with all dynamically-allocated buffers duplicated in new buffers.
9794 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
9797 * Creates a new CResult_TxOutAccessErrorZ in the success state.
9799 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
9802 * Creates a new CResult_TxOutAccessErrorZ in the error state.
9804 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
9807 * Frees any resources used by the CResult_TxOutAccessErrorZ.
9809 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
9812 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
9813 * but with all dynamically-allocated buffers duplicated in new buffers.
9815 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
9818 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ
9820 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
9823 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing
9825 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
9828 * Frees any resources associated with the crate::c_types::derived::C2Tuple_usizeTransactionZ, if we are in the Some state
9830 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
9833 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9835 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
9838 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the success state.
9840 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o);
9843 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the error state.
9845 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
9848 * Frees any resources used by the CResult_DirectionalChannelInfoDecodeErrorZ.
9850 void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res);
9853 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ which has the same data as `orig`
9854 * but with all dynamically-allocated buffers duplicated in new buffers.
9856 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig);
9859 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
9861 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
9864 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
9866 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
9869 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
9871 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
9874 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
9875 * but with all dynamically-allocated buffers duplicated in new buffers.
9877 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
9880 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
9882 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
9885 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
9887 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
9890 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
9892 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
9895 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
9896 * but with all dynamically-allocated buffers duplicated in new buffers.
9898 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
9901 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9903 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
9906 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
9908 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
9911 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
9913 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
9916 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
9918 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
9921 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
9922 * but with all dynamically-allocated buffers duplicated in new buffers.
9924 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
9927 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9929 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
9932 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
9934 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
9937 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
9939 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
9942 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
9944 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
9947 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
9948 * but with all dynamically-allocated buffers duplicated in new buffers.
9950 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
9953 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
9955 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
9958 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
9960 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
9963 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
9965 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
9968 * Creates a new CResult_NetworkGraphDecodeErrorZ which has the same data as `orig`
9969 * but with all dynamically-allocated buffers duplicated in new buffers.
9971 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
9974 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
9976 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
9979 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
9981 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
9984 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
9986 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
9989 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
9991 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
9994 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
9996 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
9999 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
10001 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
10004 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
10006 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
10009 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
10011 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
10014 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
10016 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
10019 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
10021 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
10024 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
10026 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
10029 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
10031 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
10034 * Creates a new CResult_NetAddressu8Z in the success state.
10036 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
10039 * Creates a new CResult_NetAddressu8Z in the error state.
10041 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
10044 * Frees any resources used by the CResult_NetAddressu8Z.
10046 void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
10049 * Creates a new CResult_NetAddressu8Z which has the same data as `orig`
10050 * but with all dynamically-allocated buffers duplicated in new buffers.
10052 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
10055 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the success state.
10057 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
10060 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the error state.
10062 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
10065 * Frees any resources used by the CResult_CResult_NetAddressu8ZDecodeErrorZ.
10067 void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
10070 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ which has the same data as `orig`
10071 * but with all dynamically-allocated buffers duplicated in new buffers.
10073 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
10076 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10078 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
10081 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10083 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
10086 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10088 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
10091 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10093 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
10096 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
10098 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
10101 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
10103 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
10106 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
10108 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
10111 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
10112 * but with all dynamically-allocated buffers duplicated in new buffers.
10114 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
10117 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
10119 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
10122 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
10124 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
10127 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
10129 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
10132 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
10133 * but with all dynamically-allocated buffers duplicated in new buffers.
10135 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
10138 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
10140 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
10143 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
10145 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
10148 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
10150 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
10153 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
10154 * but with all dynamically-allocated buffers duplicated in new buffers.
10156 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
10159 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
10161 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
10164 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
10166 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
10169 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
10171 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
10174 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
10175 * but with all dynamically-allocated buffers duplicated in new buffers.
10177 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
10180 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
10182 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
10185 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
10187 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
10190 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
10192 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
10195 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
10196 * but with all dynamically-allocated buffers duplicated in new buffers.
10198 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
10201 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
10203 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
10206 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
10208 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
10211 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
10213 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
10216 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
10217 * but with all dynamically-allocated buffers duplicated in new buffers.
10219 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
10222 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
10224 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
10227 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
10229 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
10232 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
10234 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
10237 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
10238 * but with all dynamically-allocated buffers duplicated in new buffers.
10240 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
10243 * Creates a new CResult_FundingLockedDecodeErrorZ in the success state.
10245 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o);
10248 * Creates a new CResult_FundingLockedDecodeErrorZ in the error state.
10250 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e);
10253 * Frees any resources used by the CResult_FundingLockedDecodeErrorZ.
10255 void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res);
10258 * Creates a new CResult_FundingLockedDecodeErrorZ which has the same data as `orig`
10259 * but with all dynamically-allocated buffers duplicated in new buffers.
10261 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig);
10264 * Creates a new CResult_InitDecodeErrorZ in the success state.
10266 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
10269 * Creates a new CResult_InitDecodeErrorZ in the error state.
10271 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
10274 * Frees any resources used by the CResult_InitDecodeErrorZ.
10276 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
10279 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
10280 * but with all dynamically-allocated buffers duplicated in new buffers.
10282 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
10285 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
10287 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
10290 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
10292 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
10295 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
10297 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
10300 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
10301 * but with all dynamically-allocated buffers duplicated in new buffers.
10303 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
10306 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
10308 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
10311 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
10313 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
10316 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
10318 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
10321 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
10322 * but with all dynamically-allocated buffers duplicated in new buffers.
10324 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
10327 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
10329 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
10332 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
10334 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
10337 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
10339 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
10342 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
10343 * but with all dynamically-allocated buffers duplicated in new buffers.
10345 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
10348 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
10350 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
10353 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
10355 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
10358 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
10360 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
10363 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
10364 * but with all dynamically-allocated buffers duplicated in new buffers.
10366 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
10369 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
10371 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
10374 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
10376 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
10379 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
10381 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
10384 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
10385 * but with all dynamically-allocated buffers duplicated in new buffers.
10387 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
10390 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
10392 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
10395 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
10397 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
10400 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
10402 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
10405 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
10406 * but with all dynamically-allocated buffers duplicated in new buffers.
10408 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
10411 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
10413 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
10416 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
10418 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
10421 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
10423 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
10426 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
10427 * but with all dynamically-allocated buffers duplicated in new buffers.
10429 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
10432 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
10434 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
10437 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
10439 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
10442 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
10444 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
10447 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
10448 * but with all dynamically-allocated buffers duplicated in new buffers.
10450 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
10453 * Creates a new CResult_PingDecodeErrorZ in the success state.
10455 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
10458 * Creates a new CResult_PingDecodeErrorZ in the error state.
10460 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
10463 * Frees any resources used by the CResult_PingDecodeErrorZ.
10465 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
10468 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
10469 * but with all dynamically-allocated buffers duplicated in new buffers.
10471 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
10474 * Creates a new CResult_PongDecodeErrorZ in the success state.
10476 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
10479 * Creates a new CResult_PongDecodeErrorZ in the error state.
10481 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
10484 * Frees any resources used by the CResult_PongDecodeErrorZ.
10486 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
10489 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
10490 * but with all dynamically-allocated buffers duplicated in new buffers.
10492 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
10495 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
10497 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
10500 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
10502 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
10505 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
10507 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
10510 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
10511 * but with all dynamically-allocated buffers duplicated in new buffers.
10513 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
10516 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
10518 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
10521 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
10523 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
10526 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
10528 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
10531 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
10532 * but with all dynamically-allocated buffers duplicated in new buffers.
10534 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
10537 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
10539 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
10542 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
10544 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
10547 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
10549 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
10552 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
10553 * but with all dynamically-allocated buffers duplicated in new buffers.
10555 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
10558 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
10560 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
10563 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
10565 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
10568 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
10570 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
10573 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
10574 * but with all dynamically-allocated buffers duplicated in new buffers.
10576 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
10579 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
10581 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
10584 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
10586 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
10589 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
10591 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
10594 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
10595 * but with all dynamically-allocated buffers duplicated in new buffers.
10597 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
10600 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
10602 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
10605 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
10607 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
10610 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
10612 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
10615 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
10616 * but with all dynamically-allocated buffers duplicated in new buffers.
10618 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
10621 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
10623 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
10626 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
10628 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
10631 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
10633 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
10636 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
10637 * but with all dynamically-allocated buffers duplicated in new buffers.
10639 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
10642 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
10644 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
10647 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
10649 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
10652 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
10654 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
10657 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
10658 * but with all dynamically-allocated buffers duplicated in new buffers.
10660 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
10663 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
10665 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
10668 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
10670 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
10673 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
10675 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
10678 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
10679 * but with all dynamically-allocated buffers duplicated in new buffers.
10681 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
10684 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
10686 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
10689 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
10691 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
10694 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
10696 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
10699 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
10700 * but with all dynamically-allocated buffers duplicated in new buffers.
10702 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
10705 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
10707 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
10710 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
10712 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
10715 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
10717 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
10720 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
10721 * but with all dynamically-allocated buffers duplicated in new buffers.
10723 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
10726 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
10728 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
10731 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
10733 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
10736 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
10738 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
10741 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
10742 * but with all dynamically-allocated buffers duplicated in new buffers.
10744 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
10747 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state.
10749 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o);
10752 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state.
10754 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
10757 * Frees any resources used by the CResult_InvoiceSignOrCreationErrorZ.
10759 void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res);
10762 * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig`
10763 * but with all dynamically-allocated buffers duplicated in new buffers.
10765 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
10768 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
10770 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
10773 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
10775 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
10778 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
10780 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
10783 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
10784 * but with all dynamically-allocated buffers duplicated in new buffers.
10786 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
10789 * Creates a new tuple which has the same data as `orig`
10790 * but with all dynamically-allocated buffers duplicated in new buffers.
10792 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
10795 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
10797 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
10800 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
10802 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
10805 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
10807 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
10810 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
10812 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
10815 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
10817 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
10820 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
10821 * but with all dynamically-allocated buffers duplicated in new buffers.
10823 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
10826 * Creates a new CResult_SignatureNoneZ in the success state.
10828 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
10831 * Creates a new CResult_SignatureNoneZ in the error state.
10833 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
10836 * Frees any resources used by the CResult_SignatureNoneZ.
10838 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
10841 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
10842 * but with all dynamically-allocated buffers duplicated in new buffers.
10844 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
10847 * Creates a new CResult_SignDecodeErrorZ in the success state.
10849 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
10852 * Creates a new CResult_SignDecodeErrorZ in the error state.
10854 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
10857 * Frees any resources used by the CResult_SignDecodeErrorZ.
10859 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
10862 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
10863 * but with all dynamically-allocated buffers duplicated in new buffers.
10865 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
10868 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
10870 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
10873 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
10875 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
10878 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
10880 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
10883 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
10884 * but with all dynamically-allocated buffers duplicated in new buffers.
10886 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
10889 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10891 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
10894 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
10896 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
10899 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
10901 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
10904 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
10906 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
10909 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
10910 * but with all dynamically-allocated buffers duplicated in new buffers.
10912 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
10915 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
10917 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
10920 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
10922 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
10925 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
10927 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
10930 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
10931 * but with all dynamically-allocated buffers duplicated in new buffers.
10933 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
10936 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10938 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
10941 * Creates a new CResult_TransactionNoneZ in the success state.
10943 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
10946 * Creates a new CResult_TransactionNoneZ in the error state.
10948 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
10951 * Frees any resources used by the CResult_TransactionNoneZ.
10953 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
10956 * Creates a new CResult_NoneErrorZ in the success state.
10958 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
10961 * Creates a new CResult_NoneErrorZ in the error state.
10963 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
10966 * Frees any resources used by the CResult_NoneErrorZ.
10968 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
10971 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10973 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
10976 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
10978 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
10981 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
10983 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
10986 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
10988 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
10991 * Creates a new CResult_NoneAPIErrorZ in the success state.
10993 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
10996 * Creates a new CResult_NoneAPIErrorZ in the error state.
10998 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
11001 * Frees any resources used by the CResult_NoneAPIErrorZ.
11003 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
11006 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
11007 * but with all dynamically-allocated buffers duplicated in new buffers.
11009 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
11012 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11014 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
11017 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11019 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
11022 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
11024 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
11027 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
11029 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
11032 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
11034 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
11037 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
11038 * but with all dynamically-allocated buffers duplicated in new buffers.
11040 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
11043 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
11045 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
11048 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
11050 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
11053 * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
11055 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
11058 * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
11060 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
11063 * Frees any resources used by the CResult_PaymentSecretAPIErrorZ.
11065 void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res);
11068 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11070 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
11073 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
11075 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
11078 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
11080 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
11083 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
11085 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
11088 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
11090 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
11093 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
11095 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
11098 * Frees any resources used by the Event
11100 void Event_free(struct LDKEvent this_ptr);
11103 * Creates a copy of the Event
11105 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
11108 * Serialize the Event object into a byte array which can be read by Event_read
11110 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
11113 * Frees any resources used by the MessageSendEvent
11115 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
11118 * Creates a copy of the MessageSendEvent
11120 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
11123 * Calls the free function if one is set
11125 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
11128 * Calls the free function if one is set
11130 void EventsProvider_free(struct LDKEventsProvider this_ptr);
11133 * Frees any resources used by the APIError
11135 void APIError_free(struct LDKAPIError this_ptr);
11138 * Creates a copy of the APIError
11140 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
11143 * Creates a digital signature of a message given a SecretKey, like the node's secret.
11144 * 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.
11145 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
11147 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, struct LDKSecretKey sk);
11150 * Recovers the PublicKey of the signer of the message given the message and the signature.
11152 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
11155 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
11156 * and the PublicKey.
11158 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
11161 * Creates a copy of the Level
11163 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
11166 * Returns the most verbose logging level.
11168 MUST_USE_RES enum LDKLevel Level_max(void);
11171 * Calls the free function if one is set
11173 void Logger_free(struct LDKLogger this_ptr);
11176 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
11178 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
11181 * Confirmations we will wait for before considering the channel locked in.
11182 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
11183 * equivalent limit applied to outbound channels).
11185 * Default value: 6.
11187 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
11190 * Confirmations we will wait for before considering the channel locked in.
11191 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
11192 * equivalent limit applied to outbound channels).
11194 * Default value: 6.
11196 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
11199 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
11200 * the number of blocks we have to punish our counterparty if they broadcast a revoked
11203 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
11204 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
11205 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
11206 * possibly with time in between to RBF the spending transaction).
11208 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
11209 * case of an honest unilateral channel close, which implicitly decrease the economic value of
11212 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
11213 * can tweak config to ask for more security, not less.
11215 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
11218 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
11219 * the number of blocks we have to punish our counterparty if they broadcast a revoked
11222 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
11223 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
11224 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
11225 * possibly with time in between to RBF the spending transaction).
11227 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
11228 * case of an honest unilateral channel close, which implicitly decrease the economic value of
11231 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
11232 * can tweak config to ask for more security, not less.
11234 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
11237 * Set to the smallest value HTLC we will accept to process.
11239 * This value is sent to our counterparty on channel-open and we close the channel any time
11240 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
11242 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
11245 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
11248 * Set to the smallest value HTLC we will accept to process.
11250 * This value is sent to our counterparty on channel-open and we close the channel any time
11251 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
11253 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
11256 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
11259 * Constructs a new ChannelHandshakeConfig given each field
11261 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);
11264 * Creates a copy of the ChannelHandshakeConfig
11266 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
11269 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
11271 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
11274 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
11276 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
11279 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
11280 * only applies to inbound channels.
11282 * Default value: 0.
11284 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11287 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
11288 * only applies to inbound channels.
11290 * Default value: 0.
11292 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11295 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
11296 * you to limit the maximum minimum-size they can require.
11298 * Default value: u64::max_value.
11300 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11303 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
11304 * you to limit the maximum minimum-size they can require.
11306 * Default value: u64::max_value.
11308 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11311 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
11312 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
11314 * Default value: 0.
11316 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11319 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
11320 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
11322 * Default value: 0.
11324 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11327 * The remote node will require we keep a certain amount in direct payment to ourselves at all
11328 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
11329 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
11331 * Default value: u64::max_value.
11333 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11336 * The remote node will require we keep a certain amount in direct payment to ourselves at all
11337 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
11338 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
11340 * Default value: u64::max_value.
11342 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11345 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
11346 * time. This allows you to set a minimum such value.
11348 * Default value: 0.
11350 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11353 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
11354 * time. This allows you to set a minimum such value.
11356 * Default value: 0.
11358 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
11361 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
11362 * required to always be higher than this value so this only applies to HTLC outputs (and
11363 * potentially to-self outputs before any payments have been made).
11364 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
11365 * This setting allows you to set a minimum dust limit for their commitment transactions,
11366 * reflecting the reality that tiny outputs are not considered standard transactions and will
11367 * not propagate through the Bitcoin network.
11369 * Default value: 546, the current dust limit on the Bitcoin network.
11371 uint64_t ChannelHandshakeLimits_get_min_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11374 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
11375 * required to always be higher than this value so this only applies to HTLC outputs (and
11376 * potentially to-self outputs before any payments have been made).
11377 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
11378 * This setting allows you to set a minimum dust limit for their commitment transactions,
11379 * reflecting the reality that tiny outputs are not considered standard transactions and will
11380 * not propagate through the Bitcoin network.
11382 * Default value: 546, the current dust limit on the Bitcoin network.
11384 void ChannelHandshakeLimits_set_min_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11387 * Maximum allowed threshold above which outputs will not be generated in their commitment
11389 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
11391 * Default value: u64::max_value.
11393 uint64_t ChannelHandshakeLimits_get_max_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11396 * Maximum allowed threshold above which outputs will not be generated in their commitment
11398 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
11400 * Default value: u64::max_value.
11402 void ChannelHandshakeLimits_set_max_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11405 * Before a channel is usable the funding transaction will need to be confirmed by at least a
11406 * certain number of blocks, specified by the node which is not the funder (as the funder can
11407 * assume they aren't going to double-spend themselves).
11408 * This config allows you to set a limit on the maximum amount of time to wait.
11410 * Default value: 144, or roughly one day and only applies to outbound channels.
11412 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11415 * Before a channel is usable the funding transaction will need to be confirmed by at least a
11416 * certain number of blocks, specified by the node which is not the funder (as the funder can
11417 * assume they aren't going to double-spend themselves).
11418 * This config allows you to set a limit on the maximum amount of time to wait.
11420 * Default value: 144, or roughly one day and only applies to outbound channels.
11422 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
11425 * Set to force the incoming channel to match our announced channel preference in
11428 * Default value: true, to make the default that no announced channels are possible (which is
11429 * appropriate for any nodes which are not online very reliably).
11431 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11434 * Set to force the incoming channel to match our announced channel preference in
11437 * Default value: true, to make the default that no announced channels are possible (which is
11438 * appropriate for any nodes which are not online very reliably).
11440 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
11443 * Set to the amount of time we're willing to wait to claim money back to us.
11445 * Not checking this value would be a security issue, as our peer would be able to set it to
11446 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
11448 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
11449 * reduce the loss of having useless locked funds (if your peer accepts)
11451 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11454 * Set to the amount of time we're willing to wait to claim money back to us.
11456 * Not checking this value would be a security issue, as our peer would be able to set it to
11457 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
11459 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
11460 * reduce the loss of having useless locked funds (if your peer accepts)
11462 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
11465 * Constructs a new ChannelHandshakeLimits given each field
11467 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, uint64_t min_dust_limit_satoshis_arg, uint64_t max_dust_limit_satoshis_arg, uint32_t max_minimum_depth_arg, bool force_announced_channel_preference_arg, uint16_t their_to_self_delay_arg);
11470 * Creates a copy of the ChannelHandshakeLimits
11472 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
11475 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
11477 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
11480 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
11482 void ChannelConfig_free(struct LDKChannelConfig this_obj);
11485 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
11486 * This may be allowed to change at runtime in a later update, however doing so must result in
11487 * update messages sent to notify all nodes of our updated relay fee.
11489 * Default value: 0.
11491 uint32_t ChannelConfig_get_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
11494 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
11495 * This may be allowed to change at runtime in a later update, however doing so must result in
11496 * update messages sent to notify all nodes of our updated relay fee.
11498 * Default value: 0.
11500 void ChannelConfig_set_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
11503 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
11504 * the channel this config applies to.
11506 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
11507 * HTLC balance when a channel appears on-chain whereas
11508 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
11509 * (non-HTLC-encumbered) balance.
11511 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
11512 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
11513 * commitment transaction at least once per this many blocks (minus some margin to allow us
11514 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
11515 * the spending transaction).
11517 * Default value: 72 (12 hours at an average of 6 blocks/hour).
11518 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
11519 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
11521 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
11523 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
11526 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
11527 * the channel this config applies to.
11529 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
11530 * HTLC balance when a channel appears on-chain whereas
11531 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
11532 * (non-HTLC-encumbered) balance.
11534 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
11535 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
11536 * commitment transaction at least once per this many blocks (minus some margin to allow us
11537 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
11538 * the spending transaction).
11540 * Default value: 72 (12 hours at an average of 6 blocks/hour).
11541 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
11542 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
11544 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
11546 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
11549 * Set to announce the channel publicly and notify all nodes that they can route via this
11552 * This should only be set to true for nodes which expect to be online reliably.
11554 * As the node which funds a channel picks this value this will only apply for new outbound
11555 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
11557 * This cannot be changed after the initial channel handshake.
11559 * Default value: false.
11561 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
11564 * Set to announce the channel publicly and notify all nodes that they can route via this
11567 * This should only be set to true for nodes which expect to be online reliably.
11569 * As the node which funds a channel picks this value this will only apply for new outbound
11570 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
11572 * This cannot be changed after the initial channel handshake.
11574 * Default value: false.
11576 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
11579 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
11580 * supports it, they will then enforce the mutual-close output to us matches what we provided
11581 * at intialization, preventing us from closing to an alternate pubkey.
11583 * This is set to true by default to provide a slight increase in security, though ultimately
11584 * any attacker who is able to take control of a channel can just as easily send the funds via
11585 * lightning payments, so we never require that our counterparties support this option.
11587 * This cannot be changed after a channel has been initialized.
11589 * Default value: true.
11591 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
11594 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
11595 * supports it, they will then enforce the mutual-close output to us matches what we provided
11596 * at intialization, preventing us from closing to an alternate pubkey.
11598 * This is set to true by default to provide a slight increase in security, though ultimately
11599 * any attacker who is able to take control of a channel can just as easily send the funds via
11600 * lightning payments, so we never require that our counterparties support this option.
11602 * This cannot be changed after a channel has been initialized.
11604 * Default value: true.
11606 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
11609 * Constructs a new ChannelConfig given each field
11611 MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg);
11614 * Creates a copy of the ChannelConfig
11616 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
11619 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
11621 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
11624 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
11626 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
11629 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
11631 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
11634 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
11636 void UserConfig_free(struct LDKUserConfig this_obj);
11639 * Channel config that we propose to our counterparty.
11641 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
11644 * Channel config that we propose to our counterparty.
11646 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
11649 * Limits applied to our counterparty's proposed channel config settings.
11651 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
11654 * Limits applied to our counterparty's proposed channel config settings.
11656 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
11659 * Channel config which affects behavior during channel lifetime.
11661 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
11664 * Channel config which affects behavior during channel lifetime.
11666 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
11669 * Constructs a new UserConfig given each field
11671 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);
11674 * Creates a copy of the UserConfig
11676 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
11679 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
11681 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
11684 * Creates a copy of the AccessError
11686 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
11689 * Calls the free function if one is set
11691 void Access_free(struct LDKAccess this_ptr);
11694 * Calls the free function if one is set
11696 void Listen_free(struct LDKListen this_ptr);
11699 * Calls the free function if one is set
11701 void Confirm_free(struct LDKConfirm this_ptr);
11704 * Calls the free function if one is set
11706 void Watch_free(struct LDKWatch this_ptr);
11709 * Calls the free function if one is set
11711 void Filter_free(struct LDKFilter this_ptr);
11714 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
11716 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
11719 * First block where the transaction output may have been spent.
11721 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
11724 * First block where the transaction output may have been spent.
11726 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11729 * Outpoint identifying the transaction output.
11731 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
11734 * Outpoint identifying the transaction output.
11736 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
11739 * Spending condition of the transaction output.
11741 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
11744 * Spending condition of the transaction output.
11746 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
11749 * Constructs a new WatchedOutput given each field
11751 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
11754 * Calls the free function if one is set
11756 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
11759 * Creates a copy of the ConfirmationTarget
11761 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
11764 * Calls the free function if one is set
11766 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
11769 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
11771 void ChainMonitor_free(struct LDKChainMonitor this_obj);
11774 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
11776 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
11777 * will call back to it indicating transactions and outputs of interest. This allows clients to
11778 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
11779 * always need to fetch full blocks absent another means for determining which blocks contain
11780 * transactions relevant to the watched channels.
11782 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
11785 * Constructs a new Listen which calls the relevant methods on this_arg.
11786 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
11788 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
11791 * Constructs a new Confirm which calls the relevant methods on this_arg.
11792 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
11794 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
11797 * Constructs a new Watch which calls the relevant methods on this_arg.
11798 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
11800 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
11803 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
11804 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
11806 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
11809 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
11811 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
11814 * The sequence number of this update. Updates *must* be replayed in-order according to this
11815 * sequence number (and updates may panic if they are not). The update_id values are strictly
11816 * increasing and increase by one for each new update, with one exception specified below.
11818 * This sequence number is also used to track up to which points updates which returned
11819 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
11820 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
11822 * The only instance where update_id values are not strictly increasing is the case where we
11823 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
11824 * its docs for more details.
11826 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
11829 * The sequence number of this update. Updates *must* be replayed in-order according to this
11830 * sequence number (and updates may panic if they are not). The update_id values are strictly
11831 * increasing and increase by one for each new update, with one exception specified below.
11833 * This sequence number is also used to track up to which points updates which returned
11834 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
11835 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
11837 * The only instance where update_id values are not strictly increasing is the case where we
11838 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
11839 * its docs for more details.
11841 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
11844 * Creates a copy of the ChannelMonitorUpdate
11846 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
11849 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
11851 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
11854 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
11856 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
11859 * Creates a copy of the ChannelMonitorUpdateErr
11861 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
11864 * Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
11866 void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
11869 * Creates a copy of the MonitorUpdateError
11871 struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
11874 * Frees any resources used by the MonitorEvent
11876 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
11879 * Creates a copy of the MonitorEvent
11881 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
11884 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
11886 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
11889 * Creates a copy of the HTLCUpdate
11891 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
11894 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
11896 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
11899 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
11901 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
11904 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
11906 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
11909 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
11911 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
11914 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
11917 * panics if the given update is not the next update by update_id.
11919 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);
11922 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
11925 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
11928 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
11930 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
11933 * Gets a list of txids, with their output scripts (in the order they appear in the
11934 * transaction), which we must learn about spends of via block_connected().
11936 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
11939 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
11940 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
11941 * have been registered.
11943 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
11946 * Get the list of HTLCs who's status has been updated on chain. This should be called by
11947 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
11949 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
11952 * Gets the list of pending events which were generated by previous actions, clearing the list
11955 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
11956 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
11957 * no internal locking in ChannelMonitors.
11959 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
11962 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
11963 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
11964 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
11965 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
11966 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
11967 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
11968 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
11969 * out-of-band the other node operator to coordinate with him if option is available to you.
11970 * In any-case, choice is up to the user.
11972 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);
11975 * Processes transactions in a newly connected block, which may result in any of the following:
11976 * - update the monitor's state against resolved HTLCs
11977 * - punish the counterparty in the case of seeing a revoked commitment transaction
11978 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
11979 * - detect settled outputs for later spending
11980 * - schedule and bump any in-flight claims
11982 * Returns any new outputs to watch from `txdata`; after called, these are also included in
11983 * [`get_outputs_to_watch`].
11985 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
11987 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);
11990 * Determines if the disconnected block contained any transactions of interest and updates
11993 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);
11996 * Processes transactions confirmed in a block with the given header and height, returning new
11997 * outputs to watch. See [`block_connected`] for details.
11999 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
12000 * blocks. See [`chain::Confirm`] for calling expectations.
12002 * [`block_connected`]: Self::block_connected
12004 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);
12007 * Processes a transaction that was reorganized out of the chain.
12009 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
12010 * than blocks. See [`chain::Confirm`] for calling expectations.
12012 * [`block_disconnected`]: Self::block_disconnected
12014 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);
12017 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
12018 * [`block_connected`] for details.
12020 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
12021 * blocks. See [`chain::Confirm`] for calling expectations.
12023 * [`block_connected`]: Self::block_connected
12025 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);
12028 * Returns the set of txids that should be monitored for re-organization out of the chain.
12030 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
12033 * Calls the free function if one is set
12035 void Persist_free(struct LDKPersist this_ptr);
12038 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
12040 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
12043 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
12045 void OutPoint_free(struct LDKOutPoint this_obj);
12048 * The referenced transaction's txid.
12050 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
12053 * The referenced transaction's txid.
12055 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12058 * The index of the referenced output in its transaction's vout.
12060 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
12063 * The index of the referenced output in its transaction's vout.
12065 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
12068 * Constructs a new OutPoint given each field
12070 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
12073 * Creates a copy of the OutPoint
12075 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
12078 * Convert an `OutPoint` to a lightning channel id.
12080 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
12083 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
12085 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
12088 * Read a OutPoint from a byte array, created by OutPoint_write
12090 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
12093 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
12095 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
12098 * The outpoint which is spendable
12100 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12103 * The outpoint which is spendable
12105 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
12108 * Per commitment point to derive delayed_payment_key by key holder
12110 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12113 * Per commitment point to derive delayed_payment_key by key holder
12115 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12118 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
12119 * the witness_script.
12121 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12124 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
12125 * the witness_script.
12127 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
12130 * The output which is referenced by the given outpoint
12132 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
12135 * The revocation point specific to the commitment transaction which was broadcast. Used to
12136 * derive the witnessScript for this output.
12138 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12141 * The revocation point specific to the commitment transaction which was broadcast. Used to
12142 * derive the witnessScript for this output.
12144 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12147 * Arbitrary identification information returned by a call to
12148 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12149 * the channel to spend the output.
12151 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
12154 * Arbitrary identification information returned by a call to
12155 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12156 * the channel to spend the output.
12158 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12161 * The value of the channel which this output originated from, possibly indirectly.
12163 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12166 * The value of the channel which this output originated from, possibly indirectly.
12168 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
12171 * Constructs a new DelayedPaymentOutputDescriptor given each field
12173 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);
12176 * Creates a copy of the DelayedPaymentOutputDescriptor
12178 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
12181 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
12183 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
12186 * The outpoint which is spendable
12188 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12191 * The outpoint which is spendable
12193 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
12196 * The output which is referenced by the given outpoint
12198 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
12201 * Arbitrary identification information returned by a call to
12202 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12203 * the channel to spend the output.
12205 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
12208 * Arbitrary identification information returned by a call to
12209 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12210 * the channel to spend the output.
12212 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12215 * The value of the channel which this transactions spends.
12217 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12220 * The value of the channel which this transactions spends.
12222 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
12225 * Constructs a new StaticPaymentOutputDescriptor given each field
12227 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);
12230 * Creates a copy of the StaticPaymentOutputDescriptor
12232 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
12235 * Frees any resources used by the SpendableOutputDescriptor
12237 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
12240 * Creates a copy of the SpendableOutputDescriptor
12242 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
12245 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
12247 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
12250 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
12252 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
12255 * Calls the free function if one is set
12257 void BaseSign_free(struct LDKBaseSign this_ptr);
12260 * Creates a copy of a Sign
12262 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
12265 * Calls the free function if one is set
12267 void Sign_free(struct LDKSign this_ptr);
12270 * Calls the free function if one is set
12272 void KeysInterface_free(struct LDKKeysInterface this_ptr);
12275 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
12277 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
12280 * Private key of anchor tx
12282 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12285 * Private key of anchor tx
12287 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12290 * Holder secret key for blinded revocation pubkey
12292 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12295 * Holder secret key for blinded revocation pubkey
12297 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12300 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
12302 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12305 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
12307 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12310 * Holder secret key used in HTLC tx
12312 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12315 * Holder secret key used in HTLC tx
12317 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12320 * Holder htlc secret key used in commitment tx htlc outputs
12322 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12325 * Holder htlc secret key used in commitment tx htlc outputs
12327 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12332 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12337 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12340 * Creates a copy of the InMemorySigner
12342 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
12345 * Create a new InMemorySigner
12347 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);
12350 * Counterparty pubkeys.
12351 * Will panic if ready_channel wasn't called.
12353 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12356 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
12357 * transactions, ie the amount of time that we have to wait to recover our funds if we
12358 * broadcast a transaction.
12359 * Will panic if ready_channel wasn't called.
12361 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12364 * The contest_delay value specified by us and applied on transactions broadcastable
12365 * by our counterparty, ie the amount of time that they have to wait to recover their funds
12366 * if they broadcast a transaction.
12367 * Will panic if ready_channel wasn't called.
12369 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12372 * Whether the holder is the initiator
12373 * Will panic if ready_channel wasn't called.
12375 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12379 * Will panic if ready_channel wasn't called.
12381 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12384 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
12385 * building transactions.
12387 * Will panic if ready_channel wasn't called.
12389 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12392 * Sign the single input of spend_tx at index `input_idx` which spends the output
12393 * described by descriptor, returning the witness stack for the input.
12395 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
12396 * or is not spending the outpoint described by `descriptor.outpoint`.
12398 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);
12401 * Sign the single input of spend_tx at index `input_idx` which spends the output
12402 * described by descriptor, returning the witness stack for the input.
12404 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
12405 * is not spending the outpoint described by `descriptor.outpoint`, or does not have a
12406 * sequence set to `descriptor.to_self_delay`.
12408 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);
12411 * Constructs a new BaseSign which calls the relevant methods on this_arg.
12412 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
12414 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12417 * Constructs a new Sign which calls the relevant methods on this_arg.
12418 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
12420 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12423 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
12425 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
12428 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
12430 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
12433 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
12435 void KeysManager_free(struct LDKKeysManager this_obj);
12438 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
12439 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
12440 * starting_time isn't strictly required to actually be a time, but it must absolutely,
12441 * without a doubt, be unique to this instance. ie if you start multiple times with the same
12442 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
12443 * simply use the current time (with very high precision).
12445 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
12446 * obviously, starting_time should be unique every time you reload the library - it is only
12447 * used to generate new ephemeral key data (which will be stored by the individual channel if
12450 * Note that the seed is required to recover certain on-chain funds independent of
12451 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
12452 * channel, and some on-chain during-closing funds.
12454 * Note that until the 0.1 release there is no guarantee of backward compatibility between
12455 * versions. Once the library is more fully supported, the docs will be updated to include a
12456 * detailed description of the guarantee.
12458 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
12461 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
12463 * Key derivation parameters are accessible through a per-channel secrets
12464 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
12465 * onchain output detection for which a corresponding delayed_payment_key must be derived.
12467 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]);
12470 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
12471 * output to the given change destination (if sufficient change value remains). The
12472 * transaction will have a feerate, at least, of the given value.
12474 * Returns `Err(())` if the output value is greater than the input value minus required fee or
12475 * if a descriptor was duplicated.
12477 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
12479 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
12480 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
12482 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);
12485 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
12486 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
12488 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
12491 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
12493 void ChannelManager_free(struct LDKChannelManager this_obj);
12496 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
12498 void ChainParameters_free(struct LDKChainParameters this_obj);
12501 * The network for determining the `chain_hash` in Lightning messages.
12503 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
12506 * The network for determining the `chain_hash` in Lightning messages.
12508 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
12511 * The hash and height of the latest block successfully connected.
12513 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
12515 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
12518 * The hash and height of the latest block successfully connected.
12520 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
12522 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
12525 * Constructs a new ChainParameters given each field
12527 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
12530 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
12532 void BestBlock_free(struct LDKBestBlock this_obj);
12535 * Creates a copy of the BestBlock
12537 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
12540 * Returns the best block from the genesis of the given network.
12542 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
12545 * Returns the best block as identified by the given block hash and height.
12547 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
12550 * Returns the best block hash.
12552 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
12555 * Returns the best block height.
12557 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
12560 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
12562 void ChannelDetails_free(struct LDKChannelDetails this_obj);
12565 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
12566 * thereafter this is the txid of the funding transaction xor the funding transaction output).
12567 * Note that this means this value is *not* persistent - it can change once during the
12568 * lifetime of the channel.
12570 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
12573 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
12574 * thereafter this is the txid of the funding transaction xor the funding transaction output).
12575 * Note that this means this value is *not* persistent - it can change once during the
12576 * lifetime of the channel.
12578 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12581 * The position of the funding transaction in the chain. None if the funding transaction has
12582 * not yet been confirmed and the channel fully opened.
12584 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12587 * The position of the funding transaction in the chain. None if the funding transaction has
12588 * not yet been confirmed and the channel fully opened.
12590 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
12593 * The node_id of our counterparty
12595 struct LDKPublicKey ChannelDetails_get_remote_network_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12598 * The node_id of our counterparty
12600 void ChannelDetails_set_remote_network_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12603 * The Features the channel counterparty provided upon last connection.
12604 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
12605 * many routing-relevant features are present in the init context.
12607 struct LDKInitFeatures ChannelDetails_get_counterparty_features(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12610 * The Features the channel counterparty provided upon last connection.
12611 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
12612 * many routing-relevant features are present in the init context.
12614 void ChannelDetails_set_counterparty_features(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
12617 * The value, in satoshis, of this channel as appears in the funding output
12619 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12622 * The value, in satoshis, of this channel as appears in the funding output
12624 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
12627 * The user_id passed in to create_channel, or 0 if the channel was inbound.
12629 uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12632 * The user_id passed in to create_channel, or 0 if the channel was inbound.
12634 void ChannelDetails_set_user_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
12637 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
12638 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
12639 * available for inclusion in new outbound HTLCs). This further does not include any pending
12640 * outgoing HTLCs which are awaiting some other resolution to be sent.
12642 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12645 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
12646 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
12647 * available for inclusion in new outbound HTLCs). This further does not include any pending
12648 * outgoing HTLCs which are awaiting some other resolution to be sent.
12650 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
12653 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
12654 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
12655 * available for inclusion in new inbound HTLCs).
12656 * Note that there are some corner cases not fully handled here, so the actual available
12657 * inbound capacity may be slightly higher than this.
12659 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12662 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
12663 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
12664 * available for inclusion in new inbound HTLCs).
12665 * Note that there are some corner cases not fully handled here, so the actual available
12666 * inbound capacity may be slightly higher than this.
12668 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
12671 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
12672 * the peer is connected, and (c) no monitor update failure is pending resolution.
12674 bool ChannelDetails_get_is_live(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12677 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
12678 * the peer is connected, and (c) no monitor update failure is pending resolution.
12680 void ChannelDetails_set_is_live(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
12683 * Creates a copy of the ChannelDetails
12685 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
12688 * Frees any resources used by the PaymentSendFailure
12690 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
12693 * Creates a copy of the PaymentSendFailure
12695 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
12698 * Constructs a new ChannelManager to hold several channels and route between them.
12700 * This is the main \"logic hub\" for all channel-related actions, and implements
12701 * ChannelMessageHandler.
12703 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
12705 * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
12707 * Users need to notify the new ChannelManager when a new block is connected or
12708 * disconnected using its `block_connected` and `block_disconnected` methods, starting
12709 * from after `params.latest_hash`.
12711 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);
12714 * Gets the current configuration applied to all new channels, as
12716 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
12719 * Creates a new outbound channel to the given remote node and with the given value.
12721 * user_id will be provided back as user_channel_id in FundingGenerationReady events to allow
12722 * tracking of which events correspond with which create_channel call. Note that the
12723 * user_channel_id defaults to 0 for inbound channels, so you may wish to avoid using 0 for
12724 * user_id here. user_id has no meaning inside of LDK, it is simply copied to events and
12725 * otherwise ignored.
12727 * If successful, will generate a SendOpenChannel message event, so you should probably poll
12728 * PeerManager::process_events afterwards.
12730 * Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
12731 * greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
12733 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);
12736 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
12737 * more information.
12739 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
12742 * Gets the list of usable channels, in random order. Useful as an argument to
12743 * get_route to ensure non-announced channels are used.
12745 * These are guaranteed to have their is_live value set to true, see the documentation for
12746 * ChannelDetails::is_live for more info on exactly what the criteria are.
12748 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
12751 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
12752 * will be accepted on the given channel, and after additional timeout/the closing of all
12753 * pending HTLCs, the channel will be closed on chain.
12755 * May generate a SendShutdown message event on success, which should be relayed.
12757 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
12760 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
12761 * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
12763 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
12766 * Force close all channels, immediately broadcasting the latest local commitment transaction
12767 * for each to the chain and rejecting new HTLCs on each.
12769 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
12772 * Sends a payment along a given route.
12774 * Value parameters are provided via the last hop in route, see documentation for RouteHop
12775 * fields for more info.
12777 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
12778 * payment), we don't do anything to stop you! We always try to ensure that if the provided
12779 * next hop knows the preimage to payment_hash they can claim an additional amount as
12780 * specified in the last hop in the route! Thus, you should probably do your own
12781 * payment_preimage tracking (which you should already be doing as they represent \"proof of
12782 * payment\") and prevent double-sends yourself.
12784 * May generate SendHTLCs message(s) event on success, which should be relayed.
12786 * Each path may have a different return value, and PaymentSendValue may return a Vec with
12787 * each entry matching the corresponding-index entry in the route paths, see
12788 * PaymentSendFailure for more info.
12790 * In general, a path may raise:
12791 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
12792 * node public key) is specified.
12793 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
12794 * (including due to previous monitor update failure or new permanent monitor update
12796 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
12797 * relevant updates.
12799 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
12800 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
12801 * different route unless you intend to pay twice!
12803 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
12804 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
12805 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
12806 * must not contain multiple paths as multi-path payments require a recipient-provided
12808 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
12809 * bit set (either as required or as available). If multiple paths are present in the Route,
12810 * we assume the invoice had the basic_mpp feature set.
12812 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);
12815 * Call this upon creation of a funding transaction for the given channel.
12817 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
12818 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
12820 * Panics if a funding transaction has already been provided for this channel.
12822 * May panic if the output found in the funding transaction is duplicative with some other
12823 * channel (note that this should be trivially prevented by using unique funding transaction
12824 * keys per-channel).
12826 * Do NOT broadcast the funding transaction yourself. When we have safely received our
12827 * counterparty's signature the funding transaction will automatically be broadcast via the
12828 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
12830 * Note that this includes RBF or similar transaction replacement strategies - lightning does
12831 * not currently support replacing a funding transaction on an existing channel. Instead,
12832 * create a new channel with a conflicting funding transaction.
12834 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);
12837 * Generates a signed node_announcement from the given arguments and creates a
12838 * BroadcastNodeAnnouncement event. Note that such messages will be ignored unless peers have
12839 * seen a channel_announcement from us (ie unless we have public channels open).
12841 * RGB is a node \"color\" and alias is a printable human-readable string to describe this node
12842 * to humans. They carry no in-protocol meaning.
12844 * addresses represent the set (possibly empty) of socket addresses on which this node accepts
12845 * incoming connections. These will be broadcast to the network, publicly tying these
12846 * addresses together. If you wish to preserve user privacy, addresses should likely contain
12847 * only Tor Onion addresses.
12849 * Panics if addresses is absurdly large (more than 500).
12851 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
12854 * Processes HTLCs which are pending waiting on random forward delay.
12856 * Should only really ever be called in response to a PendingHTLCsForwardable event.
12857 * Will likely generate further events.
12859 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
12862 * If a peer is disconnected we mark any channels with that peer as 'disabled'.
12863 * After some time, if channels are still disabled we need to broadcast a ChannelUpdate
12864 * to inform the network about the uselessness of these channels.
12866 * This method handles all the details, and must be called roughly once per minute.
12868 * Note that in some rare cases this may generate a `chain::Watch::update_channel` call.
12870 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
12873 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
12874 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
12875 * along the path (including in our own channel on which we received it).
12876 * Returns false if no payment was found to fail backwards, true if the process of failing the
12877 * HTLC backwards has been started.
12879 MUST_USE_RES bool ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
12882 * Provides a payment preimage in response to a PaymentReceived event, returning true and
12883 * generating message events for the net layer to claim the payment, if possible. Thus, you
12884 * should probably kick the net layer to go send messages if this returns true!
12886 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
12887 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
12888 * event matches your expectation. If you fail to do so and call this method, you may provide
12889 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
12891 * May panic if called except in response to a PaymentReceived event.
12893 * [`create_inbound_payment`]: Self::create_inbound_payment
12894 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
12896 MUST_USE_RES bool ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
12899 * Gets the node_id held by this ChannelManager
12901 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
12904 * Restores a single, given channel to normal operation after a
12905 * ChannelMonitorUpdateErr::TemporaryFailure was returned from a channel monitor update
12908 * All ChannelMonitor updates up to and including highest_applied_update_id must have been
12909 * fully committed in every copy of the given channels' ChannelMonitors.
12911 * Note that there is no effect to calling with a highest_applied_update_id other than the
12912 * current latest ChannelMonitorUpdate and one call to this function after multiple
12913 * ChannelMonitorUpdateErr::TemporaryFailures is fine. The highest_applied_update_id field
12914 * exists largely only to prevent races between this and concurrent update_monitor calls.
12916 * Thus, the anticipated use is, at a high level:
12917 * 1) You register a chain::Watch with this ChannelManager,
12918 * 2) it stores each update to disk, and begins updating any remote (eg watchtower) copies of
12919 * said ChannelMonitors as it can, returning ChannelMonitorUpdateErr::TemporaryFailures
12920 * any time it cannot do so instantly,
12921 * 3) update(s) are applied to each remote copy of a ChannelMonitor,
12922 * 4) once all remote copies are updated, you call this function with the update_id that
12923 * completed, and once it is the latest the Channel will be re-enabled.
12925 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);
12928 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
12931 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
12932 * [`PaymentHash`] and [`PaymentPreimage`] for you, returning the first and storing the second.
12934 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
12935 * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
12936 * passed directly to [`claim_funds`].
12938 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
12940 * [`claim_funds`]: Self::claim_funds
12941 * [`PaymentReceived`]: events::Event::PaymentReceived
12942 * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
12943 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
12945 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);
12948 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
12949 * stored external to LDK.
12951 * A [`PaymentReceived`] event will only be generated if the [`PaymentSecret`] matches a
12952 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
12953 * the `min_value_msat` provided here, if one is provided.
12955 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) must be globally unique. This
12956 * method may return an Err if another payment with the same payment_hash is still pending.
12958 * `user_payment_id` will be provided back in [`PaymentReceived::user_payment_id`] events to
12959 * allow tracking of which events correspond with which calls to this and
12960 * [`create_inbound_payment`]. `user_payment_id` has no meaning inside of LDK, it is simply
12961 * copied to events and otherwise ignored. It may be used to correlate PaymentReceived events
12962 * with invoice metadata stored elsewhere.
12964 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
12965 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
12966 * before a [`PaymentReceived`] event will be generated, ensuring that we do not provide the
12967 * sender \"proof-of-payment\" unless they have paid the required amount.
12969 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
12970 * in excess of the current time. This should roughly match the expiry time set in the invoice.
12971 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
12972 * pay the invoice failing. The BOLT spec suggests 7,200 secs as a default validity time for
12973 * invoices when no timeout is set.
12975 * Note that we use block header time to time-out pending inbound payments (with some margin
12976 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
12977 * accept a payment and generate a [`PaymentReceived`] event for some time after the expiry.
12978 * If you need exact expiry semantics, you should enforce them upon receipt of
12979 * [`PaymentReceived`].
12981 * Pending inbound payments are stored in memory and in serialized versions of this
12982 * [`ChannelManager`]. If potentially unbounded numbers of inbound payments may exist and
12983 * space is limited, you may wish to rate-limit inbound payment creation.
12985 * May panic if `invoice_expiry_delta_secs` is greater than one year.
12987 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
12988 * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
12990 * [`create_inbound_payment`]: Self::create_inbound_payment
12991 * [`PaymentReceived`]: events::Event::PaymentReceived
12992 * [`PaymentReceived::user_payment_id`]: events::Event::PaymentReceived::user_payment_id
12994 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);
12997 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
12998 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
13000 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
13003 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
13004 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
13006 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
13009 * Constructs a new Listen which calls the relevant methods on this_arg.
13010 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
13012 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
13015 * Constructs a new Confirm which calls the relevant methods on this_arg.
13016 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
13018 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
13021 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
13022 * indicating whether persistence is necessary. Only one listener on
13023 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
13025 * Note that the feature `allow_wallclock_use` must be enabled to use this function.
13027 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
13030 * Blocks until ChannelManager needs to be persisted. Only one listener on
13031 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
13034 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
13037 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
13038 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
13040 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
13043 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
13045 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
13048 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
13050 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
13053 * The keys provider which will give us relevant keys. Some keys will be loaded during
13054 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
13057 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13060 * The keys provider which will give us relevant keys. Some keys will be loaded during
13061 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
13064 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
13067 * The fee_estimator for use in the ChannelManager in the future.
13069 * No calls to the FeeEstimator will be made during deserialization.
13071 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13074 * The fee_estimator for use in the ChannelManager in the future.
13076 * No calls to the FeeEstimator will be made during deserialization.
13078 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
13081 * The chain::Watch for use in the ChannelManager in the future.
13083 * No calls to the chain::Watch will be made during deserialization. It is assumed that
13084 * you have deserialized ChannelMonitors separately and will add them to your
13085 * chain::Watch after deserializing this ChannelManager.
13087 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13090 * The chain::Watch for use in the ChannelManager in the future.
13092 * No calls to the chain::Watch will be made during deserialization. It is assumed that
13093 * you have deserialized ChannelMonitors separately and will add them to your
13094 * chain::Watch after deserializing this ChannelManager.
13096 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
13099 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
13100 * used to broadcast the latest local commitment transactions of channels which must be
13101 * force-closed during deserialization.
13103 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13106 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
13107 * used to broadcast the latest local commitment transactions of channels which must be
13108 * force-closed during deserialization.
13110 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
13113 * The Logger for use in the ChannelManager and which may be used to log information during
13116 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13119 * The Logger for use in the ChannelManager and which may be used to log information during
13122 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
13125 * Default settings used for new channels. Any existing channels will continue to use the
13126 * runtime settings which were stored when the ChannelManager was serialized.
13128 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
13131 * Default settings used for new channels. Any existing channels will continue to use the
13132 * runtime settings which were stored when the ChannelManager was serialized.
13134 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
13137 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
13138 * HashMap for you. This is primarily useful for C bindings where it is not practical to
13139 * populate a HashMap directly from C.
13141 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);
13144 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
13146 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
13149 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
13151 void DecodeError_free(struct LDKDecodeError this_obj);
13154 * Creates a copy of the DecodeError
13156 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
13159 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
13161 void Init_free(struct LDKInit this_obj);
13164 * The relevant features which the sender supports
13166 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
13169 * The relevant features which the sender supports
13171 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
13174 * Constructs a new Init given each field
13176 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
13179 * Creates a copy of the Init
13181 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
13184 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
13186 void ErrorMessage_free(struct LDKErrorMessage this_obj);
13189 * The channel ID involved in the error
13191 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
13194 * The channel ID involved in the error
13196 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13199 * A possibly human-readable error description.
13200 * The string should be sanitized before it is used (e.g. emitted to logs
13201 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
13202 * vulnerability in the terminal emulator or the logging subsystem.
13204 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
13207 * A possibly human-readable error description.
13208 * The string should be sanitized before it is used (e.g. emitted to logs
13209 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
13210 * vulnerability in the terminal emulator or the logging subsystem.
13212 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
13215 * Constructs a new ErrorMessage given each field
13217 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
13220 * Creates a copy of the ErrorMessage
13222 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
13225 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
13227 void Ping_free(struct LDKPing this_obj);
13230 * The desired response length
13232 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
13235 * The desired response length
13237 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
13240 * The ping packet size.
13241 * This field is not sent on the wire. byteslen zeros are sent.
13243 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
13246 * The ping packet size.
13247 * This field is not sent on the wire. byteslen zeros are sent.
13249 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
13252 * Constructs a new Ping given each field
13254 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
13257 * Creates a copy of the Ping
13259 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
13262 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
13264 void Pong_free(struct LDKPong this_obj);
13267 * The pong packet size.
13268 * This field is not sent on the wire. byteslen zeros are sent.
13270 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
13273 * The pong packet size.
13274 * This field is not sent on the wire. byteslen zeros are sent.
13276 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
13279 * Constructs a new Pong given each field
13281 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
13284 * Creates a copy of the Pong
13286 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
13289 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
13291 void OpenChannel_free(struct LDKOpenChannel this_obj);
13294 * The genesis hash of the blockchain where the channel is to be opened
13296 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
13299 * The genesis hash of the blockchain where the channel is to be opened
13301 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13304 * A temporary channel ID, until the funding outpoint is announced
13306 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
13309 * A temporary channel ID, until the funding outpoint is announced
13311 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13314 * The channel value
13316 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13319 * The channel value
13321 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13324 * The amount to push to the counterparty as part of the open, in milli-satoshi
13326 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13329 * The amount to push to the counterparty as part of the open, in milli-satoshi
13331 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13334 * The threshold below which outputs on transactions broadcast by sender will be omitted
13336 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13339 * The threshold below which outputs on transactions broadcast by sender will be omitted
13341 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13344 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
13346 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13349 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
13351 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13354 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
13356 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13359 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
13361 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13364 * The minimum HTLC size incoming to sender, in milli-satoshi
13366 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13369 * The minimum HTLC size incoming to sender, in milli-satoshi
13371 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13374 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
13376 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13379 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
13381 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
13384 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
13386 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13389 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
13391 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
13394 * The maximum number of inbound HTLCs towards sender
13396 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13399 * The maximum number of inbound HTLCs towards sender
13401 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
13404 * The sender's key controlling the funding transaction
13406 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13409 * The sender's key controlling the funding transaction
13411 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13414 * Used to derive a revocation key for transactions broadcast by counterparty
13416 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13419 * Used to derive a revocation key for transactions broadcast by counterparty
13421 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13424 * A payment key to sender for transactions broadcast by counterparty
13426 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13429 * A payment key to sender for transactions broadcast by counterparty
13431 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13434 * Used to derive a payment key to sender for transactions broadcast by sender
13436 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13439 * Used to derive a payment key to sender for transactions broadcast by sender
13441 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13444 * Used to derive an HTLC payment key to sender
13446 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13449 * Used to derive an HTLC payment key to sender
13451 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13454 * The first to-be-broadcast-by-sender transaction's per commitment point
13456 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13459 * The first to-be-broadcast-by-sender transaction's per commitment point
13461 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13466 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13471 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
13474 * Creates a copy of the OpenChannel
13476 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
13479 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
13481 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
13484 * A temporary channel ID, until the funding outpoint is announced
13486 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
13489 * A temporary channel ID, until the funding outpoint is announced
13491 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13494 * The threshold below which outputs on transactions broadcast by sender will be omitted
13496 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13499 * The threshold below which outputs on transactions broadcast by sender will be omitted
13501 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
13504 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
13506 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13509 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
13511 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
13514 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
13516 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13519 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
13521 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
13524 * The minimum HTLC size incoming to sender, in milli-satoshi
13526 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13529 * The minimum HTLC size incoming to sender, in milli-satoshi
13531 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
13534 * Minimum depth of the funding transaction before the channel is considered open
13536 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13539 * Minimum depth of the funding transaction before the channel is considered open
13541 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
13544 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
13546 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13549 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
13551 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
13554 * The maximum number of inbound HTLCs towards sender
13556 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13559 * The maximum number of inbound HTLCs towards sender
13561 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
13564 * The sender's key controlling the funding transaction
13566 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13569 * The sender's key controlling the funding transaction
13571 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13574 * Used to derive a revocation key for transactions broadcast by counterparty
13576 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13579 * Used to derive a revocation key for transactions broadcast by counterparty
13581 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13584 * A payment key to sender for transactions broadcast by counterparty
13586 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13589 * A payment key to sender for transactions broadcast by counterparty
13591 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13594 * Used to derive a payment key to sender for transactions broadcast by sender
13596 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13599 * Used to derive a payment key to sender for transactions broadcast by sender
13601 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13604 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
13606 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13609 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
13611 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13614 * The first to-be-broadcast-by-sender transaction's per commitment point
13616 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13619 * The first to-be-broadcast-by-sender transaction's per commitment point
13621 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13624 * Creates a copy of the AcceptChannel
13626 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
13629 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
13631 void FundingCreated_free(struct LDKFundingCreated this_obj);
13634 * A temporary channel ID, until the funding is established
13636 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
13639 * A temporary channel ID, until the funding is established
13641 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13644 * The funding transaction ID
13646 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
13649 * The funding transaction ID
13651 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13654 * The specific output index funding this channel
13656 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
13659 * The specific output index funding this channel
13661 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
13664 * The signature of the channel initiator (funder) on the funding transaction
13666 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
13669 * The signature of the channel initiator (funder) on the funding transaction
13671 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
13674 * Constructs a new FundingCreated given each field
13676 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);
13679 * Creates a copy of the FundingCreated
13681 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
13684 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
13686 void FundingSigned_free(struct LDKFundingSigned this_obj);
13691 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
13696 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13699 * The signature of the channel acceptor (fundee) on the funding transaction
13701 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
13704 * The signature of the channel acceptor (fundee) on the funding transaction
13706 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
13709 * Constructs a new FundingSigned given each field
13711 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
13714 * Creates a copy of the FundingSigned
13716 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
13719 * Frees any resources used by the FundingLocked, if is_owned is set and inner is non-NULL.
13721 void FundingLocked_free(struct LDKFundingLocked this_obj);
13726 const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32];
13731 void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13734 * The per-commitment point of the second commitment transaction
13736 struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr);
13739 * The per-commitment point of the second commitment transaction
13741 void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13744 * Constructs a new FundingLocked given each field
13746 MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
13749 * Creates a copy of the FundingLocked
13751 struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
13754 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
13756 void Shutdown_free(struct LDKShutdown this_obj);
13761 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
13766 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13769 * The destination of this peer's funds on closing.
13770 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
13772 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
13775 * The destination of this peer's funds on closing.
13776 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
13778 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
13781 * Constructs a new Shutdown given each field
13783 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
13786 * Creates a copy of the Shutdown
13788 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
13791 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
13793 void ClosingSigned_free(struct LDKClosingSigned this_obj);
13798 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
13803 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13806 * The proposed total fee for the closing transaction
13808 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
13811 * The proposed total fee for the closing transaction
13813 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
13816 * A signature on the closing transaction
13818 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
13821 * A signature on the closing transaction
13823 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
13826 * Constructs a new ClosingSigned given each field
13828 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg);
13831 * Creates a copy of the ClosingSigned
13833 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
13836 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
13838 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
13843 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
13848 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13853 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
13858 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
13861 * The HTLC value in milli-satoshi
13863 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
13866 * The HTLC value in milli-satoshi
13868 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
13871 * The payment hash, the pre-image of which controls HTLC redemption
13873 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
13876 * The payment hash, the pre-image of which controls HTLC redemption
13878 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13881 * The expiry height of the HTLC
13883 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
13886 * The expiry height of the HTLC
13888 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
13891 * Creates a copy of the UpdateAddHTLC
13893 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
13896 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
13898 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
13903 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
13908 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13913 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
13918 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
13921 * The pre-image of the payment hash, allowing HTLC redemption
13923 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
13926 * The pre-image of the payment hash, allowing HTLC redemption
13928 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13931 * Constructs a new UpdateFulfillHTLC given each field
13933 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
13936 * Creates a copy of the UpdateFulfillHTLC
13938 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
13941 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
13943 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
13948 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
13953 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13958 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
13963 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
13966 * Creates a copy of the UpdateFailHTLC
13968 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
13971 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
13973 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
13978 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
13983 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13988 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
13993 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
13998 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
14003 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
14006 * Creates a copy of the UpdateFailMalformedHTLC
14008 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
14011 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
14013 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
14018 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
14023 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14026 * A signature on the commitment transaction
14028 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
14031 * A signature on the commitment transaction
14033 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
14036 * Signatures on the HTLC transactions
14038 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
14041 * Constructs a new CommitmentSigned given each field
14043 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
14046 * Creates a copy of the CommitmentSigned
14048 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
14051 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
14053 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
14058 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
14063 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14066 * The secret corresponding to the per-commitment point
14068 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
14071 * The secret corresponding to the per-commitment point
14073 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14076 * The next sender-broadcast commitment transaction's per-commitment point
14078 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
14081 * The next sender-broadcast commitment transaction's per-commitment point
14083 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14086 * Constructs a new RevokeAndACK given each field
14088 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);
14091 * Creates a copy of the RevokeAndACK
14093 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
14096 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
14098 void UpdateFee_free(struct LDKUpdateFee this_obj);
14103 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
14108 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14111 * Fee rate per 1000-weight of the transaction
14113 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
14116 * Fee rate per 1000-weight of the transaction
14118 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
14121 * Constructs a new UpdateFee given each field
14123 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
14126 * Creates a copy of the UpdateFee
14128 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
14131 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
14133 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
14136 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
14137 * belonging to the recipient
14139 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
14142 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
14143 * belonging to the recipient
14145 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14148 * The sender's per-commitment point for their current commitment transaction
14150 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
14153 * The sender's per-commitment point for their current commitment transaction
14155 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14158 * Constructs a new DataLossProtect given each field
14160 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
14163 * Creates a copy of the DataLossProtect
14165 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
14168 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
14170 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
14175 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
14180 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14183 * The next commitment number for the sender
14185 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
14188 * The next commitment number for the sender
14190 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
14193 * The next commitment number for the recipient
14195 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
14198 * The next commitment number for the recipient
14200 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
14203 * Creates a copy of the ChannelReestablish
14205 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
14208 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
14210 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
14215 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
14220 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14223 * The short channel ID
14225 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
14228 * The short channel ID
14230 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
14233 * A signature by the node key
14235 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
14238 * A signature by the node key
14240 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
14243 * A signature by the funding key
14245 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
14248 * A signature by the funding key
14250 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
14253 * Constructs a new AnnouncementSignatures given each field
14255 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);
14258 * Creates a copy of the AnnouncementSignatures
14260 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
14263 * Frees any resources used by the NetAddress
14265 void NetAddress_free(struct LDKNetAddress this_ptr);
14268 * Creates a copy of the NetAddress
14270 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
14273 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
14275 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
14278 * Read a Result from a byte array, created by Result_write
14280 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
14283 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
14285 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
14288 * The advertised features
14290 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
14293 * The advertised features
14295 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
14298 * A strictly monotonic announcement counter, with gaps allowed
14300 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
14303 * A strictly monotonic announcement counter, with gaps allowed
14305 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
14308 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
14311 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
14314 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
14317 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14320 * An RGB color for UI purposes
14322 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
14325 * An RGB color for UI purposes
14327 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
14330 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
14333 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
14336 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
14339 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14342 * List of addresses on which this node is reachable
14344 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
14347 * Creates a copy of the UnsignedNodeAnnouncement
14349 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
14352 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
14354 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
14357 * The signature by the node key
14359 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
14362 * The signature by the node key
14364 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14367 * The actual content of the announcement
14369 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
14372 * The actual content of the announcement
14374 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
14377 * Constructs a new NodeAnnouncement given each field
14379 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
14382 * Creates a copy of the NodeAnnouncement
14384 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
14387 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
14389 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
14392 * The advertised channel features
14394 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14397 * The advertised channel features
14399 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
14402 * The genesis hash of the blockchain where the channel is to be opened
14404 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
14407 * The genesis hash of the blockchain where the channel is to be opened
14409 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14412 * The short channel ID
14414 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14417 * The short channel ID
14419 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
14422 * One of the two node_ids which are endpoints of this channel
14424 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14427 * One of the two node_ids which are endpoints of this channel
14429 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14432 * The other of the two node_ids which are endpoints of this channel
14434 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14437 * The other of the two node_ids which are endpoints of this channel
14439 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14442 * The funding key for the first node
14444 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14447 * The funding key for the first node
14449 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14452 * The funding key for the second node
14454 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14457 * The funding key for the second node
14459 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14462 * Creates a copy of the UnsignedChannelAnnouncement
14464 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
14467 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
14469 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
14472 * Authentication of the announcement by the first public node
14474 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
14477 * Authentication of the announcement by the first public node
14479 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14482 * Authentication of the announcement by the second public node
14484 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
14487 * Authentication of the announcement by the second public node
14489 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14492 * Proof of funding UTXO ownership by the first public node
14494 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
14497 * Proof of funding UTXO ownership by the first public node
14499 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14502 * Proof of funding UTXO ownership by the second public node
14504 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
14507 * Proof of funding UTXO ownership by the second public node
14509 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14512 * The actual announcement
14514 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
14517 * The actual announcement
14519 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
14522 * Constructs a new ChannelAnnouncement given each field
14524 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);
14527 * Creates a copy of the ChannelAnnouncement
14529 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
14532 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
14534 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
14537 * The genesis hash of the blockchain where the channel is to be opened
14539 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
14542 * The genesis hash of the blockchain where the channel is to be opened
14544 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14547 * The short channel ID
14549 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14552 * The short channel ID
14554 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
14557 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
14559 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14562 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
14564 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
14569 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14574 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
14577 * The number of blocks such that if:
14578 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
14579 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
14580 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
14581 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
14582 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
14583 * forwarding. Note that the HTLC sender is the one who originally sets this value when
14584 * constructing the route.
14586 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14589 * The number of blocks such that if:
14590 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
14591 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
14592 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
14593 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
14594 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
14595 * forwarding. Note that the HTLC sender is the one who originally sets this value when
14596 * constructing the route.
14598 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
14601 * The minimum HTLC size incoming to sender, in milli-satoshi
14603 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14606 * The minimum HTLC size incoming to sender, in milli-satoshi
14608 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
14611 * The base HTLC fee charged by sender, in milli-satoshi
14613 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14616 * The base HTLC fee charged by sender, in milli-satoshi
14618 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
14621 * The amount to fee multiplier, in micro-satoshi
14623 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14626 * The amount to fee multiplier, in micro-satoshi
14628 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
14631 * Creates a copy of the UnsignedChannelUpdate
14633 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
14636 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
14638 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
14641 * A signature of the channel update
14643 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
14646 * A signature of the channel update
14648 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
14651 * The actual channel update
14653 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
14656 * The actual channel update
14658 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
14661 * Constructs a new ChannelUpdate given each field
14663 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
14666 * Creates a copy of the ChannelUpdate
14668 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
14671 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
14673 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
14676 * The genesis hash of the blockchain being queried
14678 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
14681 * The genesis hash of the blockchain being queried
14683 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14686 * The height of the first block for the channel UTXOs being queried
14688 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
14691 * The height of the first block for the channel UTXOs being queried
14693 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
14696 * The number of blocks to include in the query results
14698 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
14701 * The number of blocks to include in the query results
14703 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
14706 * Constructs a new QueryChannelRange given each field
14708 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
14711 * Creates a copy of the QueryChannelRange
14713 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
14716 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
14718 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
14721 * The genesis hash of the blockchain being queried
14723 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
14726 * The genesis hash of the blockchain being queried
14728 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14731 * The height of the first block in the range of the reply
14733 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
14736 * The height of the first block in the range of the reply
14738 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
14741 * The number of blocks included in the range of the reply
14743 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
14746 * The number of blocks included in the range of the reply
14748 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
14751 * True when this is the final reply for a query
14753 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
14756 * True when this is the final reply for a query
14758 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
14761 * The short_channel_ids in the channel range
14763 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
14766 * Constructs a new ReplyChannelRange given each field
14768 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);
14771 * Creates a copy of the ReplyChannelRange
14773 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
14776 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
14778 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
14781 * The genesis hash of the blockchain being queried
14783 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
14786 * The genesis hash of the blockchain being queried
14788 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14791 * The short_channel_ids that are being queried
14793 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
14796 * Constructs a new QueryShortChannelIds given each field
14798 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
14801 * Creates a copy of the QueryShortChannelIds
14803 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
14806 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
14808 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
14811 * The genesis hash of the blockchain that was queried
14813 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
14816 * The genesis hash of the blockchain that was queried
14818 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14821 * Indicates if the query recipient maintains up-to-date channel
14822 * information for the chain_hash
14824 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
14827 * Indicates if the query recipient maintains up-to-date channel
14828 * information for the chain_hash
14830 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
14833 * Constructs a new ReplyShortChannelIdsEnd given each field
14835 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
14838 * Creates a copy of the ReplyShortChannelIdsEnd
14840 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
14843 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
14845 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
14848 * The genesis hash of the blockchain for channel and node information
14850 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
14853 * The genesis hash of the blockchain for channel and node information
14855 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14858 * The starting unix timestamp
14860 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
14863 * The starting unix timestamp
14865 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
14868 * The range of information in seconds
14870 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
14873 * The range of information in seconds
14875 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
14878 * Constructs a new GossipTimestampFilter given each field
14880 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
14883 * Creates a copy of the GossipTimestampFilter
14885 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
14888 * Frees any resources used by the ErrorAction
14890 void ErrorAction_free(struct LDKErrorAction this_ptr);
14893 * Creates a copy of the ErrorAction
14895 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
14898 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
14900 void LightningError_free(struct LDKLightningError this_obj);
14903 * A human-readable message describing the error
14905 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
14908 * A human-readable message describing the error
14910 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
14913 * The action which should be taken against the offending peer.
14915 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
14918 * The action which should be taken against the offending peer.
14920 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
14923 * Constructs a new LightningError given each field
14925 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
14928 * Creates a copy of the LightningError
14930 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
14933 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
14935 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
14938 * update_add_htlc messages which should be sent
14940 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
14943 * update_fulfill_htlc messages which should be sent
14945 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
14948 * update_fail_htlc messages which should be sent
14950 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
14953 * update_fail_malformed_htlc messages which should be sent
14955 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
14958 * An update_fee message which should be sent
14960 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
14963 * An update_fee message which should be sent
14965 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
14968 * Finally, the commitment_signed message which should be sent
14970 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
14973 * Finally, the commitment_signed message which should be sent
14975 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
14978 * Constructs a new CommitmentUpdate given each field
14980 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);
14983 * Creates a copy of the CommitmentUpdate
14985 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
14988 * Frees any resources used by the HTLCFailChannelUpdate
14990 void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr);
14993 * Creates a copy of the HTLCFailChannelUpdate
14995 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig);
14998 * Calls the free function if one is set
15000 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
15003 * Calls the free function if one is set
15005 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
15008 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
15010 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
15013 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
15015 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
15018 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
15020 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
15023 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
15025 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
15028 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
15030 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
15033 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
15035 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
15038 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
15040 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
15043 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
15045 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
15048 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
15050 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
15053 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
15055 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
15058 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
15060 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
15063 * Read a FundingCreated from a byte array, created by FundingCreated_write
15065 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
15068 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
15070 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
15073 * Read a FundingSigned from a byte array, created by FundingSigned_write
15075 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
15078 * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
15080 struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
15083 * Read a FundingLocked from a byte array, created by FundingLocked_write
15085 struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
15088 * Serialize the Init object into a byte array which can be read by Init_read
15090 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
15093 * Read a Init from a byte array, created by Init_write
15095 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
15098 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
15100 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
15103 * Read a OpenChannel from a byte array, created by OpenChannel_write
15105 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
15108 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
15110 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
15113 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
15115 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
15118 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
15120 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
15123 * Read a Shutdown from a byte array, created by Shutdown_write
15125 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
15128 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
15130 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
15133 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
15135 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
15138 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
15140 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
15143 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
15145 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
15148 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
15150 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
15153 * Read a UpdateFee from a byte array, created by UpdateFee_write
15155 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
15158 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
15160 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
15163 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
15165 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
15168 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
15170 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
15173 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
15175 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
15178 * Serialize the Ping object into a byte array which can be read by Ping_read
15180 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
15183 * Read a Ping from a byte array, created by Ping_write
15185 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
15188 * Serialize the Pong object into a byte array which can be read by Pong_read
15190 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
15193 * Read a Pong from a byte array, created by Pong_write
15195 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
15198 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
15200 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
15203 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
15205 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
15208 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
15210 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
15213 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
15215 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
15218 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
15220 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
15223 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
15225 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
15228 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
15230 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
15233 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
15235 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
15238 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
15240 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
15243 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
15245 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
15248 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
15250 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
15253 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
15255 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
15258 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
15260 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
15263 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
15265 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
15268 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
15270 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
15273 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
15275 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
15278 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
15280 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
15283 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
15285 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
15288 *\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
15290 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
15293 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
15295 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
15298 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
15300 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
15303 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
15305 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
15308 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
15310 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
15313 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
15315 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
15318 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
15320 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
15323 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
15325 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
15328 * Constructs a new IgnoringMessageHandler given each field
15330 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
15333 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
15334 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
15336 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
15339 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
15340 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
15342 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
15345 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
15347 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
15350 * Constructs a new ErroringMessageHandler
15352 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
15355 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
15356 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
15358 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
15361 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
15362 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
15364 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
15367 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
15369 void MessageHandler_free(struct LDKMessageHandler this_obj);
15372 * A message handler which handles messages specific to channels. Usually this is just a
15373 * ChannelManager object or a ErroringMessageHandler.
15375 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
15378 * A message handler which handles messages specific to channels. Usually this is just a
15379 * ChannelManager object or a ErroringMessageHandler.
15381 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
15384 * A message handler which handles messages updating our knowledge of the network channel
15385 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
15387 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
15390 * A message handler which handles messages updating our knowledge of the network channel
15391 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
15393 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
15396 * Constructs a new MessageHandler given each field
15398 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
15401 * Creates a copy of a SocketDescriptor
15403 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
15406 * Calls the free function if one is set
15408 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
15411 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
15413 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
15416 * Used to indicate that we probably can't make any future connections to this peer, implying
15417 * we should go ahead and force-close any channels we have with it.
15419 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
15422 * Used to indicate that we probably can't make any future connections to this peer, implying
15423 * we should go ahead and force-close any channels we have with it.
15425 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
15428 * Constructs a new PeerHandleError given each field
15430 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
15433 * Creates a copy of the PeerHandleError
15435 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
15438 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
15440 void PeerManager_free(struct LDKPeerManager this_obj);
15443 * Constructs a new PeerManager with the given message handlers and node_id secret key
15444 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
15445 * cryptographically secure random bytes.
15447 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);
15450 * Get the list of node ids for peers which have completed the initial handshake.
15452 * For outbound connections, this will be the same as the their_node_id parameter passed in to
15453 * new_outbound_connection, however entries will only appear once the initial handshake has
15454 * completed and we are sure the remote peer has the private key for the given node_id.
15456 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
15459 * Indicates a new outbound connection has been established to a node with the given node_id.
15460 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
15461 * descriptor but must disconnect the connection immediately.
15463 * Returns a small number of bytes to send to the remote node (currently always 50).
15465 * Panics if descriptor is duplicative with some other descriptor which has not yet had a
15466 * socket_disconnected().
15468 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);
15471 * Indicates a new inbound connection has been established.
15473 * May refuse the connection by returning an Err, but will never write bytes to the remote end
15474 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
15475 * call socket_disconnected for the new descriptor but must disconnect the connection
15478 * Panics if descriptor is duplicative with some other descriptor which has not yet had
15479 * socket_disconnected called.
15481 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor);
15484 * Indicates that there is room to write data to the given socket descriptor.
15486 * May return an Err to indicate that the connection should be closed.
15488 * Will most likely call send_data on the descriptor passed in (or the descriptor handed into
15489 * new_*\\_connection) before returning. Thus, be very careful with reentrancy issues! The
15490 * invariants around calling write_buffer_space_avail in case a write did not fully complete
15491 * must still hold - be ready to call write_buffer_space_avail again if a write call generated
15492 * here isn't sufficient! Panics if the descriptor was not previously registered in a
15493 * new_\\*_connection event.
15495 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
15498 * Indicates that data was read from the given socket descriptor.
15500 * May return an Err to indicate that the connection should be closed.
15502 * Will *not* call back into send_data on any descriptors to avoid reentrancy complexity.
15503 * Thus, however, you almost certainly want to call process_events() after any read_event to
15504 * generate send_data calls to handle responses.
15506 * If Ok(true) is returned, further read_events should not be triggered until a send_data call
15507 * on this file descriptor has resume_read set (preventing DoS issues in the send buffer).
15509 * Panics if the descriptor was not previously registered in a new_*_connection event.
15511 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);
15514 * Checks for any events generated by our handlers and processes them. Includes sending most
15515 * response messages as well as messages generated by calls to handler functions directly (eg
15516 * functions like ChannelManager::process_pending_htlc_forward or send_payment).
15518 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
15521 * Indicates that the given socket descriptor's connection is now closed.
15523 * This must only be called if the socket has been disconnected by the peer or your own
15524 * decision to disconnect it and must NOT be called in any case where other parts of this
15525 * library (eg PeerHandleError, explicit disconnect_socket calls) instruct you to disconnect
15528 * Panics if the descriptor was not previously registered in a successful new_*_connection event.
15530 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
15533 * Disconnect a peer given its node id.
15535 * Set no_connection_possible to true to prevent any further connection with this peer,
15536 * force-closing any channels we have with it.
15538 * If a peer is connected, this will call `disconnect_socket` on the descriptor for the peer,
15539 * so be careful about reentrancy issues.
15541 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
15544 * This function should be called roughly once every 30 seconds.
15545 * It will send pings to each peer and disconnect those which did not respond to the last round of pings.
15546 * Will most likely call send_data on all of the registered descriptors, thus, be very careful with reentrancy issues!
15548 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
15551 * Build the commitment secret from the seed and the commitment number
15553 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
15556 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
15557 * from the base secret and the per_commitment_point.
15559 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
15560 * generated (ie our own).
15562 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
15565 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
15566 * from the base point and the per_commitment_key. This is the public equivalent of
15567 * derive_private_key - using only public keys to derive a public key instead of private keys.
15569 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
15570 * generated (ie our own).
15572 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
15575 * Derives a per-commitment-transaction revocation key from its constituent parts.
15577 * Only the cheating participant owns a valid witness to propagate a revoked
15578 * commitment transaction, thus per_commitment_secret always come from cheater
15579 * and revocation_base_secret always come from punisher, which is the broadcaster
15580 * of the transaction spending with this key knowledge.
15582 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
15583 * generated (ie our own).
15585 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
15588 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
15589 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
15590 * public key instead of private keys.
15592 * Only the cheating participant owns a valid witness to propagate a revoked
15593 * commitment transaction, thus per_commitment_point always come from cheater
15594 * and revocation_base_point always come from punisher, which is the broadcaster
15595 * of the transaction spending with this key knowledge.
15597 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
15598 * generated (ie our own).
15600 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
15603 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
15605 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
15608 * The broadcaster's per-commitment public key which was used to derive the other keys.
15610 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
15613 * The broadcaster's per-commitment public key which was used to derive the other keys.
15615 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15618 * The revocation key which is used to allow the broadcaster of the commitment
15619 * transaction to provide their counterparty the ability to punish them if they broadcast
15622 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
15625 * The revocation key which is used to allow the broadcaster of the commitment
15626 * transaction to provide their counterparty the ability to punish them if they broadcast
15629 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15632 * Broadcaster's HTLC Key
15634 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
15637 * Broadcaster's HTLC Key
15639 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15642 * Countersignatory's HTLC Key
15644 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
15647 * Countersignatory's HTLC Key
15649 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15652 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
15654 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
15657 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
15659 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15662 * Constructs a new TxCreationKeys given each field
15664 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);
15667 * Creates a copy of the TxCreationKeys
15669 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
15672 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
15674 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
15677 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
15679 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
15682 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
15684 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
15687 * The public key which is used to sign all commitment transactions, as it appears in the
15688 * on-chain channel lock-in 2-of-2 multisig output.
15690 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
15693 * The public key which is used to sign all commitment transactions, as it appears in the
15694 * on-chain channel lock-in 2-of-2 multisig output.
15696 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15699 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
15700 * revocation keys. This is combined with the per-commitment-secret generated by the
15701 * counterparty to create a secret which the counterparty can reveal to revoke previous
15704 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
15707 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
15708 * revocation keys. This is combined with the per-commitment-secret generated by the
15709 * counterparty to create a secret which the counterparty can reveal to revoke previous
15712 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15715 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
15716 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
15717 * static across every commitment transaction.
15719 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
15722 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
15723 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
15724 * static across every commitment transaction.
15726 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15729 * The base point which is used (with derive_public_key) to derive a per-commitment payment
15730 * public key which receives non-HTLC-encumbered funds which are only available for spending
15731 * after some delay (or can be claimed via the revocation path).
15733 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
15736 * The base point which is used (with derive_public_key) to derive a per-commitment payment
15737 * public key which receives non-HTLC-encumbered funds which are only available for spending
15738 * after some delay (or can be claimed via the revocation path).
15740 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15743 * The base point which is used (with derive_public_key) to derive a per-commitment public key
15744 * which is used to encumber HTLC-in-flight outputs.
15746 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
15749 * The base point which is used (with derive_public_key) to derive a per-commitment public key
15750 * which is used to encumber HTLC-in-flight outputs.
15752 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15755 * Constructs a new ChannelPublicKeys given each field
15757 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);
15760 * Creates a copy of the ChannelPublicKeys
15762 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
15765 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
15767 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
15770 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
15772 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
15775 * Create per-state keys from channel base points and the per-commitment point.
15776 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
15778 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);
15781 * Generate per-state keys from channel static keys.
15782 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
15784 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);
15787 * A script either spendable by the revocation
15788 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
15789 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
15791 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
15794 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
15796 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
15799 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
15800 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
15801 * need to compare this value to whether the commitment transaction in question is that of
15802 * the counterparty or our own.
15804 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
15807 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
15808 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
15809 * need to compare this value to whether the commitment transaction in question is that of
15810 * the counterparty or our own.
15812 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
15815 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
15816 * this divided by 1000.
15818 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
15821 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
15822 * this divided by 1000.
15824 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
15827 * The CLTV lock-time at which this HTLC expires.
15829 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
15832 * The CLTV lock-time at which this HTLC expires.
15834 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
15837 * The hash of the preimage which unlocks this HTLC.
15839 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
15842 * The hash of the preimage which unlocks this HTLC.
15844 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15847 * The position within the commitment transactions' outputs. This may be None if the value is
15848 * below the dust limit (in which case no output appears in the commitment transaction and the
15849 * value is spent to additional transaction fees).
15851 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
15854 * The position within the commitment transactions' outputs. This may be None if the value is
15855 * below the dust limit (in which case no output appears in the commitment transaction and the
15856 * value is spent to additional transaction fees).
15858 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
15861 * Constructs a new HTLCOutputInCommitment given each field
15863 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);
15866 * Creates a copy of the HTLCOutputInCommitment
15868 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
15871 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
15873 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
15876 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
15878 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
15881 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
15882 * does not need to have its previous_output_index filled.
15884 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys);
15887 * Gets the redeemscript for a funding output from the two funding public keys.
15888 * Note that the order of funding public keys does not matter.
15890 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
15893 * panics if htlc.transaction_output_index.is_none()!
15895 struct LDKTransaction build_htlc_transaction(const uint8_t (*prev_hash)[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);
15898 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
15900 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
15903 * Holder public keys
15905 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
15908 * Holder public keys
15910 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
15913 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
15915 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
15918 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
15920 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
15923 * Whether the holder is the initiator of this channel.
15924 * This is an input to the commitment number obscure factor computation.
15926 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
15929 * Whether the holder is the initiator of this channel.
15930 * This is an input to the commitment number obscure factor computation.
15932 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
15935 * The late-bound counterparty channel transaction parameters.
15936 * These parameters are populated at the point in the protocol where the counterparty provides them.
15938 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
15941 * The late-bound counterparty channel transaction parameters.
15942 * These parameters are populated at the point in the protocol where the counterparty provides them.
15944 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
15947 * The late-bound funding outpoint
15949 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
15952 * The late-bound funding outpoint
15954 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
15957 * Constructs a new ChannelTransactionParameters given each field
15959 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);
15962 * Creates a copy of the ChannelTransactionParameters
15964 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
15967 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
15969 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
15972 * Counter-party public keys
15974 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
15977 * Counter-party public keys
15979 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
15982 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
15984 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
15987 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
15989 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
15992 * Constructs a new CounterpartyChannelTransactionParameters given each field
15994 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
15997 * Creates a copy of the CounterpartyChannelTransactionParameters
15999 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
16002 * Whether the late bound parameters are populated.
16004 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
16007 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
16008 * given that the holder is the broadcaster.
16010 * self.is_populated() must be true before calling this function.
16012 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
16015 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
16016 * given that the counterparty is the broadcaster.
16018 * self.is_populated() must be true before calling this function.
16020 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
16023 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
16025 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
16028 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
16030 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
16033 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
16035 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
16038 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
16040 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
16043 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
16045 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
16048 * Get the channel pubkeys for the broadcaster
16050 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16053 * Get the channel pubkeys for the countersignatory
16055 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16058 * Get the contest delay applicable to the transactions.
16059 * Note that the contest delay was selected by the countersignatory.
16061 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16064 * Whether the channel is outbound from the broadcaster.
16066 * The boolean representing the side that initiated the channel is
16067 * an input to the commitment number obscure factor computation.
16069 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16072 * The funding outpoint
16074 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
16077 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
16079 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
16082 * Our counterparty's signature for the transaction
16084 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
16087 * Our counterparty's signature for the transaction
16089 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
16092 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
16094 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
16097 * Creates a copy of the HolderCommitmentTransaction
16099 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
16102 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
16104 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
16107 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
16109 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
16112 * Create a new holder transaction with the given counterparty signatures.
16113 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
16115 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);
16118 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
16120 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
16123 * The commitment transaction
16125 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
16128 * The commitment transaction
16130 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
16133 * The txid for the commitment transaction.
16135 * This is provided as a performance optimization, instead of calling transaction.txid()
16138 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
16141 * The txid for the commitment transaction.
16143 * This is provided as a performance optimization, instead of calling transaction.txid()
16146 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
16149 * Constructs a new BuiltCommitmentTransaction given each field
16151 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
16154 * Creates a copy of the BuiltCommitmentTransaction
16156 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
16159 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
16161 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
16164 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
16166 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
16169 * Get the SIGHASH_ALL sighash value of the transaction.
16171 * This can be used to verify a signature.
16173 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);
16176 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
16177 * because we are about to broadcast a holder transaction.
16179 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);
16182 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
16184 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
16187 * Creates a copy of the CommitmentTransaction
16189 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
16192 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
16194 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
16197 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
16199 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
16202 * The backwards-counting commitment number
16204 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16207 * The value to be sent to the broadcaster
16209 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16212 * The value to be sent to the counterparty
16214 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16217 * The feerate paid per 1000-weight-unit in this commitment transaction.
16219 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16222 * Trust our pre-built transaction and derived transaction creation public keys.
16224 * Applies a wrapper which allows access to these fields.
16226 * This should only be used if you fully trust the builder of this object. It should not
16227 *\tbe used by an external signer - instead use the verify function.
16229 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16232 * Verify our pre-built transaction and derived transaction creation public keys.
16234 * Applies a wrapper which allows access to these fields.
16236 * An external validating signer must call this method before signing
16237 * or using the built transaction.
16239 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);
16242 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
16244 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
16247 * The transaction ID of the built Bitcoin transaction
16249 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
16252 * The pre-built Bitcoin commitment transaction
16254 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
16257 * The pre-calculated transaction creation public keys.
16259 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
16262 * Get a signature for each HTLC which was included in the commitment transaction (ie for
16263 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
16265 * The returned Vec has one entry for each HTLC, and in the same order.
16267 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);
16270 * Get the transaction number obscure factor
16272 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
16275 * Creates a copy of the InitFeatures
16277 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
16280 * Creates a copy of the NodeFeatures
16282 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
16285 * Creates a copy of the ChannelFeatures
16287 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
16290 * Creates a copy of the InvoiceFeatures
16292 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
16295 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
16297 void InitFeatures_free(struct LDKInitFeatures this_obj);
16300 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
16302 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
16305 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
16307 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
16310 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
16312 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
16315 * Create a blank Features with no features set
16317 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
16320 * Creates a Features with the bits set which are known by the implementation
16322 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
16325 * Create a blank Features with no features set
16327 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
16330 * Creates a Features with the bits set which are known by the implementation
16332 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
16335 * Create a blank Features with no features set
16337 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
16340 * Creates a Features with the bits set which are known by the implementation
16342 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
16345 * Create a blank Features with no features set
16347 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
16350 * Creates a Features with the bits set which are known by the implementation
16352 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
16355 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
16357 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
16360 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
16362 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
16365 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
16367 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
16370 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
16372 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
16375 * Read a InitFeatures from a byte array, created by InitFeatures_write
16377 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
16380 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
16382 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
16385 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
16387 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
16390 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
16392 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
16395 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
16397 void RouteHop_free(struct LDKRouteHop this_obj);
16400 * The node_id of the node at this hop.
16402 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16405 * The node_id of the node at this hop.
16407 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16410 * The node_announcement features of the node at this hop. For the last hop, these may be
16411 * amended to match the features present in the invoice this node generated.
16413 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16416 * The node_announcement features of the node at this hop. For the last hop, these may be
16417 * amended to match the features present in the invoice this node generated.
16419 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
16422 * The channel that should be used from the previous hop to reach this node.
16424 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16427 * The channel that should be used from the previous hop to reach this node.
16429 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
16432 * The channel_announcement features of the channel that should be used from the previous hop
16433 * to reach this node.
16435 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16438 * The channel_announcement features of the channel that should be used from the previous hop
16439 * to reach this node.
16441 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
16444 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
16445 * For the last hop, this should be the full value of the payment (might be more than
16446 * requested if we had to match htlc_minimum_msat).
16448 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16451 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
16452 * For the last hop, this should be the full value of the payment (might be more than
16453 * requested if we had to match htlc_minimum_msat).
16455 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
16458 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
16459 * expected at the destination, in excess of the current block height.
16461 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16464 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
16465 * expected at the destination, in excess of the current block height.
16467 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
16470 * Constructs a new RouteHop given each field
16472 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);
16475 * Creates a copy of the RouteHop
16477 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
16480 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
16482 void Route_free(struct LDKRoute this_obj);
16485 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
16486 * last RouteHop in each path must be the same.
16487 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
16488 * destination. Thus, this must always be at least length one. While the maximum length of any
16489 * given path is variable, keeping the length of any path to less than 20 should currently
16490 * ensure it is viable.
16492 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
16495 * Constructs a new Route given each field
16497 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
16500 * Creates a copy of the Route
16502 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
16505 * Serialize the Route object into a byte array which can be read by Route_read
16507 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
16510 * Read a Route from a byte array, created by Route_write
16512 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
16515 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
16517 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
16520 * The node_id of the non-target end of the route
16522 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16525 * The node_id of the non-target end of the route
16527 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16530 * The short_channel_id of this channel
16532 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16535 * The short_channel_id of this channel
16537 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
16540 * The fees which must be paid to use this channel
16542 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16545 * The fees which must be paid to use this channel
16547 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
16550 * The difference in CLTV values between this node and the next node.
16552 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16555 * The difference in CLTV values between this node and the next node.
16557 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
16560 * The minimum value, in msat, which must be relayed to the next hop.
16562 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16565 * The minimum value, in msat, which must be relayed to the next hop.
16567 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
16570 * The maximum value in msat available for routing with a single HTLC.
16572 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16575 * The maximum value in msat available for routing with a single HTLC.
16577 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
16580 * Constructs a new RouteHintHop given each field
16582 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);
16585 * Creates a copy of the RouteHintHop
16587 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
16590 * Gets a route from us (payer) to the given target node (payee).
16592 * If the payee provided features in their invoice, they should be provided via payee_features.
16593 * Without this, MPP will only be used if the payee's features are available in the network graph.
16595 * Extra routing hops between known nodes and the target will be used if they are included in
16598 * If some channels aren't announced, it may be useful to fill in a first_hops with the
16599 * results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
16600 * view of our local channels (from net_graph_msg_handler) will be ignored, and only those
16601 * in first_hops will be used.
16603 * Panics if first_hops contains channels without short_channel_ids
16604 * (ChannelManager::list_usable_channels will never include such channels).
16606 * The fees on channels from us to next-hops are ignored (as they are assumed to all be
16607 * equal), however the enabled/disabled bit on such channels as well as the
16608 * htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
16610 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_RouteHintHopZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
16613 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
16615 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
16618 * Creates a copy of the NetworkGraph
16620 struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
16623 * Frees any resources used by the LockedNetworkGraph, if is_owned is set and inner is non-NULL.
16625 void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj);
16628 * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
16630 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
16633 * Creates a new tracker of the actual state of the network of channels and nodes,
16634 * assuming a fresh network graph.
16635 * Chain monitor is used to make sure announced channels exist on-chain,
16636 * channel data is correct, and that the announcement is signed with
16637 * channel owners' keys.
16639 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger);
16642 * Creates a new tracker of the actual state of the network of channels and nodes,
16643 * assuming an existing Network Graph.
16645 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph);
16648 * Adds a provider used to check new announcements. Does not affect
16649 * existing announcements unless they are updated.
16650 * Add, update or remove the provider would replace the current one.
16652 void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKAccess *chain_access);
16655 * Take a read lock on the network_graph and return it in the C-bindings
16656 * newtype helper. This is likely only useful when called via the C
16657 * bindings as you can call `self.network_graph.read().unwrap()` in Rust
16660 MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
16663 * Get a reference to the NetworkGraph which this read-lock contains.
16665 MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg);
16668 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
16669 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
16671 struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
16674 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
16675 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
16677 struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
16680 * Frees any resources used by the DirectionalChannelInfo, if is_owned is set and inner is non-NULL.
16682 void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_obj);
16685 * When the last update to the channel direction was issued.
16686 * Value is opaque, as set in the announcement.
16688 uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
16691 * When the last update to the channel direction was issued.
16692 * Value is opaque, as set in the announcement.
16694 void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val);
16697 * Whether the channel can be currently used for payments (in this one direction).
16699 bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
16702 * Whether the channel can be currently used for payments (in this one direction).
16704 void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, bool val);
16707 * The difference in CLTV values that you must have when routing through this channel.
16709 uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
16712 * The difference in CLTV values that you must have when routing through this channel.
16714 void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint16_t val);
16717 * The minimum value, which must be relayed to the next hop via the channel
16719 uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
16722 * The minimum value, which must be relayed to the next hop via the channel
16724 void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val);
16727 * The maximum value which may be relayed to the next hop via the channel.
16729 struct LDKCOption_u64Z DirectionalChannelInfo_get_htlc_maximum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
16732 * The maximum value which may be relayed to the next hop via the channel.
16734 void DirectionalChannelInfo_set_htlc_maximum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
16737 * Fees charged when the channel is used for routing
16739 struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
16742 * Fees charged when the channel is used for routing
16744 void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
16747 * Most recent update for the channel received from the network
16748 * Mostly redundant with the data we store in fields explicitly.
16749 * Everything else is useful only for sending out for initial routing sync.
16750 * Not stored if contains excess data to prevent DoS.
16752 struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
16755 * Most recent update for the channel received from the network
16756 * Mostly redundant with the data we store in fields explicitly.
16757 * Everything else is useful only for sending out for initial routing sync.
16758 * Not stored if contains excess data to prevent DoS.
16760 void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
16763 * Constructs a new DirectionalChannelInfo given each field
16765 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);
16768 * Creates a copy of the DirectionalChannelInfo
16770 struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig);
16773 * Serialize the DirectionalChannelInfo object into a byte array which can be read by DirectionalChannelInfo_read
16775 struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj);
16778 * Read a DirectionalChannelInfo from a byte array, created by DirectionalChannelInfo_write
16780 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser);
16783 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
16785 void ChannelInfo_free(struct LDKChannelInfo this_obj);
16788 * Protocol features of a channel communicated during its announcement
16790 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
16793 * Protocol features of a channel communicated during its announcement
16795 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
16798 * Source node of the first direction of a channel
16800 struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
16803 * Source node of the first direction of a channel
16805 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16808 * Details about the first direction of a channel
16810 struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
16813 * Details about the first direction of a channel
16815 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
16818 * Source node of the second direction of a channel
16820 struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
16823 * Source node of the second direction of a channel
16825 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16828 * Details about the second direction of a channel
16830 struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
16833 * Details about the second direction of a channel
16835 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
16838 * The channel capacity as seen on-chain, if chain lookup is available.
16840 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
16843 * The channel capacity as seen on-chain, if chain lookup is available.
16845 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
16848 * An initial announcement of the channel
16849 * Mostly redundant with the data we store in fields explicitly.
16850 * Everything else is useful only for sending out for initial routing sync.
16851 * Not stored if contains excess data to prevent DoS.
16853 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
16856 * An initial announcement of the channel
16857 * Mostly redundant with the data we store in fields explicitly.
16858 * Everything else is useful only for sending out for initial routing sync.
16859 * Not stored if contains excess data to prevent DoS.
16861 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
16864 * Constructs a new ChannelInfo given each field
16866 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);
16869 * Creates a copy of the ChannelInfo
16871 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
16874 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
16876 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
16879 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
16881 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
16884 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
16886 void RoutingFees_free(struct LDKRoutingFees this_obj);
16889 * Flat routing fee in satoshis
16891 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
16894 * Flat routing fee in satoshis
16896 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
16899 * Liquidity-based routing fee in millionths of a routed amount.
16900 * In other words, 10000 is 1%.
16902 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
16905 * Liquidity-based routing fee in millionths of a routed amount.
16906 * In other words, 10000 is 1%.
16908 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
16911 * Constructs a new RoutingFees given each field
16913 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
16916 * Creates a copy of the RoutingFees
16918 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
16921 * Read a RoutingFees from a byte array, created by RoutingFees_write
16923 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
16926 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
16928 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
16931 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
16933 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
16936 * Protocol features the node announced support for
16938 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
16941 * Protocol features the node announced support for
16943 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
16946 * When the last known update to the node state was issued.
16947 * Value is opaque, as set in the announcement.
16949 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
16952 * When the last known update to the node state was issued.
16953 * Value is opaque, as set in the announcement.
16955 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
16958 * Color assigned to the node
16960 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
16963 * Color assigned to the node
16965 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
16968 * Moniker assigned to the node.
16969 * May be invalid or malicious (eg control chars),
16970 * should not be exposed to the user.
16972 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
16975 * Moniker assigned to the node.
16976 * May be invalid or malicious (eg control chars),
16977 * should not be exposed to the user.
16979 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
16982 * Internet-level addresses via which one can connect to the node
16984 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
16987 * An initial announcement of the node
16988 * Mostly redundant with the data we store in fields explicitly.
16989 * Everything else is useful only for sending out for initial routing sync.
16990 * Not stored if contains excess data to prevent DoS.
16992 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
16995 * An initial announcement of the node
16996 * Mostly redundant with the data we store in fields explicitly.
16997 * Everything else is useful only for sending out for initial routing sync.
16998 * Not stored if contains excess data to prevent DoS.
17000 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
17003 * Constructs a new NodeAnnouncementInfo given each field
17005 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);
17008 * Creates a copy of the NodeAnnouncementInfo
17010 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
17013 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
17015 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
17018 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
17020 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
17023 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
17025 void NodeInfo_free(struct LDKNodeInfo this_obj);
17028 * All valid channels a node has announced
17030 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
17033 * Lowest fees enabling routing via any of the enabled, known channels to a node.
17034 * The two fields (flat and proportional fee) are independent,
17035 * meaning they don't have to refer to the same channel.
17037 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
17040 * Lowest fees enabling routing via any of the enabled, known channels to a node.
17041 * The two fields (flat and proportional fee) are independent,
17042 * meaning they don't have to refer to the same channel.
17044 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
17047 * More information about a node from node_announcement.
17048 * Optional because we store a Node entry after learning about it from
17049 * a channel announcement, but before receiving a node announcement.
17051 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
17054 * More information about a node from node_announcement.
17055 * Optional because we store a Node entry after learning about it from
17056 * a channel announcement, but before receiving a node announcement.
17058 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
17061 * Constructs a new NodeInfo given each field
17063 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
17066 * Creates a copy of the NodeInfo
17068 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
17071 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
17073 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
17076 * Read a NodeInfo from a byte array, created by NodeInfo_write
17078 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
17081 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
17083 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
17086 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
17088 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
17091 * Creates a new, empty, network graph.
17093 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
17096 * For an already known node (from channel announcements), update its stored properties from a
17097 * given node announcement.
17099 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
17100 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
17101 * routing messages from a source using a protocol other than the lightning P2P protocol.
17103 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
17106 * For an already known node (from channel announcements), update its stored properties from a
17107 * given node announcement without verifying the associated signatures. Because we aren't
17108 * given the associated signatures here we cannot relay the node announcement to any of our
17111 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
17114 * Store or update channel info from a channel announcement.
17116 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
17117 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
17118 * routing messages from a source using a protocol other than the lightning P2P protocol.
17120 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
17121 * the corresponding UTXO exists on chain and is correctly-formatted.
17123 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);
17126 * Store or update channel info from a channel announcement without verifying the associated
17127 * signatures. Because we aren't given the associated signatures here we cannot relay the
17128 * channel announcement to any of our peers.
17130 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
17131 * the corresponding UTXO exists on chain and is correctly-formatted.
17133 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);
17136 * Close a channel if a corresponding HTLC fail was sent.
17137 * If permanent, removes a channel from the local storage.
17138 * May cause the removal of nodes too, if this was their last channel.
17139 * If not permanent, makes channels unavailable for routing.
17141 void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
17144 * For an already known (from announcement) channel, update info about one of the directions
17147 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
17148 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
17149 * routing messages from a source using a protocol other than the lightning P2P protocol.
17151 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
17154 * For an already known (from announcement) channel, update info about one of the directions
17155 * of the channel without verifying the associated signatures. Because we aren't given the
17156 * associated signatures here we cannot relay the channel update to any of our peers.
17158 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
17161 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
17163 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
17166 * Initialize a new FilesystemPersister and set the path to the individual channels'
17169 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
17172 * Get the directory which was provided when this persister was initialized.
17174 MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
17177 * Writes the provided `ChannelManager` to the path provided at `FilesystemPersister`
17178 * initialization, within a file called \"manager\".
17180 MUST_USE_RES struct LDKCResult_NoneErrorZ FilesystemPersister_persist_manager(struct LDKStr data_dir, const struct LDKChannelManager *NONNULL_PTR manager);
17183 * Read `ChannelMonitor`s from disk.
17185 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
17188 * Constructs a new Persist which calls the relevant methods on this_arg.
17189 * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
17191 struct LDKPersist FilesystemPersister_as_Persist(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
17194 * **Call this function on startup to ensure that all assumptions about the platform are valid.**
17196 * Unfortunately we have to make assumptions about the upper bounds of the `SystemTime` type on
17197 * your platform which we can't fully verify at compile time and which isn't part of it's contract.
17198 * To our best knowledge our assumptions hold for all platforms officially supported by rust, but
17199 * since this check is fast we recommend to do it anyway.
17201 * If this function fails this is considered a bug. Please open an issue describing your
17202 * platform and stating your current system time.
17205 * If the check fails this function panics. By calling this function on startup you ensure that
17206 * this wont happen at an arbitrary later point in time.
17208 void check_platform(void);
17211 * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
17213 void Invoice_free(struct LDKInvoice this_obj);
17216 * Creates a copy of the Invoice
17218 struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
17221 * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
17223 void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
17226 * Creates a copy of the SignedRawInvoice
17228 struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
17231 * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
17233 void RawInvoice_free(struct LDKRawInvoice this_obj);
17238 struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
17243 void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
17246 * Creates a copy of the RawInvoice
17248 struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
17251 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
17253 void RawDataPart_free(struct LDKRawDataPart this_obj);
17256 * generation time of the invoice
17258 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
17261 * generation time of the invoice
17263 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
17266 * Creates a copy of the RawDataPart
17268 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
17271 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
17273 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
17276 * Creates a copy of the PositiveTimestamp
17278 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
17281 * Creates a copy of the SiPrefix
17283 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
17286 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
17287 * This is effectively 10^12 * the prefix multiplier
17289 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
17292 * Creates a copy of the Currency
17294 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
17297 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
17299 void Sha256_free(struct LDKSha256 this_obj);
17302 * Creates a copy of the Sha256
17304 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
17307 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
17309 void Description_free(struct LDKDescription this_obj);
17312 * Creates a copy of the Description
17314 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
17317 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
17319 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
17322 * Creates a copy of the PayeePubKey
17324 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
17327 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
17329 void ExpiryTime_free(struct LDKExpiryTime this_obj);
17332 * Creates a copy of the ExpiryTime
17334 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
17337 * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
17339 void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
17342 * Creates a copy of the MinFinalCltvExpiry
17344 struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
17347 * Frees any resources used by the Fallback
17349 void Fallback_free(struct LDKFallback this_ptr);
17352 * Creates a copy of the Fallback
17354 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
17357 * Frees any resources used by the InvoiceSignature, if is_owned is set and inner is non-NULL.
17359 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
17362 * Creates a copy of the InvoiceSignature
17364 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
17367 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
17369 void RouteHint_free(struct LDKRouteHint this_obj);
17372 * Creates a copy of the RouteHint
17374 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
17377 * Disassembles the `SignedRawInvoice` into its three parts:
17379 * 2. hash of the raw invoice
17382 MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg);
17385 * The `RawInvoice` which was signed.
17387 MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
17390 * The hash of the `RawInvoice` that was signed.
17392 MUST_USE_RES const uint8_t (*SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32];
17395 * InvoiceSignature for the invoice.
17397 MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
17400 * Recovers the public key used for signing the invoice from the recoverable signature.
17402 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
17405 * Checks if the signature is valid for the included payee public key or if none exists if it's
17406 * valid for the recovered signature (which should always be true?).
17408 MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
17411 * Calculate the hash of the encoded `RawInvoice`
17413 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17415 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17417 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17419 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17421 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17423 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17425 MUST_USE_RES struct LDKMinFinalCltvExpiry RawInvoice_min_final_cltv_expiry(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17427 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17429 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17431 MUST_USE_RES struct LDKCVec_RouteHintZ RawInvoice_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17433 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17435 MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17438 * Create a new `PositiveTimestamp` from a unix timestamp in the Range
17439 * `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a
17440 * `CreationError::TimestampOutOfBounds`.
17442 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
17445 * Create a new `PositiveTimestamp` from a `SystemTime` with a corresponding unix timestamp in
17446 * the Range `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a
17447 * `CreationError::TimestampOutOfBounds`.
17449 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
17452 * Returns the UNIX timestamp representing the stored time
17454 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
17457 * Returns a reference to the internal `SystemTime` time representation
17459 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
17462 * Transform the `Invoice` into it's unchecked version
17464 MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg);
17467 * Check that the invoice is signed correctly and that key recovery works
17469 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
17472 * Constructs an `Invoice` from a `SignedInvoice` by checking all its invariants.
17474 * use lightning_invoice::*;
17476 * let invoice = \"lnbc1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdp\\
17477 * \tl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq8rkx3yf5tcsyz3d7\\
17478 * \t3gafnh3cax9rn449d9p5uxz9ezhhypd0elx87sjle52x86fux2ypatgddc6k63n7erqz25le42c4u4ec\\
17479 * \tky03ylcqca784w\";
17481 * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
17483 * assert!(Invoice::from_signed(signed).is_ok());
17486 MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice);
17489 * Returns the `Invoice`'s timestamp (should equal it's creation time)
17491 MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg);
17494 * Returns the hash to which we will receive the preimage on completion of the payment
17496 MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
17499 * Get the payee's public key if one was included in the invoice
17501 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
17504 * Get the payment secret if one was included in the invoice
17506 MUST_USE_RES struct LDKThirtyTwoBytes Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg);
17509 * Get the invoice features if they were included in the invoice
17511 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
17514 * Recover the payee's public key (only to be used if none was included in the invoice)
17516 MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
17519 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
17521 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
17524 * Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
17525 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`].
17527 MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
17530 * Returns a list of all routes included in the invoice
17532 MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
17535 * Returns the currency for which the invoice was issued
17537 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
17540 * Returns the amount if specified in the invoice as pico <currency>.
17542 MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_pico_btc(const struct LDKInvoice *NONNULL_PTR this_arg);
17545 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
17546 * returns `CreationError::DescriptionTooLong` otherwise
17548 * Please note that single characters may use more than one byte due to UTF8 encoding.
17550 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
17553 * Returns the underlying description `String`
17555 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
17558 * Construct an `ExpiryTime` from seconds. If there exists a `PositiveTimestamp` which would
17559 * overflow on adding the `EpiryTime` to it then this function will return a
17560 * `CreationError::ExpiryTimeOutOfBounds`.
17562 MUST_USE_RES struct LDKCResult_ExpiryTimeCreationErrorZ ExpiryTime_from_seconds(uint64_t seconds);
17565 * Construct an `ExpiryTime` from a `Duration`. If there exists a `PositiveTimestamp` which
17566 * would overflow on adding the `EpiryTime` to it then this function will return a
17567 * `CreationError::ExpiryTimeOutOfBounds`.
17569 MUST_USE_RES struct LDKCResult_ExpiryTimeCreationErrorZ ExpiryTime_from_duration(uint64_t duration);
17572 * Returns the expiry time in seconds
17574 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
17577 * Returns a reference to the underlying `Duration` (=expiry time)
17579 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
17582 * Create a new (partial) route from a list of hops
17584 MUST_USE_RES struct LDKCResult_RouteHintCreationErrorZ RouteHint_new(struct LDKCVec_RouteHintHopZ hops);
17587 * Returrn the underlying vector of hops
17589 MUST_USE_RES struct LDKCVec_RouteHintHopZ RouteHint_into_inner(struct LDKRouteHint this_arg);
17592 * Creates a copy of the CreationError
17594 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
17597 * Get the string representation of a CreationError object
17599 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
17602 * Creates a copy of the SemanticError
17604 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
17607 * Get the string representation of a SemanticError object
17609 struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
17612 * Frees any resources used by the SignOrCreationError
17614 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
17617 * Creates a copy of the SignOrCreationError
17619 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
17622 * Get the string representation of a SignOrCreationError object
17624 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
17627 * Utility to construct an invoice. Generally, unless you want to do something like a custom
17628 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
17629 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
17630 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
17631 * that the payment secret is valid when the invoice is paid.
17633 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);
17636 * Read a SiPrefix object from a string
17638 struct LDKCResult_SiPrefixNoneZ SiPrefix_from_str(struct LDKStr s);
17641 * Read a Invoice object from a string
17643 struct LDKCResult_InvoiceNoneZ Invoice_from_str(struct LDKStr s);
17646 * Read a SignedRawInvoice object from a string
17648 struct LDKCResult_SignedRawInvoiceNoneZ SignedRawInvoice_from_str(struct LDKStr s);
17651 * Get the string representation of a Invoice object
17653 struct LDKStr Invoice_to_str(const struct LDKInvoice *NONNULL_PTR o);
17656 * Get the string representation of a SignedRawInvoice object
17658 struct LDKStr SignedRawInvoice_to_str(const struct LDKSignedRawInvoice *NONNULL_PTR o);
17661 * Get the string representation of a Currency object
17663 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
17666 * Get the string representation of a SiPrefix object
17668 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
17670 #endif /* LDK_C_BINDINGS_H */
17672 #include <ldk_ver.h>