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. */
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 serialized transaction, in (pointer, length) form.
374 * This type optionally owns its own memory, and thus the semantics around access change based on
375 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
376 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
377 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
378 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
379 * you would be invalid.
381 * Note that, while it may change in the future, because transactions on the Rust side are stored
382 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
383 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
384 * `data_is_owned` either set or unset at your discretion.
386 typedef struct LDKTransaction {
388 * The serialized transaction data.
390 * This is non-const for your convenience, an object passed to Rust is never written to.
394 * The length of the serialized transaction
398 * Whether the data pointed to by `data` should be freed or not.
404 * A dynamically-allocated array of u8s of arbitrary size.
405 * This corresponds to std::vector in C++
407 typedef struct LDKCVec_u8Z {
409 * The elements in the array.
410 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
414 * The number of elements pointed to by `data`.
420 * A transaction output including a scriptPubKey and value.
421 * This type *does* own its own memory, so must be free'd appropriately.
423 typedef struct LDKTxOut {
425 * The script_pubkey in this output
427 struct LDKCVec_u8Z script_pubkey;
429 * The value, in satoshis, of this output
435 * A Rust str object, ie a reference to a UTF8-valid string.
436 * This is *not* null-terminated so cannot be used directly as a C string!
438 typedef struct LDKStr {
440 * A pointer to the string's bytes, in UTF8 encoding
442 const uint8_t *chars;
444 * The number of bytes (not characters!) pointed to by `chars`
448 * Whether the data pointed to by `chars` should be freed or not.
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;
1294 typedef struct MUST_USE_STRUCT LDKSha256 {
1296 * A pointer to the opaque Rust object.
1297 * Nearly everywhere, inner must be non-null, however in places where
1298 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1300 LDKnativeSha256 *inner;
1302 * Indicates that this is the only struct which contains the same pointer.
1303 * Rust functions which take ownership of an object provided via an argument require
1304 * this to be true and invalidate the object pointed to by inner.
1312 * Description string
1315 * The description can be at most 639 __bytes__ long
1317 typedef struct MUST_USE_STRUCT LDKDescription {
1319 * A pointer to the opaque Rust object.
1320 * Nearly everywhere, inner must be non-null, however in places where
1321 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1323 LDKnativeDescription *inner;
1325 * Indicates that this is the only struct which contains the same pointer.
1326 * Rust functions which take ownership of an object provided via an argument require
1327 * this to be true and invalidate the object pointed to by inner.
1337 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
1339 * A pointer to the opaque Rust object.
1340 * Nearly everywhere, inner must be non-null, however in places where
1341 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1343 LDKnativePayeePubKey *inner;
1345 * Indicates that this is the only struct which contains the same pointer.
1346 * Rust functions which take ownership of an object provided via an argument require
1347 * this to be true and invalidate the object pointed to by inner.
1355 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
1359 * The number of seconds this expiry time represents has to be in the range
1360 * `0...(SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME)` to avoid overflows when adding it to a
1363 typedef struct MUST_USE_STRUCT LDKExpiryTime {
1365 * A pointer to the opaque Rust object.
1366 * Nearly everywhere, inner must be non-null, however in places where
1367 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1369 LDKnativeExpiryTime *inner;
1371 * Indicates that this is the only struct which contains the same pointer.
1372 * Rust functions which take ownership of an object provided via an argument require
1373 * this to be true and invalidate the object pointed to by inner.
1381 * `min_final_cltv_expiry` to use for the last HTLC in the route
1383 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiry {
1385 * A pointer to the opaque Rust object.
1386 * Nearly everywhere, inner must be non-null, however in places where
1387 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1389 LDKnativeMinFinalCltvExpiry *inner;
1391 * Indicates that this is the only struct which contains the same pointer.
1392 * Rust functions which take ownership of an object provided via an argument require
1393 * this to be true and invalidate the object pointed to by inner.
1396 } LDKMinFinalCltvExpiry;
1399 * Integer in the range `0..32`
1401 typedef struct LDKu5 {
1406 * A 20-byte byte array.
1408 typedef struct LDKTwentyBytes {
1416 * Fallback address in case no LN payment is possible
1418 typedef enum LDKFallback_Tag {
1419 LDKFallback_SegWitProgram,
1420 LDKFallback_PubKeyHash,
1421 LDKFallback_ScriptHash,
1423 * Must be last for serialization purposes
1425 LDKFallback_Sentinel,
1428 typedef struct LDKFallback_LDKSegWitProgram_Body {
1429 struct LDKu5 version;
1430 struct LDKCVec_u8Z program;
1431 } LDKFallback_LDKSegWitProgram_Body;
1433 typedef struct MUST_USE_STRUCT LDKFallback {
1434 LDKFallback_Tag tag;
1436 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
1438 struct LDKTwentyBytes pub_key_hash;
1441 struct LDKTwentyBytes script_hash;
1449 * Private routing information
1452 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
1455 typedef struct MUST_USE_STRUCT LDKRouteHint {
1457 * A pointer to the opaque Rust object.
1458 * Nearly everywhere, inner must be non-null, however in places where
1459 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1461 LDKnativeRouteHint *inner;
1463 * Indicates that this is the only struct which contains the same pointer.
1464 * Rust functions which take ownership of an object provided via an argument require
1465 * this to be true and invalidate the object pointed to by inner.
1473 * 256-bit payment secret
1475 typedef struct MUST_USE_STRUCT LDKPaymentSecret {
1477 * A pointer to the opaque Rust object.
1478 * Nearly everywhere, inner must be non-null, however in places where
1479 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1481 LDKnativePaymentSecret *inner;
1483 * Indicates that this is the only struct which contains the same pointer.
1484 * Rust functions which take ownership of an object provided via an argument require
1485 * this to be true and invalidate the object pointed to by inner.
1493 * Features used within an invoice.
1495 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
1497 * A pointer to the opaque Rust object.
1498 * Nearly everywhere, inner must be non-null, however in places where
1499 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1501 LDKnativeInvoiceFeatures *inner;
1503 * Indicates that this is the only struct which contains the same pointer.
1504 * Rust functions which take ownership of an object provided via an argument require
1505 * this to be true and invalidate the object pointed to by inner.
1508 } LDKInvoiceFeatures;
1511 * Tagged field with known tag
1513 * For descriptions of the enum values please refer to the enclosed type's docs.
1515 typedef enum LDKTaggedField_Tag {
1516 LDKTaggedField_PaymentHash,
1517 LDKTaggedField_Description,
1518 LDKTaggedField_PayeePubKey,
1519 LDKTaggedField_DescriptionHash,
1520 LDKTaggedField_ExpiryTime,
1521 LDKTaggedField_MinFinalCltvExpiry,
1522 LDKTaggedField_Fallback,
1523 LDKTaggedField_Route,
1524 LDKTaggedField_PaymentSecret,
1525 LDKTaggedField_Features,
1527 * Must be last for serialization purposes
1529 LDKTaggedField_Sentinel,
1530 } LDKTaggedField_Tag;
1532 typedef struct MUST_USE_STRUCT LDKTaggedField {
1533 LDKTaggedField_Tag tag;
1536 struct LDKSha256 payment_hash;
1539 struct LDKDescription description;
1542 struct LDKPayeePubKey payee_pub_key;
1545 struct LDKSha256 description_hash;
1548 struct LDKExpiryTime expiry_time;
1551 struct LDKMinFinalCltvExpiry min_final_cltv_expiry;
1554 struct LDKFallback fallback;
1557 struct LDKRouteHint route;
1560 struct LDKPaymentSecret payment_secret;
1563 struct LDKInvoiceFeatures features;
1569 * A dynamically-allocated array of crate::c_types::u5s of arbitrary size.
1570 * This corresponds to std::vector in C++
1572 typedef struct LDKCVec_u5Z {
1574 * The elements in the array.
1575 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1579 * The number of elements pointed to by `data`.
1585 * Tagged field which may have an unknown tag
1587 typedef enum LDKRawTaggedField_Tag {
1589 * Parsed tagged field with known tag
1591 LDKRawTaggedField_KnownSemantics,
1593 * tagged field which was not parsed due to an unknown tag or undefined field semantics
1595 LDKRawTaggedField_UnknownSemantics,
1597 * Must be last for serialization purposes
1599 LDKRawTaggedField_Sentinel,
1600 } LDKRawTaggedField_Tag;
1602 typedef struct MUST_USE_STRUCT LDKRawTaggedField {
1603 LDKRawTaggedField_Tag tag;
1606 struct LDKTaggedField known_semantics;
1609 struct LDKCVec_u5Z unknown_semantics;
1612 } LDKRawTaggedField;
1615 * A dynamically-allocated array of crate::lightning_invoice::RawTaggedFields of arbitrary size.
1616 * This corresponds to std::vector in C++
1618 typedef struct LDKCVec_RawTaggedFieldZ {
1620 * The elements in the array.
1621 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1623 struct LDKRawTaggedField *data;
1625 * The number of elements pointed to by `data`.
1628 } LDKCVec_RawTaggedFieldZ;
1633 * Represents an syntactically correct Invoice for a payment on the lightning network,
1634 * but without the signature information.
1635 * De- and encoding should not lead to information loss but may lead to different hashes.
1637 * For methods without docs see the corresponding methods in `Invoice`.
1639 typedef struct MUST_USE_STRUCT LDKRawInvoice {
1641 * A pointer to the opaque Rust object.
1642 * Nearly everywhere, inner must be non-null, however in places where
1643 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1645 LDKnativeRawInvoice *inner;
1647 * Indicates that this is the only struct which contains the same pointer.
1648 * Rust functions which take ownership of an object provided via an argument require
1649 * this to be true and invalidate the object pointed to by inner.
1655 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
1656 * look up the corresponding function in rust-lightning's docs.
1658 typedef struct LDKThirtyTwoBytes {
1660 * The thirty-two bytes
1663 } LDKThirtyTwoBytes;
1668 * Recoverable signature
1670 typedef struct MUST_USE_STRUCT LDKInvoiceSignature {
1672 * A pointer to the opaque Rust object.
1673 * Nearly everywhere, inner must be non-null, however in places where
1674 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1676 LDKnativeInvoiceSignature *inner;
1678 * Indicates that this is the only struct which contains the same pointer.
1679 * Rust functions which take ownership of an object provided via an argument require
1680 * this to be true and invalidate the object pointed to by inner.
1683 } LDKInvoiceSignature;
1686 * A tuple of 3 elements. See the individual fields for the types contained.
1688 typedef struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ {
1690 * The element at position 0
1692 struct LDKRawInvoice a;
1694 * The element at position 1
1696 struct LDKThirtyTwoBytes b;
1698 * The element at position 2
1700 struct LDKInvoiceSignature c;
1701 } LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ;
1704 * The contents of CResult_PayeePubKeyErrorZ
1706 typedef union LDKCResult_PayeePubKeyErrorZPtr {
1708 * A pointer to the contents in the success state.
1709 * Reading from this pointer when `result_ok` is not set is undefined.
1711 struct LDKPayeePubKey *result;
1713 * A pointer to the contents in the error state.
1714 * Reading from this pointer when `result_ok` is set is undefined.
1716 enum LDKSecp256k1Error *err;
1717 } LDKCResult_PayeePubKeyErrorZPtr;
1720 * A CResult_PayeePubKeyErrorZ represents the result of a fallible operation,
1721 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
1722 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1724 typedef struct LDKCResult_PayeePubKeyErrorZ {
1726 * The contents of this CResult_PayeePubKeyErrorZ, accessible via either
1727 * `err` or `result` depending on the state of `result_ok`.
1729 union LDKCResult_PayeePubKeyErrorZPtr contents;
1731 * Whether this CResult_PayeePubKeyErrorZ represents a success state.
1734 } LDKCResult_PayeePubKeyErrorZ;
1737 * A dynamically-allocated array of crate::lightning_invoice::RouteHints of arbitrary size.
1738 * This corresponds to std::vector in C++
1740 typedef struct LDKCVec_RouteHintZ {
1742 * The elements in the array.
1743 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1745 struct LDKRouteHint *data;
1747 * The number of elements pointed to by `data`.
1750 } LDKCVec_RouteHintZ;
1753 * An enum which can either contain a u64 or not
1755 typedef enum LDKCOption_u64Z_Tag {
1757 * When we're in this state, this COption_u64Z contains a u64
1759 LDKCOption_u64Z_Some,
1761 * When we're in this state, this COption_u64Z contains nothing
1763 LDKCOption_u64Z_None,
1765 * Must be last for serialization purposes
1767 LDKCOption_u64Z_Sentinel,
1768 } LDKCOption_u64Z_Tag;
1770 typedef struct LDKCOption_u64Z {
1771 LDKCOption_u64Z_Tag tag;
1782 * A timestamp that refers to a date after 1 January 1970 which means its representation as UNIX
1783 * timestamp is positive.
1786 * The UNIX timestamp representing the stored time has to be positive and small enough so that
1787 * a `EpiryTime` can be added to it without an overflow.
1789 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
1791 * A pointer to the opaque Rust object.
1792 * Nearly everywhere, inner must be non-null, however in places where
1793 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1795 LDKnativePositiveTimestamp *inner;
1797 * Indicates that this is the only struct which contains the same pointer.
1798 * Rust functions which take ownership of an object provided via an argument require
1799 * this to be true and invalidate the object pointed to by inner.
1802 } LDKPositiveTimestamp;
1805 * The contents of CResult_PositiveTimestampCreationErrorZ
1807 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
1809 * A pointer to the contents in the success state.
1810 * Reading from this pointer when `result_ok` is not set is undefined.
1812 struct LDKPositiveTimestamp *result;
1814 * A pointer to the contents in the error state.
1815 * Reading from this pointer when `result_ok` is set is undefined.
1817 enum LDKCreationError *err;
1818 } LDKCResult_PositiveTimestampCreationErrorZPtr;
1821 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
1822 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
1823 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1825 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
1827 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
1828 * `err` or `result` depending on the state of `result_ok`.
1830 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
1832 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
1835 } LDKCResult_PositiveTimestampCreationErrorZ;
1838 * The contents of CResult_NoneSemanticErrorZ
1840 typedef union LDKCResult_NoneSemanticErrorZPtr {
1842 * Note that this value is always NULL, as there are no contents in the OK variant
1846 * A pointer to the contents in the error state.
1847 * Reading from this pointer when `result_ok` is set is undefined.
1849 enum LDKSemanticError *err;
1850 } LDKCResult_NoneSemanticErrorZPtr;
1853 * A CResult_NoneSemanticErrorZ represents the result of a fallible operation,
1854 * containing a () on success and a crate::lightning_invoice::SemanticError on failure.
1855 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1857 typedef struct LDKCResult_NoneSemanticErrorZ {
1859 * The contents of this CResult_NoneSemanticErrorZ, accessible via either
1860 * `err` or `result` depending on the state of `result_ok`.
1862 union LDKCResult_NoneSemanticErrorZPtr contents;
1864 * Whether this CResult_NoneSemanticErrorZ represents a success state.
1867 } LDKCResult_NoneSemanticErrorZ;
1872 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
1874 * There are three ways to construct an `Invoice`:
1875 * 1. using `InvoiceBuilder`
1876 * 2. using `Invoice::from_signed(SignedRawInvoice)`
1877 * 3. using `str::parse::<Invoice>(&str)`
1879 typedef struct MUST_USE_STRUCT LDKInvoice {
1881 * A pointer to the opaque Rust object.
1882 * Nearly everywhere, inner must be non-null, however in places where
1883 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1885 LDKnativeInvoice *inner;
1887 * Indicates that this is the only struct which contains the same pointer.
1888 * Rust functions which take ownership of an object provided via an argument require
1889 * this to be true and invalidate the object pointed to by inner.
1895 * The contents of CResult_InvoiceSemanticErrorZ
1897 typedef union LDKCResult_InvoiceSemanticErrorZPtr {
1899 * A pointer to the contents in the success state.
1900 * Reading from this pointer when `result_ok` is not set is undefined.
1902 struct LDKInvoice *result;
1904 * A pointer to the contents in the error state.
1905 * Reading from this pointer when `result_ok` is set is undefined.
1907 enum LDKSemanticError *err;
1908 } LDKCResult_InvoiceSemanticErrorZPtr;
1911 * A CResult_InvoiceSemanticErrorZ represents the result of a fallible operation,
1912 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SemanticError on failure.
1913 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1915 typedef struct LDKCResult_InvoiceSemanticErrorZ {
1917 * The contents of this CResult_InvoiceSemanticErrorZ, accessible via either
1918 * `err` or `result` depending on the state of `result_ok`.
1920 union LDKCResult_InvoiceSemanticErrorZPtr contents;
1922 * Whether this CResult_InvoiceSemanticErrorZ represents a success state.
1925 } LDKCResult_InvoiceSemanticErrorZ;
1928 * The contents of CResult_DescriptionCreationErrorZ
1930 typedef union LDKCResult_DescriptionCreationErrorZPtr {
1932 * A pointer to the contents in the success state.
1933 * Reading from this pointer when `result_ok` is not set is undefined.
1935 struct LDKDescription *result;
1937 * A pointer to the contents in the error state.
1938 * Reading from this pointer when `result_ok` is set is undefined.
1940 enum LDKCreationError *err;
1941 } LDKCResult_DescriptionCreationErrorZPtr;
1944 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
1945 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
1946 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1948 typedef struct LDKCResult_DescriptionCreationErrorZ {
1950 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
1951 * `err` or `result` depending on the state of `result_ok`.
1953 union LDKCResult_DescriptionCreationErrorZPtr contents;
1955 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
1958 } LDKCResult_DescriptionCreationErrorZ;
1961 * The contents of CResult_ExpiryTimeCreationErrorZ
1963 typedef union LDKCResult_ExpiryTimeCreationErrorZPtr {
1965 * A pointer to the contents in the success state.
1966 * Reading from this pointer when `result_ok` is not set is undefined.
1968 struct LDKExpiryTime *result;
1970 * A pointer to the contents in the error state.
1971 * Reading from this pointer when `result_ok` is set is undefined.
1973 enum LDKCreationError *err;
1974 } LDKCResult_ExpiryTimeCreationErrorZPtr;
1977 * A CResult_ExpiryTimeCreationErrorZ represents the result of a fallible operation,
1978 * containing a crate::lightning_invoice::ExpiryTime on success and a crate::lightning_invoice::CreationError on failure.
1979 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1981 typedef struct LDKCResult_ExpiryTimeCreationErrorZ {
1983 * The contents of this CResult_ExpiryTimeCreationErrorZ, accessible via either
1984 * `err` or `result` depending on the state of `result_ok`.
1986 union LDKCResult_ExpiryTimeCreationErrorZPtr contents;
1988 * Whether this CResult_ExpiryTimeCreationErrorZ represents a success state.
1991 } LDKCResult_ExpiryTimeCreationErrorZ;
1996 * A channel descriptor which provides a last-hop route to get_route
1998 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
2000 * A pointer to the opaque Rust object.
2001 * Nearly everywhere, inner must be non-null, however in places where
2002 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2004 LDKnativeRouteHintHop *inner;
2006 * Indicates that this is the only struct which contains the same pointer.
2007 * Rust functions which take ownership of an object provided via an argument require
2008 * this to be true and invalidate the object pointed to by inner.
2014 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
2015 * This corresponds to std::vector in C++
2017 typedef struct LDKCVec_RouteHintHopZ {
2019 * The elements in the array.
2020 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2022 struct LDKRouteHintHop *data;
2024 * The number of elements pointed to by `data`.
2027 } LDKCVec_RouteHintHopZ;
2030 * The contents of CResult_RouteHintCreationErrorZ
2032 typedef union LDKCResult_RouteHintCreationErrorZPtr {
2034 * A pointer to the contents in the success state.
2035 * Reading from this pointer when `result_ok` is not set is undefined.
2037 struct LDKRouteHint *result;
2039 * A pointer to the contents in the error state.
2040 * Reading from this pointer when `result_ok` is set is undefined.
2042 enum LDKCreationError *err;
2043 } LDKCResult_RouteHintCreationErrorZPtr;
2046 * A CResult_RouteHintCreationErrorZ represents the result of a fallible operation,
2047 * containing a crate::lightning_invoice::RouteHint on success and a crate::lightning_invoice::CreationError on failure.
2048 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2050 typedef struct LDKCResult_RouteHintCreationErrorZ {
2052 * The contents of this CResult_RouteHintCreationErrorZ, accessible via either
2053 * `err` or `result` depending on the state of `result_ok`.
2055 union LDKCResult_RouteHintCreationErrorZPtr contents;
2057 * Whether this CResult_RouteHintCreationErrorZ represents a success state.
2060 } LDKCResult_RouteHintCreationErrorZ;
2063 * The contents of CResult_StringErrorZ
2065 typedef union LDKCResult_StringErrorZPtr {
2067 * A pointer to the contents in the success state.
2068 * Reading from this pointer when `result_ok` is not set is undefined.
2070 struct LDKCVec_u8Z *result;
2072 * A pointer to the contents in the error state.
2073 * Reading from this pointer when `result_ok` is set is undefined.
2075 enum LDKSecp256k1Error *err;
2076 } LDKCResult_StringErrorZPtr;
2079 * A CResult_StringErrorZ represents the result of a fallible operation,
2080 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::c_types::Secp256k1Error on failure.
2081 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2083 typedef struct LDKCResult_StringErrorZ {
2085 * The contents of this CResult_StringErrorZ, accessible via either
2086 * `err` or `result` depending on the state of `result_ok`.
2088 union LDKCResult_StringErrorZPtr contents;
2090 * Whether this CResult_StringErrorZ represents a success state.
2093 } LDKCResult_StringErrorZ;
2098 * An update generated by the underlying Channel itself which contains some new information the
2099 * ChannelMonitor should be made aware of.
2101 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
2103 * A pointer to the opaque Rust object.
2104 * Nearly everywhere, inner must be non-null, however in places where
2105 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2107 LDKnativeChannelMonitorUpdate *inner;
2109 * Indicates that this is the only struct which contains the same pointer.
2110 * Rust functions which take ownership of an object provided via an argument require
2111 * this to be true and invalidate the object pointed to by inner.
2114 } LDKChannelMonitorUpdate;
2117 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
2119 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
2121 * A pointer to the contents in the success state.
2122 * Reading from this pointer when `result_ok` is not set is undefined.
2124 struct LDKChannelMonitorUpdate *result;
2126 * A pointer to the contents in the error state.
2127 * Reading from this pointer when `result_ok` is set is undefined.
2129 struct LDKDecodeError *err;
2130 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
2133 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
2134 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
2135 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2137 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
2139 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
2140 * `err` or `result` depending on the state of `result_ok`.
2142 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
2144 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
2147 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
2152 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
2153 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
2154 * preimage claim backward will lead to loss of funds.
2156 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
2158 * A pointer to the opaque Rust object.
2159 * Nearly everywhere, inner must be non-null, however in places where
2160 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2162 LDKnativeHTLCUpdate *inner;
2164 * Indicates that this is the only struct which contains the same pointer.
2165 * Rust functions which take ownership of an object provided via an argument require
2166 * this to be true and invalidate the object pointed to by inner.
2172 * The contents of CResult_HTLCUpdateDecodeErrorZ
2174 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
2176 * A pointer to the contents in the success state.
2177 * Reading from this pointer when `result_ok` is not set is undefined.
2179 struct LDKHTLCUpdate *result;
2181 * A pointer to the contents in the error state.
2182 * Reading from this pointer when `result_ok` is set is undefined.
2184 struct LDKDecodeError *err;
2185 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
2188 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
2189 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
2190 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2192 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
2194 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
2195 * `err` or `result` depending on the state of `result_ok`.
2197 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
2199 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
2202 } LDKCResult_HTLCUpdateDecodeErrorZ;
2207 * General Err type for ChannelMonitor actions. Generally, this implies that the data provided is
2208 * inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this
2209 * means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was
2211 * Contains a developer-readable error message.
2213 typedef struct MUST_USE_STRUCT LDKMonitorUpdateError {
2215 * A pointer to the opaque Rust object.
2216 * Nearly everywhere, inner must be non-null, however in places where
2217 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2219 LDKnativeMonitorUpdateError *inner;
2221 * Indicates that this is the only struct which contains the same pointer.
2222 * Rust functions which take ownership of an object provided via an argument require
2223 * this to be true and invalidate the object pointed to by inner.
2226 } LDKMonitorUpdateError;
2229 * The contents of CResult_NoneMonitorUpdateErrorZ
2231 typedef union LDKCResult_NoneMonitorUpdateErrorZPtr {
2233 * Note that this value is always NULL, as there are no contents in the OK variant
2237 * A pointer to the contents in the error state.
2238 * Reading from this pointer when `result_ok` is set is undefined.
2240 struct LDKMonitorUpdateError *err;
2241 } LDKCResult_NoneMonitorUpdateErrorZPtr;
2244 * A CResult_NoneMonitorUpdateErrorZ represents the result of a fallible operation,
2245 * containing a () on success and a crate::lightning::chain::channelmonitor::MonitorUpdateError on failure.
2246 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2248 typedef struct LDKCResult_NoneMonitorUpdateErrorZ {
2250 * The contents of this CResult_NoneMonitorUpdateErrorZ, accessible via either
2251 * `err` or `result` depending on the state of `result_ok`.
2253 union LDKCResult_NoneMonitorUpdateErrorZPtr contents;
2255 * Whether this CResult_NoneMonitorUpdateErrorZ represents a success state.
2258 } LDKCResult_NoneMonitorUpdateErrorZ;
2261 * A tuple of 2 elements. See the individual fields for the types contained.
2263 typedef struct LDKC2Tuple_OutPointScriptZ {
2265 * The element at position 0
2267 struct LDKOutPoint a;
2269 * The element at position 1
2271 struct LDKCVec_u8Z b;
2272 } LDKC2Tuple_OutPointScriptZ;
2275 * A tuple of 2 elements. See the individual fields for the types contained.
2277 typedef struct LDKC2Tuple_u32ScriptZ {
2279 * The element at position 0
2283 * The element at position 1
2285 struct LDKCVec_u8Z b;
2286 } LDKC2Tuple_u32ScriptZ;
2289 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
2290 * This corresponds to std::vector in C++
2292 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
2294 * The elements in the array.
2295 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2297 struct LDKC2Tuple_u32ScriptZ *data;
2299 * The number of elements pointed to by `data`.
2302 } LDKCVec_C2Tuple_u32ScriptZZ;
2305 * A tuple of 2 elements. See the individual fields for the types contained.
2307 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
2309 * The element at position 0
2311 struct LDKThirtyTwoBytes a;
2313 * The element at position 1
2315 struct LDKCVec_C2Tuple_u32ScriptZZ b;
2316 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
2319 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
2320 * This corresponds to std::vector in C++
2322 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
2324 * The elements in the array.
2325 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2327 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
2329 * The number of elements pointed to by `data`.
2332 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
2335 * An event to be processed by the ChannelManager.
2337 typedef enum LDKMonitorEvent_Tag {
2339 * A monitor event containing an HTLCUpdate.
2341 LDKMonitorEvent_HTLCEvent,
2343 * A monitor event that the Channel's commitment transaction was broadcasted.
2345 LDKMonitorEvent_CommitmentTxBroadcasted,
2347 * Must be last for serialization purposes
2349 LDKMonitorEvent_Sentinel,
2350 } LDKMonitorEvent_Tag;
2352 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
2353 LDKMonitorEvent_Tag tag;
2356 struct LDKHTLCUpdate htlc_event;
2359 struct LDKOutPoint commitment_tx_broadcasted;
2365 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
2366 * This corresponds to std::vector in C++
2368 typedef struct LDKCVec_MonitorEventZ {
2370 * The elements in the array.
2371 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2373 struct LDKMonitorEvent *data;
2375 * The number of elements pointed to by `data`.
2378 } LDKCVec_MonitorEventZ;
2383 * Information about a spendable output to a P2WSH script. See
2384 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
2386 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
2388 * A pointer to the opaque Rust object.
2389 * Nearly everywhere, inner must be non-null, however in places where
2390 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2392 LDKnativeDelayedPaymentOutputDescriptor *inner;
2394 * Indicates that this is the only struct which contains the same pointer.
2395 * Rust functions which take ownership of an object provided via an argument require
2396 * this to be true and invalidate the object pointed to by inner.
2399 } LDKDelayedPaymentOutputDescriptor;
2404 * Information about a spendable output to our \"payment key\". See
2405 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
2407 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
2409 * A pointer to the opaque Rust object.
2410 * Nearly everywhere, inner must be non-null, however in places where
2411 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2413 LDKnativeStaticPaymentOutputDescriptor *inner;
2415 * Indicates that this is the only struct which contains the same pointer.
2416 * Rust functions which take ownership of an object provided via an argument require
2417 * this to be true and invalidate the object pointed to by inner.
2420 } LDKStaticPaymentOutputDescriptor;
2423 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
2424 * claim at any point in the future) an event is generated which you must track and be able to
2425 * spend on-chain. The information needed to do this is provided in this enum, including the
2426 * outpoint describing which txid and output index is available, the full output which exists at
2427 * that txid/index, and any keys or other information required to sign.
2429 typedef enum LDKSpendableOutputDescriptor_Tag {
2431 * An output to a script which was provided via KeysInterface directly, either from
2432 * `get_destination_script()` or `get_shutdown_pubkey()`, thus you should already know how to
2433 * spend it. No secret keys are provided as rust-lightning was never given any key.
2434 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
2435 * on-chain using the payment preimage or after it has timed out.
2437 LDKSpendableOutputDescriptor_StaticOutput,
2439 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
2441 * The witness in the spending input should be:
2442 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
2444 * Note that the nSequence field in the spending input must be set to to_self_delay
2445 * (which means the transaction is not broadcastable until at least to_self_delay
2446 * blocks after the outpoint confirms).
2448 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
2449 * it is an output from an old state which we broadcast (which should never happen).
2451 * To derive the delayed_payment key which is used to sign for this input, you must pass the
2452 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
2453 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
2454 * chan_utils::derive_private_key. The public key can be generated without the secret key
2455 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
2458 * To derive the revocation_pubkey provided here (which is used in the witness
2459 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
2460 * call to Sign::ready_channel) and the provided per_commitment point
2461 * to chan_utils::derive_public_revocation_key.
2463 * The witness script which is hashed and included in the output script_pubkey may be
2464 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
2465 * (derived as above), and the to_self_delay contained here to
2466 * chan_utils::get_revokeable_redeemscript.
2468 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
2470 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
2471 * corresponds to the public key in Sign::pubkeys().payment_point).
2472 * The witness in the spending input, is, thus, simply:
2473 * <BIP 143 signature> <payment key>
2475 * These are generally the result of our counterparty having broadcast the current state,
2476 * allowing us to claim the non-HTLC-encumbered outputs immediately.
2478 LDKSpendableOutputDescriptor_StaticPaymentOutput,
2480 * Must be last for serialization purposes
2482 LDKSpendableOutputDescriptor_Sentinel,
2483 } LDKSpendableOutputDescriptor_Tag;
2485 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
2487 * The outpoint which is spendable
2489 struct LDKOutPoint outpoint;
2491 * The output which is referenced by the given outpoint.
2493 struct LDKTxOut output;
2494 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
2496 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
2497 LDKSpendableOutputDescriptor_Tag tag;
2499 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
2501 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
2504 struct LDKStaticPaymentOutputDescriptor static_payment_output;
2507 } LDKSpendableOutputDescriptor;
2510 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
2511 * This corresponds to std::vector in C++
2513 typedef struct LDKCVec_SpendableOutputDescriptorZ {
2515 * The elements in the array.
2516 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2518 struct LDKSpendableOutputDescriptor *data;
2520 * The number of elements pointed to by `data`.
2523 } LDKCVec_SpendableOutputDescriptorZ;
2526 * An Event which you should probably take some action in response to.
2528 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
2529 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
2530 * written as it makes no sense to respond to it after reconnecting to peers).
2532 typedef enum LDKEvent_Tag {
2534 * Used to indicate that the client should generate a funding transaction with the given
2535 * parameters and then call ChannelManager::funding_transaction_generated.
2536 * Generated in ChannelManager message handling.
2537 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
2538 * counterparty can steal your funds!
2540 LDKEvent_FundingGenerationReady,
2542 * Indicates we've received money! Just gotta dig out that payment preimage and feed it to
2543 * ChannelManager::claim_funds to get it....
2544 * Note that if the preimage is not known or the amount paid is incorrect, you should call
2545 * ChannelManager::fail_htlc_backwards to free up resources for this HTLC and avoid
2546 * network congestion.
2547 * The amount paid should be considered 'incorrect' when it is less than or more than twice
2548 * the amount expected.
2549 * If you fail to call either ChannelManager::claim_funds or
2550 * ChannelManager::fail_htlc_backwards within the HTLC's timeout, the HTLC will be
2551 * automatically failed.
2553 LDKEvent_PaymentReceived,
2555 * Indicates an outbound payment we made succeeded (ie it made it all the way to its target
2556 * and we got back the payment preimage for it).
2557 * Note that duplicative PaymentSent Events may be generated - it is your responsibility to
2558 * deduplicate them by payment_preimage (which MUST be unique)!
2560 LDKEvent_PaymentSent,
2562 * Indicates an outbound payment we made failed. Probably some intermediary node dropped
2563 * something. You may wish to retry with a different route.
2564 * Note that duplicative PaymentFailed Events may be generated - it is your responsibility to
2565 * deduplicate them by payment_hash (which MUST be unique)!
2567 LDKEvent_PaymentFailed,
2569 * Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
2570 * time in the future.
2572 LDKEvent_PendingHTLCsForwardable,
2574 * Used to indicate that an output was generated on-chain which you should know how to spend.
2575 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
2576 * counterparty spending them due to some kind of timeout. Thus, you need to store them
2577 * somewhere and spend them when you create on-chain transactions.
2579 LDKEvent_SpendableOutputs,
2581 * Must be last for serialization purposes
2586 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
2588 * The random channel_id we picked which you'll need to pass into
2589 * ChannelManager::funding_transaction_generated.
2591 struct LDKThirtyTwoBytes temporary_channel_id;
2593 * The value, in satoshis, that the output should have.
2595 uint64_t channel_value_satoshis;
2597 * The script which should be used in the transaction output.
2599 struct LDKCVec_u8Z output_script;
2601 * The value passed in to ChannelManager::create_channel
2603 uint64_t user_channel_id;
2604 } LDKEvent_LDKFundingGenerationReady_Body;
2606 typedef struct LDKEvent_LDKPaymentReceived_Body {
2608 * The hash for which the preimage should be handed to the ChannelManager.
2610 struct LDKThirtyTwoBytes payment_hash;
2612 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
2613 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
2614 * [`ChannelManager::claim_funds`].
2616 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2617 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2619 struct LDKThirtyTwoBytes payment_preimage;
2621 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
2622 * number of deanonymization attacks during the routing process.
2623 * It is provided here for your reference, however its accuracy is enforced directly by
2624 * [`ChannelManager`] using the values you previously provided to
2625 * [`ChannelManager::create_inbound_payment`] or
2626 * [`ChannelManager::create_inbound_payment_for_hash`].
2628 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2629 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2630 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
2632 struct LDKThirtyTwoBytes payment_secret;
2634 * The value, in thousandths of a satoshi, that this payment is for. Note that you must
2635 * compare this to the expected value before accepting the payment (as otherwise you are
2636 * providing proof-of-payment for less than the value you expected!).
2640 * This is the `user_payment_id` which was provided to
2641 * [`ChannelManager::create_inbound_payment_for_hash`] or
2642 * [`ChannelManager::create_inbound_payment`]. It has no meaning inside of LDK and is
2643 * simply copied here. It may be used to correlate PaymentReceived events with invoice
2644 * metadata stored elsewhere.
2646 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2647 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
2649 uint64_t user_payment_id;
2650 } LDKEvent_LDKPaymentReceived_Body;
2652 typedef struct LDKEvent_LDKPaymentSent_Body {
2654 * The preimage to the hash given to ChannelManager::send_payment.
2655 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
2658 struct LDKThirtyTwoBytes payment_preimage;
2659 } LDKEvent_LDKPaymentSent_Body;
2661 typedef struct LDKEvent_LDKPaymentFailed_Body {
2663 * The hash which was given to ChannelManager::send_payment.
2665 struct LDKThirtyTwoBytes payment_hash;
2667 * Indicates the payment was rejected for some reason by the recipient. This implies that
2668 * the payment has failed, not just the route in question. If this is not set, you may
2669 * retry the payment via a different route.
2671 bool rejected_by_dest;
2672 } LDKEvent_LDKPaymentFailed_Body;
2674 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
2676 * The minimum amount of time that should be waited prior to calling
2677 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
2678 * you should wait a random amount of time in roughly the range (now + time_forwardable,
2679 * now + 5*time_forwardable).
2681 uint64_t time_forwardable;
2682 } LDKEvent_LDKPendingHTLCsForwardable_Body;
2684 typedef struct LDKEvent_LDKSpendableOutputs_Body {
2686 * The outputs which you should store as spendable by you.
2688 struct LDKCVec_SpendableOutputDescriptorZ outputs;
2689 } LDKEvent_LDKSpendableOutputs_Body;
2691 typedef struct MUST_USE_STRUCT LDKEvent {
2694 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
2695 LDKEvent_LDKPaymentReceived_Body payment_received;
2696 LDKEvent_LDKPaymentSent_Body payment_sent;
2697 LDKEvent_LDKPaymentFailed_Body payment_failed;
2698 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
2699 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
2704 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
2705 * This corresponds to std::vector in C++
2707 typedef struct LDKCVec_EventZ {
2709 * The elements in the array.
2710 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2712 struct LDKEvent *data;
2714 * The number of elements pointed to by `data`.
2720 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
2721 * This corresponds to std::vector in C++
2723 typedef struct LDKCVec_TransactionZ {
2725 * The elements in the array.
2726 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2728 struct LDKTransaction *data;
2730 * The number of elements pointed to by `data`.
2733 } LDKCVec_TransactionZ;
2736 * A tuple of 2 elements. See the individual fields for the types contained.
2738 typedef struct LDKC2Tuple_usizeTransactionZ {
2740 * The element at position 0
2744 * The element at position 1
2746 struct LDKTransaction b;
2747 } LDKC2Tuple_usizeTransactionZ;
2750 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
2751 * This corresponds to std::vector in C++
2753 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
2755 * The elements in the array.
2756 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2758 struct LDKC2Tuple_usizeTransactionZ *data;
2760 * The number of elements pointed to by `data`.
2763 } LDKCVec_C2Tuple_usizeTransactionZZ;
2766 * A tuple of 2 elements. See the individual fields for the types contained.
2768 typedef struct LDKC2Tuple_u32TxOutZ {
2770 * The element at position 0
2774 * The element at position 1
2777 } LDKC2Tuple_u32TxOutZ;
2780 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
2781 * This corresponds to std::vector in C++
2783 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
2785 * The elements in the array.
2786 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2788 struct LDKC2Tuple_u32TxOutZ *data;
2790 * The number of elements pointed to by `data`.
2793 } LDKCVec_C2Tuple_u32TxOutZZ;
2796 * A tuple of 2 elements. See the individual fields for the types contained.
2798 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
2800 * The element at position 0
2802 struct LDKThirtyTwoBytes a;
2804 * The element at position 1
2806 struct LDKCVec_C2Tuple_u32TxOutZZ b;
2807 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
2810 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
2811 * This corresponds to std::vector in C++
2813 typedef struct LDKCVec_TransactionOutputsZ {
2815 * The elements in the array.
2816 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2818 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
2820 * The number of elements pointed to by `data`.
2823 } LDKCVec_TransactionOutputsZ;
2826 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
2827 * This corresponds to std::vector in C++
2829 typedef struct LDKCVec_TxidZ {
2831 * The elements in the array.
2832 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2834 struct LDKThirtyTwoBytes *data;
2836 * The number of elements pointed to by `data`.
2842 * The contents of CResult_NoneChannelMonitorUpdateErrZ
2844 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
2846 * Note that this value is always NULL, as there are no contents in the OK variant
2850 * A pointer to the contents in the error state.
2851 * Reading from this pointer when `result_ok` is set is undefined.
2853 enum LDKChannelMonitorUpdateErr *err;
2854 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
2857 * A CResult_NoneChannelMonitorUpdateErrZ represents the result of a fallible operation,
2858 * containing a () on success and a crate::lightning::chain::channelmonitor::ChannelMonitorUpdateErr on failure.
2859 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2861 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
2863 * The contents of this CResult_NoneChannelMonitorUpdateErrZ, accessible via either
2864 * `err` or `result` depending on the state of `result_ok`.
2866 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
2868 * Whether this CResult_NoneChannelMonitorUpdateErrZ represents a success state.
2871 } LDKCResult_NoneChannelMonitorUpdateErrZ;
2874 * A tuple of 2 elements. See the individual fields for the types contained.
2876 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
2878 * The element at position 0
2880 struct LDKSignature a;
2882 * The element at position 1
2884 struct LDKCVec_SignatureZ b;
2885 } LDKC2Tuple_SignatureCVec_SignatureZZ;
2888 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
2890 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
2892 * A pointer to the contents in the success state.
2893 * Reading from this pointer when `result_ok` is not set is undefined.
2895 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
2897 * Note that this value is always NULL, as there are no contents in the Err variant
2900 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
2903 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
2904 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
2905 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2907 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
2909 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
2910 * `err` or `result` depending on the state of `result_ok`.
2912 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
2914 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
2917 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
2920 * The contents of CResult_SignatureNoneZ
2922 typedef union LDKCResult_SignatureNoneZPtr {
2924 * A pointer to the contents in the success state.
2925 * Reading from this pointer when `result_ok` is not set is undefined.
2927 struct LDKSignature *result;
2929 * Note that this value is always NULL, as there are no contents in the Err variant
2932 } LDKCResult_SignatureNoneZPtr;
2935 * A CResult_SignatureNoneZ represents the result of a fallible operation,
2936 * containing a crate::c_types::Signature on success and a () on failure.
2937 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2939 typedef struct LDKCResult_SignatureNoneZ {
2941 * The contents of this CResult_SignatureNoneZ, accessible via either
2942 * `err` or `result` depending on the state of `result_ok`.
2944 union LDKCResult_SignatureNoneZPtr contents;
2946 * Whether this CResult_SignatureNoneZ represents a success state.
2949 } LDKCResult_SignatureNoneZ;
2954 * The unsigned part of a channel_announcement
2956 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
2958 * A pointer to the opaque Rust object.
2959 * Nearly everywhere, inner must be non-null, however in places where
2960 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2962 LDKnativeUnsignedChannelAnnouncement *inner;
2964 * Indicates that this is the only struct which contains the same pointer.
2965 * Rust functions which take ownership of an object provided via an argument require
2966 * this to be true and invalidate the object pointed to by inner.
2969 } LDKUnsignedChannelAnnouncement;
2972 * A trait to sign lightning channel transactions as described in BOLT 3.
2974 * Signing services could be implemented on a hardware wallet. In this case,
2975 * the current Sign would be a front-end on top of a communication
2976 * channel connected to your secure device and lightning key material wouldn't
2977 * reside on a hot server. Nevertheless, a this deployment would still need
2978 * to trust the ChannelManager to avoid loss of funds as this latest component
2979 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
2981 * A more secure iteration would be to use hashlock (or payment points) to pair
2982 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
2983 * at the price of more state and computation on the hardware wallet side. In the future,
2984 * we are looking forward to design such interface.
2986 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
2987 * to act, as liveness and breach reply correctness are always going to be hard requirements
2988 * of LN security model, orthogonal of key management issues.
2990 typedef struct LDKBaseSign {
2992 * An opaque pointer which is passed to your function implementations as an argument.
2993 * This has no meaning in the LDK, and can be NULL or any other value.
2997 * Gets the per-commitment point for a specific commitment number
2999 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
3001 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
3003 * Gets the commitment secret for a specific commitment number as part of the revocation process
3005 * An external signer implementation should error here if the commitment was already signed
3006 * and should refuse to sign it in the future.
3008 * May be called more than once for the same index.
3010 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
3012 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
3014 * Gets the holder's channel public keys and basepoints
3016 struct LDKChannelPublicKeys pubkeys;
3018 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
3019 * Note that this takes a pointer to this object, not the this_ptr like other methods do
3020 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
3022 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
3024 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
3025 * some SpendableOutputDescriptor types. This should be sufficient to identify this
3026 * Sign object uniquely and lookup or re-derive its keys.
3028 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
3030 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
3032 * Note that if signing fails or is rejected, the channel will be force-closed.
3034 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx);
3036 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
3037 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
3038 * latest commitment_tx when we initiate a force-close.
3039 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
3040 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
3042 * This may be called multiple times for the same transaction.
3044 * An external signer implementation should check that the commitment has not been revoked.
3046 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
3048 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
3050 * Create a signature for the given input in a transaction spending an HTLC or commitment
3051 * transaction output when our counterparty broadcasts an old state.
3053 * A justice transaction may claim multiples outputs at the same time if timelocks are
3054 * similar, but only a signature for the input at index `input` should be signed for here.
3055 * It may be called multiples time for same output(s) if a fee-bump is needed with regards
3056 * to an upcoming timelock expiration.
3058 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
3060 * per_commitment_key is revocation secret which was provided by our counterparty when they
3061 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
3062 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
3065 * htlc holds HTLC elements (hash, timelock) if the output being spent is a HTLC output, thus
3066 * changing the format of the witness script (which is committed to in the BIP 143
3069 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);
3071 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
3072 * transaction, either offered or received.
3074 * Such a transaction may claim multiples offered outputs at same time if we know the
3075 * preimage for each when we create it, but only the input at index `input` should be
3076 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
3077 * needed with regards to an upcoming timelock expiration.
3079 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
3082 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
3084 * Per_commitment_point is the dynamic point corresponding to the channel state
3085 * detected onchain. It has been generated by our counterparty and is used to derive
3086 * channel state keys, which are then included in the witness script and committed to in the
3087 * BIP 143 signature.
3089 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);
3091 * Create a signature for a (proposed) closing transaction.
3093 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
3094 * chosen to forgo their output as dust.
3096 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, struct LDKTransaction closing_tx);
3098 * Signs a channel announcement message with our funding key, proving it comes from one
3099 * of the channel participants.
3101 * Note that if this fails or is rejected, the channel will not be publicly announced and
3102 * our counterparty may (though likely will not) close the channel on us for violating the
3105 struct LDKCResult_SignatureNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
3107 * Set the counterparty static channel data, including basepoints,
3108 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
3109 * This is done as soon as the funding outpoint is known. Since these are static channel data,
3110 * they MUST NOT be allowed to change to different values once set.
3112 * channel_parameters.is_populated() MUST be true.
3114 * We bind holder_selected_contest_delay late here for API convenience.
3116 * Will be called before any signatures are applied.
3118 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
3120 * Frees any resources associated with this object given its this_arg pointer.
3121 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3123 void (*free)(void *this_arg);
3127 * A cloneable signer.
3129 * Although we require signers to be cloneable, it may be useful for developers to be able to use
3130 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
3131 * which implies Sized, into this derived trait.
3133 typedef struct LDKSign {
3135 * An opaque pointer which is passed to your function implementations as an argument.
3136 * This has no meaning in the LDK, and can be NULL or any other value.
3140 * Implementation of BaseSign for this object.
3142 struct LDKBaseSign BaseSign;
3144 * Creates a copy of the BaseSign, for a copy of this Sign.
3145 * Because BaseSign doesn't natively support copying itself, you have to provide a full copy implementation here.
3147 struct LDKBaseSign (*BaseSign_clone)(const struct LDKBaseSign *NONNULL_PTR orig_BaseSign);
3149 * Serialize the object into a byte array
3151 struct LDKCVec_u8Z (*write)(const void *this_arg);
3153 * Creates a copy of the object pointed to by this_arg, for a copy of this Sign.
3154 * Note that the ultimate copy of the Sign will have all function pointers the same as the original.
3155 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new Sign.
3157 void *(*clone)(const void *this_arg);
3159 * Frees any resources associated with this object given its this_arg pointer.
3160 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3162 void (*free)(void *this_arg);
3168 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
3169 * on-chain transactions to ensure no loss of funds occurs.
3171 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
3172 * information and are actively monitoring the chain.
3174 * Pending Events or updated HTLCs which have not yet been read out by
3175 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
3176 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
3177 * gotten are fully handled before re-serializing the new state.
3179 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
3180 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
3181 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
3182 * returned block hash and the the current chain and then reconnecting blocks to get to the
3183 * best chain) upon deserializing the object!
3185 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
3187 * A pointer to the opaque Rust object.
3188 * Nearly everywhere, inner must be non-null, however in places where
3189 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3191 LDKnativeChannelMonitor *inner;
3193 * Indicates that this is the only struct which contains the same pointer.
3194 * Rust functions which take ownership of an object provided via an argument require
3195 * this to be true and invalidate the object pointed to by inner.
3198 } LDKChannelMonitor;
3201 * A tuple of 2 elements. See the individual fields for the types contained.
3203 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
3205 * The element at position 0
3207 struct LDKThirtyTwoBytes a;
3209 * The element at position 1
3211 struct LDKChannelMonitor b;
3212 } LDKC2Tuple_BlockHashChannelMonitorZ;
3215 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
3217 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
3219 * A pointer to the contents in the success state.
3220 * Reading from this pointer when `result_ok` is not set is undefined.
3222 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
3224 * A pointer to the contents in the error state.
3225 * Reading from this pointer when `result_ok` is set is undefined.
3227 struct LDKDecodeError *err;
3228 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
3231 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
3232 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
3233 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3235 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
3237 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
3238 * `err` or `result` depending on the state of `result_ok`.
3240 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
3242 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
3245 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
3252 typedef struct MUST_USE_STRUCT LDKRouteHop {
3254 * A pointer to the opaque Rust object.
3255 * Nearly everywhere, inner must be non-null, however in places where
3256 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3258 LDKnativeRouteHop *inner;
3260 * Indicates that this is the only struct which contains the same pointer.
3261 * Rust functions which take ownership of an object provided via an argument require
3262 * this to be true and invalidate the object pointed to by inner.
3268 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
3269 * This corresponds to std::vector in C++
3271 typedef struct LDKCVec_RouteHopZ {
3273 * The elements in the array.
3274 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3276 struct LDKRouteHop *data;
3278 * The number of elements pointed to by `data`.
3281 } LDKCVec_RouteHopZ;
3284 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
3285 * This corresponds to std::vector in C++
3287 typedef struct LDKCVec_CVec_RouteHopZZ {
3289 * The elements in the array.
3290 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3292 struct LDKCVec_RouteHopZ *data;
3294 * The number of elements pointed to by `data`.
3297 } LDKCVec_CVec_RouteHopZZ;
3302 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
3303 * it can take multiple paths. Each path is composed of one or more hops through the network.
3305 typedef struct MUST_USE_STRUCT LDKRoute {
3307 * A pointer to the opaque Rust object.
3308 * Nearly everywhere, inner must be non-null, however in places where
3309 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3311 LDKnativeRoute *inner;
3313 * Indicates that this is the only struct which contains the same pointer.
3314 * Rust functions which take ownership of an object provided via an argument require
3315 * this to be true and invalidate the object pointed to by inner.
3321 * The contents of CResult_RouteDecodeErrorZ
3323 typedef union LDKCResult_RouteDecodeErrorZPtr {
3325 * A pointer to the contents in the success state.
3326 * Reading from this pointer when `result_ok` is not set is undefined.
3328 struct LDKRoute *result;
3330 * A pointer to the contents in the error state.
3331 * Reading from this pointer when `result_ok` is set is undefined.
3333 struct LDKDecodeError *err;
3334 } LDKCResult_RouteDecodeErrorZPtr;
3337 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
3338 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
3339 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3341 typedef struct LDKCResult_RouteDecodeErrorZ {
3343 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
3344 * `err` or `result` depending on the state of `result_ok`.
3346 union LDKCResult_RouteDecodeErrorZPtr contents;
3348 * Whether this CResult_RouteDecodeErrorZ represents a success state.
3351 } LDKCResult_RouteDecodeErrorZ;
3356 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
3358 typedef struct MUST_USE_STRUCT LDKChannelDetails {
3360 * A pointer to the opaque Rust object.
3361 * Nearly everywhere, inner must be non-null, however in places where
3362 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3364 LDKnativeChannelDetails *inner;
3366 * Indicates that this is the only struct which contains the same pointer.
3367 * Rust functions which take ownership of an object provided via an argument require
3368 * this to be true and invalidate the object pointed to by inner.
3371 } LDKChannelDetails;
3374 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
3375 * This corresponds to std::vector in C++
3377 typedef struct LDKCVec_ChannelDetailsZ {
3379 * The elements in the array.
3380 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3382 struct LDKChannelDetails *data;
3384 * The number of elements pointed to by `data`.
3387 } LDKCVec_ChannelDetailsZ;
3392 * An Err type for failure to process messages.
3394 typedef struct MUST_USE_STRUCT LDKLightningError {
3396 * A pointer to the opaque Rust object.
3397 * Nearly everywhere, inner must be non-null, however in places where
3398 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3400 LDKnativeLightningError *inner;
3402 * Indicates that this is the only struct which contains the same pointer.
3403 * Rust functions which take ownership of an object provided via an argument require
3404 * this to be true and invalidate the object pointed to by inner.
3407 } LDKLightningError;
3410 * The contents of CResult_RouteLightningErrorZ
3412 typedef union LDKCResult_RouteLightningErrorZPtr {
3414 * A pointer to the contents in the success state.
3415 * Reading from this pointer when `result_ok` is not set is undefined.
3417 struct LDKRoute *result;
3419 * A pointer to the contents in the error state.
3420 * Reading from this pointer when `result_ok` is set is undefined.
3422 struct LDKLightningError *err;
3423 } LDKCResult_RouteLightningErrorZPtr;
3426 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
3427 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
3428 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3430 typedef struct LDKCResult_RouteLightningErrorZ {
3432 * The contents of this CResult_RouteLightningErrorZ, accessible via either
3433 * `err` or `result` depending on the state of `result_ok`.
3435 union LDKCResult_RouteLightningErrorZPtr contents;
3437 * Whether this CResult_RouteLightningErrorZ represents a success state.
3440 } LDKCResult_RouteLightningErrorZ;
3445 * An accept_channel message to be sent or received from a peer
3447 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
3449 * A pointer to the opaque Rust object.
3450 * Nearly everywhere, inner must be non-null, however in places where
3451 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3453 LDKnativeAcceptChannel *inner;
3455 * Indicates that this is the only struct which contains the same pointer.
3456 * Rust functions which take ownership of an object provided via an argument require
3457 * this to be true and invalidate the object pointed to by inner.
3465 * An open_channel message to be sent or received from a peer
3467 typedef struct MUST_USE_STRUCT LDKOpenChannel {
3469 * A pointer to the opaque Rust object.
3470 * Nearly everywhere, inner must be non-null, however in places where
3471 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3473 LDKnativeOpenChannel *inner;
3475 * Indicates that this is the only struct which contains the same pointer.
3476 * Rust functions which take ownership of an object provided via an argument require
3477 * this to be true and invalidate the object pointed to by inner.
3485 * A funding_created message to be sent or received from a peer
3487 typedef struct MUST_USE_STRUCT LDKFundingCreated {
3489 * A pointer to the opaque Rust object.
3490 * Nearly everywhere, inner must be non-null, however in places where
3491 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3493 LDKnativeFundingCreated *inner;
3495 * Indicates that this is the only struct which contains the same pointer.
3496 * Rust functions which take ownership of an object provided via an argument require
3497 * this to be true and invalidate the object pointed to by inner.
3500 } LDKFundingCreated;
3505 * A funding_signed message to be sent or received from a peer
3507 typedef struct MUST_USE_STRUCT LDKFundingSigned {
3509 * A pointer to the opaque Rust object.
3510 * Nearly everywhere, inner must be non-null, however in places where
3511 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3513 LDKnativeFundingSigned *inner;
3515 * Indicates that this is the only struct which contains the same pointer.
3516 * Rust functions which take ownership of an object provided via an argument require
3517 * this to be true and invalidate the object pointed to by inner.
3525 * A funding_locked message to be sent or received from a peer
3527 typedef struct MUST_USE_STRUCT LDKFundingLocked {
3529 * A pointer to the opaque Rust object.
3530 * Nearly everywhere, inner must be non-null, however in places where
3531 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3533 LDKnativeFundingLocked *inner;
3535 * Indicates that this is the only struct which contains the same pointer.
3536 * Rust functions which take ownership of an object provided via an argument require
3537 * this to be true and invalidate the object pointed to by inner.
3545 * An announcement_signatures message to be sent or received from a peer
3547 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
3549 * A pointer to the opaque Rust object.
3550 * Nearly everywhere, inner must be non-null, however in places where
3551 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3553 LDKnativeAnnouncementSignatures *inner;
3555 * Indicates that this is the only struct which contains the same pointer.
3556 * Rust functions which take ownership of an object provided via an argument require
3557 * this to be true and invalidate the object pointed to by inner.
3560 } LDKAnnouncementSignatures;
3565 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
3566 * transaction updates if they were pending.
3568 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
3570 * A pointer to the opaque Rust object.
3571 * Nearly everywhere, inner must be non-null, however in places where
3572 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3574 LDKnativeCommitmentUpdate *inner;
3576 * Indicates that this is the only struct which contains the same pointer.
3577 * Rust functions which take ownership of an object provided via an argument require
3578 * this to be true and invalidate the object pointed to by inner.
3581 } LDKCommitmentUpdate;
3586 * A revoke_and_ack message to be sent or received from a peer
3588 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
3590 * A pointer to the opaque Rust object.
3591 * Nearly everywhere, inner must be non-null, however in places where
3592 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3594 LDKnativeRevokeAndACK *inner;
3596 * Indicates that this is the only struct which contains the same pointer.
3597 * Rust functions which take ownership of an object provided via an argument require
3598 * this to be true and invalidate the object pointed to by inner.
3606 * A closing_signed message to be sent or received from a peer
3608 typedef struct MUST_USE_STRUCT LDKClosingSigned {
3610 * A pointer to the opaque Rust object.
3611 * Nearly everywhere, inner must be non-null, however in places where
3612 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3614 LDKnativeClosingSigned *inner;
3616 * Indicates that this is the only struct which contains the same pointer.
3617 * Rust functions which take ownership of an object provided via an argument require
3618 * this to be true and invalidate the object pointed to by inner.
3626 * A shutdown message to be sent or received from a peer
3628 typedef struct MUST_USE_STRUCT LDKShutdown {
3630 * A pointer to the opaque Rust object.
3631 * Nearly everywhere, inner must be non-null, however in places where
3632 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3634 LDKnativeShutdown *inner;
3636 * Indicates that this is the only struct which contains the same pointer.
3637 * Rust functions which take ownership of an object provided via an argument require
3638 * this to be true and invalidate the object pointed to by inner.
3646 * A channel_reestablish message to be sent or received from a peer
3648 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
3650 * A pointer to the opaque Rust object.
3651 * Nearly everywhere, inner must be non-null, however in places where
3652 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3654 LDKnativeChannelReestablish *inner;
3656 * Indicates that this is the only struct which contains the same pointer.
3657 * Rust functions which take ownership of an object provided via an argument require
3658 * this to be true and invalidate the object pointed to by inner.
3661 } LDKChannelReestablish;
3666 * A channel_announcement message to be sent or received from a peer
3668 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
3670 * A pointer to the opaque Rust object.
3671 * Nearly everywhere, inner must be non-null, however in places where
3672 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3674 LDKnativeChannelAnnouncement *inner;
3676 * Indicates that this is the only struct which contains the same pointer.
3677 * Rust functions which take ownership of an object provided via an argument require
3678 * this to be true and invalidate the object pointed to by inner.
3681 } LDKChannelAnnouncement;
3686 * A channel_update message to be sent or received from a peer
3688 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
3690 * A pointer to the opaque Rust object.
3691 * Nearly everywhere, inner must be non-null, however in places where
3692 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3694 LDKnativeChannelUpdate *inner;
3696 * Indicates that this is the only struct which contains the same pointer.
3697 * Rust functions which take ownership of an object provided via an argument require
3698 * this to be true and invalidate the object pointed to by inner.
3706 * A node_announcement message to be sent or received from a peer
3708 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
3710 * A pointer to the opaque Rust object.
3711 * Nearly everywhere, inner must be non-null, however in places where
3712 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3714 LDKnativeNodeAnnouncement *inner;
3716 * Indicates that this is the only struct which contains the same pointer.
3717 * Rust functions which take ownership of an object provided via an argument require
3718 * this to be true and invalidate the object pointed to by inner.
3721 } LDKNodeAnnouncement;
3726 * An error message to be sent or received from a peer
3728 typedef struct MUST_USE_STRUCT LDKErrorMessage {
3730 * A pointer to the opaque Rust object.
3731 * Nearly everywhere, inner must be non-null, however in places where
3732 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3734 LDKnativeErrorMessage *inner;
3736 * Indicates that this is the only struct which contains the same pointer.
3737 * Rust functions which take ownership of an object provided via an argument require
3738 * this to be true and invalidate the object pointed to by inner.
3744 * Used to put an error message in a LightningError
3746 typedef enum LDKErrorAction_Tag {
3748 * The peer took some action which made us think they were useless. Disconnect them.
3750 LDKErrorAction_DisconnectPeer,
3752 * The peer did something harmless that we weren't able to process, just log and ignore
3754 LDKErrorAction_IgnoreError,
3756 * The peer did something incorrect. Tell them.
3758 LDKErrorAction_SendErrorMessage,
3760 * Must be last for serialization purposes
3762 LDKErrorAction_Sentinel,
3763 } LDKErrorAction_Tag;
3765 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
3767 * An error message which we should make an effort to send before we disconnect.
3769 struct LDKErrorMessage msg;
3770 } LDKErrorAction_LDKDisconnectPeer_Body;
3772 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
3774 * The message to send.
3776 struct LDKErrorMessage msg;
3777 } LDKErrorAction_LDKSendErrorMessage_Body;
3779 typedef struct MUST_USE_STRUCT LDKErrorAction {
3780 LDKErrorAction_Tag tag;
3782 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
3783 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
3788 * The information we received from a peer along the route of a payment we originated. This is
3789 * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
3790 * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
3792 typedef enum LDKHTLCFailChannelUpdate_Tag {
3794 * We received an error which included a full ChannelUpdate message.
3796 LDKHTLCFailChannelUpdate_ChannelUpdateMessage,
3798 * We received an error which indicated only that a channel has been closed
3800 LDKHTLCFailChannelUpdate_ChannelClosed,
3802 * We received an error which indicated only that a node has failed
3804 LDKHTLCFailChannelUpdate_NodeFailure,
3806 * Must be last for serialization purposes
3808 LDKHTLCFailChannelUpdate_Sentinel,
3809 } LDKHTLCFailChannelUpdate_Tag;
3811 typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body {
3813 * The unwrapped message we received
3815 struct LDKChannelUpdate msg;
3816 } LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
3818 typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
3820 * The short_channel_id which has now closed.
3822 uint64_t short_channel_id;
3824 * when this true, this channel should be permanently removed from the
3825 * consideration. Otherwise, this channel can be restored as new channel_update is received
3828 } LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
3830 typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
3832 * The node_id that has failed.
3834 struct LDKPublicKey node_id;
3836 * when this true, node should be permanently removed from the
3837 * consideration. Otherwise, the channels connected to this node can be
3838 * restored as new channel_update is received
3841 } LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
3843 typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate {
3844 LDKHTLCFailChannelUpdate_Tag tag;
3846 LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message;
3847 LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed;
3848 LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure;
3850 } LDKHTLCFailChannelUpdate;
3855 * A query_channel_range message is used to query a peer for channel
3856 * UTXOs in a range of blocks. The recipient of a query makes a best
3857 * effort to reply to the query using one or more reply_channel_range
3860 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
3862 * A pointer to the opaque Rust object.
3863 * Nearly everywhere, inner must be non-null, however in places where
3864 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3866 LDKnativeQueryChannelRange *inner;
3868 * Indicates that this is the only struct which contains the same pointer.
3869 * Rust functions which take ownership of an object provided via an argument require
3870 * this to be true and invalidate the object pointed to by inner.
3873 } LDKQueryChannelRange;
3878 * A query_short_channel_ids message is used to query a peer for
3879 * routing gossip messages related to one or more short_channel_ids.
3880 * The query recipient will reply with the latest, if available,
3881 * channel_announcement, channel_update and node_announcement messages
3882 * it maintains for the requested short_channel_ids followed by a
3883 * reply_short_channel_ids_end message. The short_channel_ids sent in
3884 * this query are encoded. We only support encoding_type=0 uncompressed
3885 * serialization and do not support encoding_type=1 zlib serialization.
3887 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
3889 * A pointer to the opaque Rust object.
3890 * Nearly everywhere, inner must be non-null, however in places where
3891 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3893 LDKnativeQueryShortChannelIds *inner;
3895 * Indicates that this is the only struct which contains the same pointer.
3896 * Rust functions which take ownership of an object provided via an argument require
3897 * this to be true and invalidate the object pointed to by inner.
3900 } LDKQueryShortChannelIds;
3905 * A reply_channel_range message is a reply to a query_channel_range
3906 * message. Multiple reply_channel_range messages can be sent in reply
3907 * to a single query_channel_range message. The query recipient makes a
3908 * best effort to respond based on their local network view which may
3909 * not be a perfect view of the network. The short_channel_ids in the
3910 * reply are encoded. We only support encoding_type=0 uncompressed
3911 * serialization and do not support encoding_type=1 zlib serialization.
3913 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
3915 * A pointer to the opaque Rust object.
3916 * Nearly everywhere, inner must be non-null, however in places where
3917 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3919 LDKnativeReplyChannelRange *inner;
3921 * Indicates that this is the only struct which contains the same pointer.
3922 * Rust functions which take ownership of an object provided via an argument require
3923 * this to be true and invalidate the object pointed to by inner.
3926 } LDKReplyChannelRange;
3929 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
3930 * broadcast to most peers).
3931 * These events are handled by PeerManager::process_events if you are using a PeerManager.
3933 typedef enum LDKMessageSendEvent_Tag {
3935 * Used to indicate that we've accepted a channel open and should send the accept_channel
3936 * message provided to the given peer.
3938 LDKMessageSendEvent_SendAcceptChannel,
3940 * Used to indicate that we've initiated a channel open and should send the open_channel
3941 * message provided to the given peer.
3943 LDKMessageSendEvent_SendOpenChannel,
3945 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
3947 LDKMessageSendEvent_SendFundingCreated,
3949 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
3951 LDKMessageSendEvent_SendFundingSigned,
3953 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
3955 LDKMessageSendEvent_SendFundingLocked,
3957 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
3959 LDKMessageSendEvent_SendAnnouncementSignatures,
3961 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
3962 * message should be sent to the peer with the given node_id.
3964 LDKMessageSendEvent_UpdateHTLCs,
3966 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
3968 LDKMessageSendEvent_SendRevokeAndACK,
3970 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
3972 LDKMessageSendEvent_SendClosingSigned,
3974 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
3976 LDKMessageSendEvent_SendShutdown,
3978 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
3980 LDKMessageSendEvent_SendChannelReestablish,
3982 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
3983 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
3985 * Note that after doing so, you very likely (unless you did so very recently) want to call
3986 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
3987 * This ensures that any nodes which see our channel_announcement also have a relevant
3988 * node_announcement, including relevant feature flags which may be important for routing
3991 LDKMessageSendEvent_BroadcastChannelAnnouncement,
3993 * Used to indicate that a node_announcement should be broadcast to all peers.
3995 LDKMessageSendEvent_BroadcastNodeAnnouncement,
3997 * Used to indicate that a channel_update should be broadcast to all peers.
3999 LDKMessageSendEvent_BroadcastChannelUpdate,
4001 * Broadcast an error downstream to be handled
4003 LDKMessageSendEvent_HandleError,
4005 * When a payment fails we may receive updates back from the hop where it failed. In such
4006 * cases this event is generated so that we can inform the network graph of this information.
4008 LDKMessageSendEvent_PaymentFailureNetworkUpdate,
4010 * Query a peer for channels with funding transaction UTXOs in a block range.
4012 LDKMessageSendEvent_SendChannelRangeQuery,
4014 * Request routing gossip messages from a peer for a list of channels identified by
4015 * their short_channel_ids.
4017 LDKMessageSendEvent_SendShortIdsQuery,
4019 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
4020 * emitted during processing of the query.
4022 LDKMessageSendEvent_SendReplyChannelRange,
4024 * Must be last for serialization purposes
4026 LDKMessageSendEvent_Sentinel,
4027 } LDKMessageSendEvent_Tag;
4029 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
4031 * The node_id of the node which should receive this message
4033 struct LDKPublicKey node_id;
4035 * The message which should be sent.
4037 struct LDKAcceptChannel msg;
4038 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
4040 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
4042 * The node_id of the node which should receive this message
4044 struct LDKPublicKey node_id;
4046 * The message which should be sent.
4048 struct LDKOpenChannel msg;
4049 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
4051 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
4053 * The node_id of the node which should receive this message
4055 struct LDKPublicKey node_id;
4057 * The message which should be sent.
4059 struct LDKFundingCreated msg;
4060 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
4062 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
4064 * The node_id of the node which should receive this message
4066 struct LDKPublicKey node_id;
4068 * The message which should be sent.
4070 struct LDKFundingSigned msg;
4071 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
4073 typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
4075 * The node_id of the node which should receive these message(s)
4077 struct LDKPublicKey node_id;
4079 * The funding_locked message which should be sent.
4081 struct LDKFundingLocked msg;
4082 } LDKMessageSendEvent_LDKSendFundingLocked_Body;
4084 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
4086 * The node_id of the node which should receive these message(s)
4088 struct LDKPublicKey node_id;
4090 * The announcement_signatures message which should be sent.
4092 struct LDKAnnouncementSignatures msg;
4093 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
4095 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
4097 * The node_id of the node which should receive these message(s)
4099 struct LDKPublicKey node_id;
4101 * The update messages which should be sent. ALL messages in the struct should be sent!
4103 struct LDKCommitmentUpdate updates;
4104 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
4106 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
4108 * The node_id of the node which should receive this message
4110 struct LDKPublicKey node_id;
4112 * The message which should be sent.
4114 struct LDKRevokeAndACK msg;
4115 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
4117 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
4119 * The node_id of the node which should receive this message
4121 struct LDKPublicKey node_id;
4123 * The message which should be sent.
4125 struct LDKClosingSigned msg;
4126 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
4128 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
4130 * The node_id of the node which should receive this message
4132 struct LDKPublicKey node_id;
4134 * The message which should be sent.
4136 struct LDKShutdown msg;
4137 } LDKMessageSendEvent_LDKSendShutdown_Body;
4139 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
4141 * The node_id of the node which should receive this message
4143 struct LDKPublicKey node_id;
4145 * The message which should be sent.
4147 struct LDKChannelReestablish msg;
4148 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
4150 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
4152 * The channel_announcement which should be sent.
4154 struct LDKChannelAnnouncement msg;
4156 * The followup channel_update which should be sent.
4158 struct LDKChannelUpdate update_msg;
4159 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
4161 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
4163 * The node_announcement which should be sent.
4165 struct LDKNodeAnnouncement msg;
4166 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
4168 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
4170 * The channel_update which should be sent.
4172 struct LDKChannelUpdate msg;
4173 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
4175 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
4177 * The node_id of the node which should receive this message
4179 struct LDKPublicKey node_id;
4181 * The action which should be taken.
4183 struct LDKErrorAction action;
4184 } LDKMessageSendEvent_LDKHandleError_Body;
4186 typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
4188 * The channel/node update which should be sent to NetGraphMsgHandler
4190 struct LDKHTLCFailChannelUpdate update;
4191 } LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
4193 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
4195 * The node_id of this message recipient
4197 struct LDKPublicKey node_id;
4199 * The query_channel_range which should be sent.
4201 struct LDKQueryChannelRange msg;
4202 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
4204 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
4206 * The node_id of this message recipient
4208 struct LDKPublicKey node_id;
4210 * The query_short_channel_ids which should be sent.
4212 struct LDKQueryShortChannelIds msg;
4213 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
4215 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
4217 * The node_id of this message recipient
4219 struct LDKPublicKey node_id;
4221 * The reply_channel_range which should be sent.
4223 struct LDKReplyChannelRange msg;
4224 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
4226 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
4227 LDKMessageSendEvent_Tag tag;
4229 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
4230 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
4231 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
4232 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
4233 LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
4234 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
4235 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
4236 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
4237 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
4238 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
4239 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
4240 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
4241 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
4242 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
4243 LDKMessageSendEvent_LDKHandleError_Body handle_error;
4244 LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update;
4245 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
4246 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
4247 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
4249 } LDKMessageSendEvent;
4252 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
4253 * This corresponds to std::vector in C++
4255 typedef struct LDKCVec_MessageSendEventZ {
4257 * The elements in the array.
4258 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4260 struct LDKMessageSendEvent *data;
4262 * The number of elements pointed to by `data`.
4265 } LDKCVec_MessageSendEventZ;
4268 * The contents of CResult_boolLightningErrorZ
4270 typedef union LDKCResult_boolLightningErrorZPtr {
4272 * A pointer to the contents in the success state.
4273 * Reading from this pointer when `result_ok` is not set is undefined.
4277 * A pointer to the contents in the error state.
4278 * Reading from this pointer when `result_ok` is set is undefined.
4280 struct LDKLightningError *err;
4281 } LDKCResult_boolLightningErrorZPtr;
4284 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
4285 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
4286 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4288 typedef struct LDKCResult_boolLightningErrorZ {
4290 * The contents of this CResult_boolLightningErrorZ, accessible via either
4291 * `err` or `result` depending on the state of `result_ok`.
4293 union LDKCResult_boolLightningErrorZPtr contents;
4295 * Whether this CResult_boolLightningErrorZ represents a success state.
4298 } LDKCResult_boolLightningErrorZ;
4301 * A tuple of 3 elements. See the individual fields for the types contained.
4303 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
4305 * The element at position 0
4307 struct LDKChannelAnnouncement a;
4309 * The element at position 1
4311 struct LDKChannelUpdate b;
4313 * The element at position 2
4315 struct LDKChannelUpdate c;
4316 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
4319 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
4320 * This corresponds to std::vector in C++
4322 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
4324 * The elements in the array.
4325 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4327 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
4329 * The number of elements pointed to by `data`.
4332 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
4335 * A dynamically-allocated array of crate::lightning::ln::msgs::NodeAnnouncements of arbitrary size.
4336 * This corresponds to std::vector in C++
4338 typedef struct LDKCVec_NodeAnnouncementZ {
4340 * The elements in the array.
4341 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4343 struct LDKNodeAnnouncement *data;
4345 * The number of elements pointed to by `data`.
4348 } LDKCVec_NodeAnnouncementZ;
4351 * The contents of CResult_NoneLightningErrorZ
4353 typedef union LDKCResult_NoneLightningErrorZPtr {
4355 * Note that this value is always NULL, as there are no contents in the OK variant
4359 * A pointer to the contents in the error state.
4360 * Reading from this pointer when `result_ok` is set is undefined.
4362 struct LDKLightningError *err;
4363 } LDKCResult_NoneLightningErrorZPtr;
4366 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
4367 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
4368 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4370 typedef struct LDKCResult_NoneLightningErrorZ {
4372 * The contents of this CResult_NoneLightningErrorZ, accessible via either
4373 * `err` or `result` depending on the state of `result_ok`.
4375 union LDKCResult_NoneLightningErrorZPtr contents;
4377 * Whether this CResult_NoneLightningErrorZ represents a success state.
4380 } LDKCResult_NoneLightningErrorZ;
4383 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
4384 * This corresponds to std::vector in C++
4386 typedef struct LDKCVec_PublicKeyZ {
4388 * The elements in the array.
4389 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4391 struct LDKPublicKey *data;
4393 * The number of elements pointed to by `data`.
4396 } LDKCVec_PublicKeyZ;
4401 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
4402 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
4405 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
4407 * A pointer to the opaque Rust object.
4408 * Nearly everywhere, inner must be non-null, however in places where
4409 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4411 LDKnativePeerHandleError *inner;
4413 * Indicates that this is the only struct which contains the same pointer.
4414 * Rust functions which take ownership of an object provided via an argument require
4415 * this to be true and invalidate the object pointed to by inner.
4418 } LDKPeerHandleError;
4421 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
4423 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
4425 * A pointer to the contents in the success state.
4426 * Reading from this pointer when `result_ok` is not set is undefined.
4428 struct LDKCVec_u8Z *result;
4430 * A pointer to the contents in the error state.
4431 * Reading from this pointer when `result_ok` is set is undefined.
4433 struct LDKPeerHandleError *err;
4434 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
4437 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
4438 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
4439 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4441 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
4443 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
4444 * `err` or `result` depending on the state of `result_ok`.
4446 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
4448 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
4451 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
4454 * The contents of CResult_NonePeerHandleErrorZ
4456 typedef union LDKCResult_NonePeerHandleErrorZPtr {
4458 * Note that this value is always NULL, as there are no contents in the OK variant
4462 * A pointer to the contents in the error state.
4463 * Reading from this pointer when `result_ok` is set is undefined.
4465 struct LDKPeerHandleError *err;
4466 } LDKCResult_NonePeerHandleErrorZPtr;
4469 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
4470 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
4471 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4473 typedef struct LDKCResult_NonePeerHandleErrorZ {
4475 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
4476 * `err` or `result` depending on the state of `result_ok`.
4478 union LDKCResult_NonePeerHandleErrorZPtr contents;
4480 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
4483 } LDKCResult_NonePeerHandleErrorZ;
4486 * The contents of CResult_boolPeerHandleErrorZ
4488 typedef union LDKCResult_boolPeerHandleErrorZPtr {
4490 * A pointer to the contents in the success state.
4491 * Reading from this pointer when `result_ok` is not set is undefined.
4495 * A pointer to the contents in the error state.
4496 * Reading from this pointer when `result_ok` is set is undefined.
4498 struct LDKPeerHandleError *err;
4499 } LDKCResult_boolPeerHandleErrorZPtr;
4502 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
4503 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
4504 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4506 typedef struct LDKCResult_boolPeerHandleErrorZ {
4508 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
4509 * `err` or `result` depending on the state of `result_ok`.
4511 union LDKCResult_boolPeerHandleErrorZPtr contents;
4513 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
4516 } LDKCResult_boolPeerHandleErrorZ;
4519 * The contents of CResult_TxOutAccessErrorZ
4521 typedef union LDKCResult_TxOutAccessErrorZPtr {
4523 * A pointer to the contents in the success state.
4524 * Reading from this pointer when `result_ok` is not set is undefined.
4526 struct LDKTxOut *result;
4528 * A pointer to the contents in the error state.
4529 * Reading from this pointer when `result_ok` is set is undefined.
4531 enum LDKAccessError *err;
4532 } LDKCResult_TxOutAccessErrorZPtr;
4535 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
4536 * containing a crate::c_types::TxOut on success and a crate::lightning::chain::AccessError on failure.
4537 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4539 typedef struct LDKCResult_TxOutAccessErrorZ {
4541 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
4542 * `err` or `result` depending on the state of `result_ok`.
4544 union LDKCResult_TxOutAccessErrorZPtr contents;
4546 * Whether this CResult_TxOutAccessErrorZ represents a success state.
4549 } LDKCResult_TxOutAccessErrorZ;
4552 * An enum which can either contain a crate::c_types::derived::C2Tuple_usizeTransactionZ or not
4554 typedef enum LDKCOption_C2Tuple_usizeTransactionZZ_Tag {
4556 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains a crate::c_types::derived::C2Tuple_usizeTransactionZ
4558 LDKCOption_C2Tuple_usizeTransactionZZ_Some,
4560 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains nothing
4562 LDKCOption_C2Tuple_usizeTransactionZZ_None,
4564 * Must be last for serialization purposes
4566 LDKCOption_C2Tuple_usizeTransactionZZ_Sentinel,
4567 } LDKCOption_C2Tuple_usizeTransactionZZ_Tag;
4569 typedef struct LDKCOption_C2Tuple_usizeTransactionZZ {
4570 LDKCOption_C2Tuple_usizeTransactionZZ_Tag tag;
4573 struct LDKC2Tuple_usizeTransactionZ some;
4576 } LDKCOption_C2Tuple_usizeTransactionZZ;
4581 * Details about one direction of a channel. Received
4582 * within a channel update.
4584 typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
4586 * A pointer to the opaque Rust object.
4587 * Nearly everywhere, inner must be non-null, however in places where
4588 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4590 LDKnativeDirectionalChannelInfo *inner;
4592 * Indicates that this is the only struct which contains the same pointer.
4593 * Rust functions which take ownership of an object provided via an argument require
4594 * this to be true and invalidate the object pointed to by inner.
4597 } LDKDirectionalChannelInfo;
4600 * The contents of CResult_DirectionalChannelInfoDecodeErrorZ
4602 typedef union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr {
4604 * A pointer to the contents in the success state.
4605 * Reading from this pointer when `result_ok` is not set is undefined.
4607 struct LDKDirectionalChannelInfo *result;
4609 * A pointer to the contents in the error state.
4610 * Reading from this pointer when `result_ok` is set is undefined.
4612 struct LDKDecodeError *err;
4613 } LDKCResult_DirectionalChannelInfoDecodeErrorZPtr;
4616 * A CResult_DirectionalChannelInfoDecodeErrorZ represents the result of a fallible operation,
4617 * containing a crate::lightning::routing::network_graph::DirectionalChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4618 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4620 typedef struct LDKCResult_DirectionalChannelInfoDecodeErrorZ {
4622 * The contents of this CResult_DirectionalChannelInfoDecodeErrorZ, accessible via either
4623 * `err` or `result` depending on the state of `result_ok`.
4625 union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr contents;
4627 * Whether this CResult_DirectionalChannelInfoDecodeErrorZ represents a success state.
4630 } LDKCResult_DirectionalChannelInfoDecodeErrorZ;
4635 * Details about a channel (both directions).
4636 * Received within a channel announcement.
4638 typedef struct MUST_USE_STRUCT LDKChannelInfo {
4640 * A pointer to the opaque Rust object.
4641 * Nearly everywhere, inner must be non-null, however in places where
4642 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4644 LDKnativeChannelInfo *inner;
4646 * Indicates that this is the only struct which contains the same pointer.
4647 * Rust functions which take ownership of an object provided via an argument require
4648 * this to be true and invalidate the object pointed to by inner.
4654 * The contents of CResult_ChannelInfoDecodeErrorZ
4656 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
4658 * A pointer to the contents in the success state.
4659 * Reading from this pointer when `result_ok` is not set is undefined.
4661 struct LDKChannelInfo *result;
4663 * A pointer to the contents in the error state.
4664 * Reading from this pointer when `result_ok` is set is undefined.
4666 struct LDKDecodeError *err;
4667 } LDKCResult_ChannelInfoDecodeErrorZPtr;
4670 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
4671 * containing a crate::lightning::routing::network_graph::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4672 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4674 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
4676 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
4677 * `err` or `result` depending on the state of `result_ok`.
4679 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
4681 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
4684 } LDKCResult_ChannelInfoDecodeErrorZ;
4689 * Fees for routing via a given channel or a node
4691 typedef struct MUST_USE_STRUCT LDKRoutingFees {
4693 * A pointer to the opaque Rust object.
4694 * Nearly everywhere, inner must be non-null, however in places where
4695 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4697 LDKnativeRoutingFees *inner;
4699 * Indicates that this is the only struct which contains the same pointer.
4700 * Rust functions which take ownership of an object provided via an argument require
4701 * this to be true and invalidate the object pointed to by inner.
4707 * The contents of CResult_RoutingFeesDecodeErrorZ
4709 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
4711 * A pointer to the contents in the success state.
4712 * Reading from this pointer when `result_ok` is not set is undefined.
4714 struct LDKRoutingFees *result;
4716 * A pointer to the contents in the error state.
4717 * Reading from this pointer when `result_ok` is set is undefined.
4719 struct LDKDecodeError *err;
4720 } LDKCResult_RoutingFeesDecodeErrorZPtr;
4723 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
4724 * containing a crate::lightning::routing::network_graph::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
4725 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4727 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
4729 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
4730 * `err` or `result` depending on the state of `result_ok`.
4732 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
4734 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
4737 } LDKCResult_RoutingFeesDecodeErrorZ;
4740 * A 4-byte byte array.
4742 typedef struct LDKFourBytes {
4750 * A 16-byte byte array.
4752 typedef struct LDKSixteenBytes {
4760 * A 10-byte byte array.
4762 typedef struct LDKTenBytes {
4770 * An address which can be used to connect to a remote peer
4772 typedef enum LDKNetAddress_Tag {
4774 * An IPv4 address/port on which the peer is listening.
4778 * An IPv6 address/port on which the peer is listening.
4782 * An old-style Tor onion address/port on which the peer is listening.
4784 LDKNetAddress_OnionV2,
4786 * A new-style Tor onion address/port on which the peer is listening.
4787 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
4788 * wrap as base32 and append \".onion\".
4790 LDKNetAddress_OnionV3,
4792 * Must be last for serialization purposes
4794 LDKNetAddress_Sentinel,
4795 } LDKNetAddress_Tag;
4797 typedef struct LDKNetAddress_LDKIPv4_Body {
4799 * The 4-byte IPv4 address
4801 struct LDKFourBytes addr;
4803 * The port on which the node is listening
4806 } LDKNetAddress_LDKIPv4_Body;
4808 typedef struct LDKNetAddress_LDKIPv6_Body {
4810 * The 16-byte IPv6 address
4812 struct LDKSixteenBytes addr;
4814 * The port on which the node is listening
4817 } LDKNetAddress_LDKIPv6_Body;
4819 typedef struct LDKNetAddress_LDKOnionV2_Body {
4821 * The bytes (usually encoded in base32 with \".onion\" appended)
4823 struct LDKTenBytes addr;
4825 * The port on which the node is listening
4828 } LDKNetAddress_LDKOnionV2_Body;
4830 typedef struct LDKNetAddress_LDKOnionV3_Body {
4832 * The ed25519 long-term public key of the peer
4834 struct LDKThirtyTwoBytes ed25519_pubkey;
4836 * The checksum of the pubkey and version, as included in the onion address
4840 * The version byte, as defined by the Tor Onion v3 spec.
4844 * The port on which the node is listening
4847 } LDKNetAddress_LDKOnionV3_Body;
4849 typedef struct MUST_USE_STRUCT LDKNetAddress {
4850 LDKNetAddress_Tag tag;
4852 LDKNetAddress_LDKIPv4_Body i_pv4;
4853 LDKNetAddress_LDKIPv6_Body i_pv6;
4854 LDKNetAddress_LDKOnionV2_Body onion_v2;
4855 LDKNetAddress_LDKOnionV3_Body onion_v3;
4860 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
4861 * This corresponds to std::vector in C++
4863 typedef struct LDKCVec_NetAddressZ {
4865 * The elements in the array.
4866 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4868 struct LDKNetAddress *data;
4870 * The number of elements pointed to by `data`.
4873 } LDKCVec_NetAddressZ;
4878 * Information received in the latest node_announcement from this node.
4880 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
4882 * A pointer to the opaque Rust object.
4883 * Nearly everywhere, inner must be non-null, however in places where
4884 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4886 LDKnativeNodeAnnouncementInfo *inner;
4888 * Indicates that this is the only struct which contains the same pointer.
4889 * Rust functions which take ownership of an object provided via an argument require
4890 * this to be true and invalidate the object pointed to by inner.
4893 } LDKNodeAnnouncementInfo;
4896 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
4898 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
4900 * A pointer to the contents in the success state.
4901 * Reading from this pointer when `result_ok` is not set is undefined.
4903 struct LDKNodeAnnouncementInfo *result;
4905 * A pointer to the contents in the error state.
4906 * Reading from this pointer when `result_ok` is set is undefined.
4908 struct LDKDecodeError *err;
4909 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
4912 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
4913 * containing a crate::lightning::routing::network_graph::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4914 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4916 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
4918 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
4919 * `err` or `result` depending on the state of `result_ok`.
4921 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
4923 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
4926 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
4929 * A dynamically-allocated array of u64s of arbitrary size.
4930 * This corresponds to std::vector in C++
4932 typedef struct LDKCVec_u64Z {
4934 * The elements in the array.
4935 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4939 * The number of elements pointed to by `data`.
4947 * Details about a node in the network, known from the network announcement.
4949 typedef struct MUST_USE_STRUCT LDKNodeInfo {
4951 * A pointer to the opaque Rust object.
4952 * Nearly everywhere, inner must be non-null, however in places where
4953 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4955 LDKnativeNodeInfo *inner;
4957 * Indicates that this is the only struct which contains the same pointer.
4958 * Rust functions which take ownership of an object provided via an argument require
4959 * this to be true and invalidate the object pointed to by inner.
4965 * The contents of CResult_NodeInfoDecodeErrorZ
4967 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
4969 * A pointer to the contents in the success state.
4970 * Reading from this pointer when `result_ok` is not set is undefined.
4972 struct LDKNodeInfo *result;
4974 * A pointer to the contents in the error state.
4975 * Reading from this pointer when `result_ok` is set is undefined.
4977 struct LDKDecodeError *err;
4978 } LDKCResult_NodeInfoDecodeErrorZPtr;
4981 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
4982 * containing a crate::lightning::routing::network_graph::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4983 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4985 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
4987 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
4988 * `err` or `result` depending on the state of `result_ok`.
4990 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
4992 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
4995 } LDKCResult_NodeInfoDecodeErrorZ;
5000 * Represents the network as nodes and channels between them
5002 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
5004 * A pointer to the opaque Rust object.
5005 * Nearly everywhere, inner must be non-null, however in places where
5006 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5008 LDKnativeNetworkGraph *inner;
5010 * Indicates that this is the only struct which contains the same pointer.
5011 * Rust functions which take ownership of an object provided via an argument require
5012 * this to be true and invalidate the object pointed to by inner.
5018 * The contents of CResult_NetworkGraphDecodeErrorZ
5020 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
5022 * A pointer to the contents in the success state.
5023 * Reading from this pointer when `result_ok` is not set is undefined.
5025 struct LDKNetworkGraph *result;
5027 * A pointer to the contents in the error state.
5028 * Reading from this pointer when `result_ok` is set is undefined.
5030 struct LDKDecodeError *err;
5031 } LDKCResult_NetworkGraphDecodeErrorZPtr;
5034 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
5035 * containing a crate::lightning::routing::network_graph::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
5036 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5038 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
5040 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
5041 * `err` or `result` depending on the state of `result_ok`.
5043 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
5045 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
5048 } LDKCResult_NetworkGraphDecodeErrorZ;
5053 * Features used within an `init` message.
5055 typedef struct MUST_USE_STRUCT LDKInitFeatures {
5057 * A pointer to the opaque Rust object.
5058 * Nearly everywhere, inner must be non-null, however in places where
5059 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5061 LDKnativeInitFeatures *inner;
5063 * Indicates that this is the only struct which contains the same pointer.
5064 * Rust functions which take ownership of an object provided via an argument require
5065 * this to be true and invalidate the object pointed to by inner.
5071 * The contents of CResult_InitFeaturesDecodeErrorZ
5073 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
5075 * A pointer to the contents in the success state.
5076 * Reading from this pointer when `result_ok` is not set is undefined.
5078 struct LDKInitFeatures *result;
5080 * A pointer to the contents in the error state.
5081 * Reading from this pointer when `result_ok` is set is undefined.
5083 struct LDKDecodeError *err;
5084 } LDKCResult_InitFeaturesDecodeErrorZPtr;
5087 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
5088 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5089 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5091 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
5093 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
5094 * `err` or `result` depending on the state of `result_ok`.
5096 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
5098 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
5101 } LDKCResult_InitFeaturesDecodeErrorZ;
5106 * Features used within a `node_announcement` message.
5108 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
5110 * A pointer to the opaque Rust object.
5111 * Nearly everywhere, inner must be non-null, however in places where
5112 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5114 LDKnativeNodeFeatures *inner;
5116 * Indicates that this is the only struct which contains the same pointer.
5117 * Rust functions which take ownership of an object provided via an argument require
5118 * this to be true and invalidate the object pointed to by inner.
5124 * The contents of CResult_NodeFeaturesDecodeErrorZ
5126 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
5128 * A pointer to the contents in the success state.
5129 * Reading from this pointer when `result_ok` is not set is undefined.
5131 struct LDKNodeFeatures *result;
5133 * A pointer to the contents in the error state.
5134 * Reading from this pointer when `result_ok` is set is undefined.
5136 struct LDKDecodeError *err;
5137 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
5140 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
5141 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5142 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5144 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
5146 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
5147 * `err` or `result` depending on the state of `result_ok`.
5149 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
5151 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
5154 } LDKCResult_NodeFeaturesDecodeErrorZ;
5159 * Features used within a `channel_announcement` message.
5161 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
5163 * A pointer to the opaque Rust object.
5164 * Nearly everywhere, inner must be non-null, however in places where
5165 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5167 LDKnativeChannelFeatures *inner;
5169 * Indicates that this is the only struct which contains the same pointer.
5170 * Rust functions which take ownership of an object provided via an argument require
5171 * this to be true and invalidate the object pointed to by inner.
5174 } LDKChannelFeatures;
5177 * The contents of CResult_ChannelFeaturesDecodeErrorZ
5179 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
5181 * A pointer to the contents in the success state.
5182 * Reading from this pointer when `result_ok` is not set is undefined.
5184 struct LDKChannelFeatures *result;
5186 * A pointer to the contents in the error state.
5187 * Reading from this pointer when `result_ok` is set is undefined.
5189 struct LDKDecodeError *err;
5190 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
5193 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
5194 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5195 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5197 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
5199 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
5200 * `err` or `result` depending on the state of `result_ok`.
5202 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
5204 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
5207 } LDKCResult_ChannelFeaturesDecodeErrorZ;
5210 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
5212 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
5214 * A pointer to the contents in the success state.
5215 * Reading from this pointer when `result_ok` is not set is undefined.
5217 struct LDKInvoiceFeatures *result;
5219 * A pointer to the contents in the error state.
5220 * Reading from this pointer when `result_ok` is set is undefined.
5222 struct LDKDecodeError *err;
5223 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
5226 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
5227 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5228 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5230 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
5232 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
5233 * `err` or `result` depending on the state of `result_ok`.
5235 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
5237 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
5240 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
5243 * The contents of CResult_NetAddressu8Z
5245 typedef union LDKCResult_NetAddressu8ZPtr {
5247 * A pointer to the contents in the success state.
5248 * Reading from this pointer when `result_ok` is not set is undefined.
5250 struct LDKNetAddress *result;
5252 * A pointer to the contents in the error state.
5253 * Reading from this pointer when `result_ok` is set is undefined.
5256 } LDKCResult_NetAddressu8ZPtr;
5259 * A CResult_NetAddressu8Z represents the result of a fallible operation,
5260 * containing a crate::lightning::ln::msgs::NetAddress on success and a u8 on failure.
5261 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5263 typedef struct LDKCResult_NetAddressu8Z {
5265 * The contents of this CResult_NetAddressu8Z, accessible via either
5266 * `err` or `result` depending on the state of `result_ok`.
5268 union LDKCResult_NetAddressu8ZPtr contents;
5270 * Whether this CResult_NetAddressu8Z represents a success state.
5273 } LDKCResult_NetAddressu8Z;
5276 * The contents of CResult_CResult_NetAddressu8ZDecodeErrorZ
5278 typedef union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr {
5280 * A pointer to the contents in the success state.
5281 * Reading from this pointer when `result_ok` is not set is undefined.
5283 struct LDKCResult_NetAddressu8Z *result;
5285 * A pointer to the contents in the error state.
5286 * Reading from this pointer when `result_ok` is set is undefined.
5288 struct LDKDecodeError *err;
5289 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr;
5292 * A CResult_CResult_NetAddressu8ZDecodeErrorZ represents the result of a fallible operation,
5293 * containing a crate::c_types::derived::CResult_NetAddressu8Z on success and a crate::lightning::ln::msgs::DecodeError on failure.
5294 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5296 typedef struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ {
5298 * The contents of this CResult_CResult_NetAddressu8ZDecodeErrorZ, accessible via either
5299 * `err` or `result` depending on the state of `result_ok`.
5301 union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr contents;
5303 * Whether this CResult_CResult_NetAddressu8ZDecodeErrorZ represents a success state.
5306 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZ;
5311 * An update_add_htlc message to be sent or received from a peer
5313 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
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 LDKnativeUpdateAddHTLC *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.
5329 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
5330 * This corresponds to std::vector in C++
5332 typedef struct LDKCVec_UpdateAddHTLCZ {
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 LDKUpdateAddHTLC *data;
5339 * The number of elements pointed to by `data`.
5342 } LDKCVec_UpdateAddHTLCZ;
5347 * An update_fulfill_htlc message to be sent or received from a peer
5349 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
5351 * A pointer to the opaque Rust object.
5352 * Nearly everywhere, inner must be non-null, however in places where
5353 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5355 LDKnativeUpdateFulfillHTLC *inner;
5357 * Indicates that this is the only struct which contains the same pointer.
5358 * Rust functions which take ownership of an object provided via an argument require
5359 * this to be true and invalidate the object pointed to by inner.
5362 } LDKUpdateFulfillHTLC;
5365 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
5366 * This corresponds to std::vector in C++
5368 typedef struct LDKCVec_UpdateFulfillHTLCZ {
5370 * The elements in the array.
5371 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5373 struct LDKUpdateFulfillHTLC *data;
5375 * The number of elements pointed to by `data`.
5378 } LDKCVec_UpdateFulfillHTLCZ;
5383 * An update_fail_htlc message to be sent or received from a peer
5385 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
5387 * A pointer to the opaque Rust object.
5388 * Nearly everywhere, inner must be non-null, however in places where
5389 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5391 LDKnativeUpdateFailHTLC *inner;
5393 * Indicates that this is the only struct which contains the same pointer.
5394 * Rust functions which take ownership of an object provided via an argument require
5395 * this to be true and invalidate the object pointed to by inner.
5398 } LDKUpdateFailHTLC;
5401 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
5402 * This corresponds to std::vector in C++
5404 typedef struct LDKCVec_UpdateFailHTLCZ {
5406 * The elements in the array.
5407 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5409 struct LDKUpdateFailHTLC *data;
5411 * The number of elements pointed to by `data`.
5414 } LDKCVec_UpdateFailHTLCZ;
5419 * An update_fail_malformed_htlc message to be sent or received from a peer
5421 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
5423 * A pointer to the opaque Rust object.
5424 * Nearly everywhere, inner must be non-null, however in places where
5425 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5427 LDKnativeUpdateFailMalformedHTLC *inner;
5429 * Indicates that this is the only struct which contains the same pointer.
5430 * Rust functions which take ownership of an object provided via an argument require
5431 * this to be true and invalidate the object pointed to by inner.
5434 } LDKUpdateFailMalformedHTLC;
5437 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
5438 * This corresponds to std::vector in C++
5440 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
5442 * The elements in the array.
5443 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5445 struct LDKUpdateFailMalformedHTLC *data;
5447 * The number of elements pointed to by `data`.
5450 } LDKCVec_UpdateFailMalformedHTLCZ;
5453 * The contents of CResult_AcceptChannelDecodeErrorZ
5455 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
5457 * A pointer to the contents in the success state.
5458 * Reading from this pointer when `result_ok` is not set is undefined.
5460 struct LDKAcceptChannel *result;
5462 * A pointer to the contents in the error state.
5463 * Reading from this pointer when `result_ok` is set is undefined.
5465 struct LDKDecodeError *err;
5466 } LDKCResult_AcceptChannelDecodeErrorZPtr;
5469 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
5470 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
5471 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5473 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
5475 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
5476 * `err` or `result` depending on the state of `result_ok`.
5478 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
5480 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
5483 } LDKCResult_AcceptChannelDecodeErrorZ;
5486 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
5488 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
5490 * A pointer to the contents in the success state.
5491 * Reading from this pointer when `result_ok` is not set is undefined.
5493 struct LDKAnnouncementSignatures *result;
5495 * A pointer to the contents in the error state.
5496 * Reading from this pointer when `result_ok` is set is undefined.
5498 struct LDKDecodeError *err;
5499 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
5502 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
5503 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5504 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5506 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
5508 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
5509 * `err` or `result` depending on the state of `result_ok`.
5511 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
5513 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
5516 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
5519 * The contents of CResult_ChannelReestablishDecodeErrorZ
5521 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
5523 * A pointer to the contents in the success state.
5524 * Reading from this pointer when `result_ok` is not set is undefined.
5526 struct LDKChannelReestablish *result;
5528 * A pointer to the contents in the error state.
5529 * Reading from this pointer when `result_ok` is set is undefined.
5531 struct LDKDecodeError *err;
5532 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
5535 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
5536 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
5537 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5539 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
5541 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
5542 * `err` or `result` depending on the state of `result_ok`.
5544 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
5546 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
5549 } LDKCResult_ChannelReestablishDecodeErrorZ;
5552 * The contents of CResult_ClosingSignedDecodeErrorZ
5554 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
5556 * A pointer to the contents in the success state.
5557 * Reading from this pointer when `result_ok` is not set is undefined.
5559 struct LDKClosingSigned *result;
5561 * A pointer to the contents in the error state.
5562 * Reading from this pointer when `result_ok` is set is undefined.
5564 struct LDKDecodeError *err;
5565 } LDKCResult_ClosingSignedDecodeErrorZPtr;
5568 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
5569 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
5570 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5572 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
5574 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
5575 * `err` or `result` depending on the state of `result_ok`.
5577 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
5579 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
5582 } LDKCResult_ClosingSignedDecodeErrorZ;
5587 * A commitment_signed message to be sent or received from a peer
5589 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
5591 * A pointer to the opaque Rust object.
5592 * Nearly everywhere, inner must be non-null, however in places where
5593 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5595 LDKnativeCommitmentSigned *inner;
5597 * Indicates that this is the only struct which contains the same pointer.
5598 * Rust functions which take ownership of an object provided via an argument require
5599 * this to be true and invalidate the object pointed to by inner.
5602 } LDKCommitmentSigned;
5605 * The contents of CResult_CommitmentSignedDecodeErrorZ
5607 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
5609 * A pointer to the contents in the success state.
5610 * Reading from this pointer when `result_ok` is not set is undefined.
5612 struct LDKCommitmentSigned *result;
5614 * A pointer to the contents in the error state.
5615 * Reading from this pointer when `result_ok` is set is undefined.
5617 struct LDKDecodeError *err;
5618 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
5621 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
5622 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
5623 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5625 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
5627 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
5628 * `err` or `result` depending on the state of `result_ok`.
5630 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
5632 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
5635 } LDKCResult_CommitmentSignedDecodeErrorZ;
5638 * The contents of CResult_FundingCreatedDecodeErrorZ
5640 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
5642 * A pointer to the contents in the success state.
5643 * Reading from this pointer when `result_ok` is not set is undefined.
5645 struct LDKFundingCreated *result;
5647 * A pointer to the contents in the error state.
5648 * Reading from this pointer when `result_ok` is set is undefined.
5650 struct LDKDecodeError *err;
5651 } LDKCResult_FundingCreatedDecodeErrorZPtr;
5654 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
5655 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
5656 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5658 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
5660 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
5661 * `err` or `result` depending on the state of `result_ok`.
5663 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
5665 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
5668 } LDKCResult_FundingCreatedDecodeErrorZ;
5671 * The contents of CResult_FundingSignedDecodeErrorZ
5673 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
5675 * A pointer to the contents in the success state.
5676 * Reading from this pointer when `result_ok` is not set is undefined.
5678 struct LDKFundingSigned *result;
5680 * A pointer to the contents in the error state.
5681 * Reading from this pointer when `result_ok` is set is undefined.
5683 struct LDKDecodeError *err;
5684 } LDKCResult_FundingSignedDecodeErrorZPtr;
5687 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
5688 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
5689 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5691 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
5693 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
5694 * `err` or `result` depending on the state of `result_ok`.
5696 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
5698 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
5701 } LDKCResult_FundingSignedDecodeErrorZ;
5704 * The contents of CResult_FundingLockedDecodeErrorZ
5706 typedef union LDKCResult_FundingLockedDecodeErrorZPtr {
5708 * A pointer to the contents in the success state.
5709 * Reading from this pointer when `result_ok` is not set is undefined.
5711 struct LDKFundingLocked *result;
5713 * A pointer to the contents in the error state.
5714 * Reading from this pointer when `result_ok` is set is undefined.
5716 struct LDKDecodeError *err;
5717 } LDKCResult_FundingLockedDecodeErrorZPtr;
5720 * A CResult_FundingLockedDecodeErrorZ represents the result of a fallible operation,
5721 * containing a crate::lightning::ln::msgs::FundingLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
5722 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5724 typedef struct LDKCResult_FundingLockedDecodeErrorZ {
5726 * The contents of this CResult_FundingLockedDecodeErrorZ, accessible via either
5727 * `err` or `result` depending on the state of `result_ok`.
5729 union LDKCResult_FundingLockedDecodeErrorZPtr contents;
5731 * Whether this CResult_FundingLockedDecodeErrorZ represents a success state.
5734 } LDKCResult_FundingLockedDecodeErrorZ;
5739 * An init message to be sent or received from a peer
5741 typedef struct MUST_USE_STRUCT LDKInit {
5743 * A pointer to the opaque Rust object.
5744 * Nearly everywhere, inner must be non-null, however in places where
5745 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5747 LDKnativeInit *inner;
5749 * Indicates that this is the only struct which contains the same pointer.
5750 * Rust functions which take ownership of an object provided via an argument require
5751 * this to be true and invalidate the object pointed to by inner.
5757 * The contents of CResult_InitDecodeErrorZ
5759 typedef union LDKCResult_InitDecodeErrorZPtr {
5761 * A pointer to the contents in the success state.
5762 * Reading from this pointer when `result_ok` is not set is undefined.
5764 struct LDKInit *result;
5766 * A pointer to the contents in the error state.
5767 * Reading from this pointer when `result_ok` is set is undefined.
5769 struct LDKDecodeError *err;
5770 } LDKCResult_InitDecodeErrorZPtr;
5773 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
5774 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
5775 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5777 typedef struct LDKCResult_InitDecodeErrorZ {
5779 * The contents of this CResult_InitDecodeErrorZ, accessible via either
5780 * `err` or `result` depending on the state of `result_ok`.
5782 union LDKCResult_InitDecodeErrorZPtr contents;
5784 * Whether this CResult_InitDecodeErrorZ represents a success state.
5787 } LDKCResult_InitDecodeErrorZ;
5790 * The contents of CResult_OpenChannelDecodeErrorZ
5792 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
5794 * A pointer to the contents in the success state.
5795 * Reading from this pointer when `result_ok` is not set is undefined.
5797 struct LDKOpenChannel *result;
5799 * A pointer to the contents in the error state.
5800 * Reading from this pointer when `result_ok` is set is undefined.
5802 struct LDKDecodeError *err;
5803 } LDKCResult_OpenChannelDecodeErrorZPtr;
5806 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
5807 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
5808 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5810 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
5812 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
5813 * `err` or `result` depending on the state of `result_ok`.
5815 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
5817 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
5820 } LDKCResult_OpenChannelDecodeErrorZ;
5823 * The contents of CResult_RevokeAndACKDecodeErrorZ
5825 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
5827 * A pointer to the contents in the success state.
5828 * Reading from this pointer when `result_ok` is not set is undefined.
5830 struct LDKRevokeAndACK *result;
5832 * A pointer to the contents in the error state.
5833 * Reading from this pointer when `result_ok` is set is undefined.
5835 struct LDKDecodeError *err;
5836 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
5839 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
5840 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
5841 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5843 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
5845 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
5846 * `err` or `result` depending on the state of `result_ok`.
5848 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
5850 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
5853 } LDKCResult_RevokeAndACKDecodeErrorZ;
5856 * The contents of CResult_ShutdownDecodeErrorZ
5858 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
5860 * A pointer to the contents in the success state.
5861 * Reading from this pointer when `result_ok` is not set is undefined.
5863 struct LDKShutdown *result;
5865 * A pointer to the contents in the error state.
5866 * Reading from this pointer when `result_ok` is set is undefined.
5868 struct LDKDecodeError *err;
5869 } LDKCResult_ShutdownDecodeErrorZPtr;
5872 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
5873 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
5874 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5876 typedef struct LDKCResult_ShutdownDecodeErrorZ {
5878 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
5879 * `err` or `result` depending on the state of `result_ok`.
5881 union LDKCResult_ShutdownDecodeErrorZPtr contents;
5883 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
5886 } LDKCResult_ShutdownDecodeErrorZ;
5889 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
5891 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
5893 * A pointer to the contents in the success state.
5894 * Reading from this pointer when `result_ok` is not set is undefined.
5896 struct LDKUpdateFailHTLC *result;
5898 * A pointer to the contents in the error state.
5899 * Reading from this pointer when `result_ok` is set is undefined.
5901 struct LDKDecodeError *err;
5902 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
5905 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
5906 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5907 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5909 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
5911 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
5912 * `err` or `result` depending on the state of `result_ok`.
5914 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
5916 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
5919 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
5922 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
5924 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5926 * A pointer to the contents in the success state.
5927 * Reading from this pointer when `result_ok` is not set is undefined.
5929 struct LDKUpdateFailMalformedHTLC *result;
5931 * A pointer to the contents in the error state.
5932 * Reading from this pointer when `result_ok` is set is undefined.
5934 struct LDKDecodeError *err;
5935 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
5938 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
5939 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5940 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5942 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
5944 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
5945 * `err` or `result` depending on the state of `result_ok`.
5947 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
5949 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
5952 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
5957 * An update_fee message to be sent or received from a peer
5959 typedef struct MUST_USE_STRUCT LDKUpdateFee {
5961 * A pointer to the opaque Rust object.
5962 * Nearly everywhere, inner must be non-null, however in places where
5963 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5965 LDKnativeUpdateFee *inner;
5967 * Indicates that this is the only struct which contains the same pointer.
5968 * Rust functions which take ownership of an object provided via an argument require
5969 * this to be true and invalidate the object pointed to by inner.
5975 * The contents of CResult_UpdateFeeDecodeErrorZ
5977 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
5979 * A pointer to the contents in the success state.
5980 * Reading from this pointer when `result_ok` is not set is undefined.
5982 struct LDKUpdateFee *result;
5984 * A pointer to the contents in the error state.
5985 * Reading from this pointer when `result_ok` is set is undefined.
5987 struct LDKDecodeError *err;
5988 } LDKCResult_UpdateFeeDecodeErrorZPtr;
5991 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
5992 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
5993 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5995 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
5997 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
5998 * `err` or `result` depending on the state of `result_ok`.
6000 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
6002 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
6005 } LDKCResult_UpdateFeeDecodeErrorZ;
6008 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
6010 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
6012 * A pointer to the contents in the success state.
6013 * Reading from this pointer when `result_ok` is not set is undefined.
6015 struct LDKUpdateFulfillHTLC *result;
6017 * A pointer to the contents in the error state.
6018 * Reading from this pointer when `result_ok` is set is undefined.
6020 struct LDKDecodeError *err;
6021 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
6024 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
6025 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
6026 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6028 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
6030 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
6031 * `err` or `result` depending on the state of `result_ok`.
6033 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
6035 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
6038 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
6041 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
6043 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
6045 * A pointer to the contents in the success state.
6046 * Reading from this pointer when `result_ok` is not set is undefined.
6048 struct LDKUpdateAddHTLC *result;
6050 * A pointer to the contents in the error state.
6051 * Reading from this pointer when `result_ok` is set is undefined.
6053 struct LDKDecodeError *err;
6054 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
6057 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
6058 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
6059 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6061 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
6063 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
6064 * `err` or `result` depending on the state of `result_ok`.
6066 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
6068 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
6071 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
6076 * A ping message to be sent or received from a peer
6078 typedef struct MUST_USE_STRUCT LDKPing {
6080 * A pointer to the opaque Rust object.
6081 * Nearly everywhere, inner must be non-null, however in places where
6082 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6084 LDKnativePing *inner;
6086 * Indicates that this is the only struct which contains the same pointer.
6087 * Rust functions which take ownership of an object provided via an argument require
6088 * this to be true and invalidate the object pointed to by inner.
6094 * The contents of CResult_PingDecodeErrorZ
6096 typedef union LDKCResult_PingDecodeErrorZPtr {
6098 * A pointer to the contents in the success state.
6099 * Reading from this pointer when `result_ok` is not set is undefined.
6101 struct LDKPing *result;
6103 * A pointer to the contents in the error state.
6104 * Reading from this pointer when `result_ok` is set is undefined.
6106 struct LDKDecodeError *err;
6107 } LDKCResult_PingDecodeErrorZPtr;
6110 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
6111 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
6112 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6114 typedef struct LDKCResult_PingDecodeErrorZ {
6116 * The contents of this CResult_PingDecodeErrorZ, accessible via either
6117 * `err` or `result` depending on the state of `result_ok`.
6119 union LDKCResult_PingDecodeErrorZPtr contents;
6121 * Whether this CResult_PingDecodeErrorZ represents a success state.
6124 } LDKCResult_PingDecodeErrorZ;
6129 * A pong message to be sent or received from a peer
6131 typedef struct MUST_USE_STRUCT LDKPong {
6133 * A pointer to the opaque Rust object.
6134 * Nearly everywhere, inner must be non-null, however in places where
6135 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6137 LDKnativePong *inner;
6139 * Indicates that this is the only struct which contains the same pointer.
6140 * Rust functions which take ownership of an object provided via an argument require
6141 * this to be true and invalidate the object pointed to by inner.
6147 * The contents of CResult_PongDecodeErrorZ
6149 typedef union LDKCResult_PongDecodeErrorZPtr {
6151 * A pointer to the contents in the success state.
6152 * Reading from this pointer when `result_ok` is not set is undefined.
6154 struct LDKPong *result;
6156 * A pointer to the contents in the error state.
6157 * Reading from this pointer when `result_ok` is set is undefined.
6159 struct LDKDecodeError *err;
6160 } LDKCResult_PongDecodeErrorZPtr;
6163 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
6164 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
6165 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6167 typedef struct LDKCResult_PongDecodeErrorZ {
6169 * The contents of this CResult_PongDecodeErrorZ, accessible via either
6170 * `err` or `result` depending on the state of `result_ok`.
6172 union LDKCResult_PongDecodeErrorZPtr contents;
6174 * Whether this CResult_PongDecodeErrorZ represents a success state.
6177 } LDKCResult_PongDecodeErrorZ;
6180 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
6182 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
6184 * A pointer to the contents in the success state.
6185 * Reading from this pointer when `result_ok` is not set is undefined.
6187 struct LDKUnsignedChannelAnnouncement *result;
6189 * A pointer to the contents in the error state.
6190 * Reading from this pointer when `result_ok` is set is undefined.
6192 struct LDKDecodeError *err;
6193 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
6196 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
6197 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
6198 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6200 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
6202 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
6203 * `err` or `result` depending on the state of `result_ok`.
6205 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
6207 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
6210 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
6213 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
6215 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
6217 * A pointer to the contents in the success state.
6218 * Reading from this pointer when `result_ok` is not set is undefined.
6220 struct LDKChannelAnnouncement *result;
6222 * A pointer to the contents in the error state.
6223 * Reading from this pointer when `result_ok` is set is undefined.
6225 struct LDKDecodeError *err;
6226 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
6229 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
6230 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
6231 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6233 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
6235 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
6236 * `err` or `result` depending on the state of `result_ok`.
6238 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
6240 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
6243 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
6248 * The unsigned part of a channel_update
6250 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
6252 * A pointer to the opaque Rust object.
6253 * Nearly everywhere, inner must be non-null, however in places where
6254 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6256 LDKnativeUnsignedChannelUpdate *inner;
6258 * Indicates that this is the only struct which contains the same pointer.
6259 * Rust functions which take ownership of an object provided via an argument require
6260 * this to be true and invalidate the object pointed to by inner.
6263 } LDKUnsignedChannelUpdate;
6266 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
6268 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
6270 * A pointer to the contents in the success state.
6271 * Reading from this pointer when `result_ok` is not set is undefined.
6273 struct LDKUnsignedChannelUpdate *result;
6275 * A pointer to the contents in the error state.
6276 * Reading from this pointer when `result_ok` is set is undefined.
6278 struct LDKDecodeError *err;
6279 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
6282 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
6283 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
6284 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6286 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
6288 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
6289 * `err` or `result` depending on the state of `result_ok`.
6291 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
6293 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
6296 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
6299 * The contents of CResult_ChannelUpdateDecodeErrorZ
6301 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
6303 * A pointer to the contents in the success state.
6304 * Reading from this pointer when `result_ok` is not set is undefined.
6306 struct LDKChannelUpdate *result;
6308 * A pointer to the contents in the error state.
6309 * Reading from this pointer when `result_ok` is set is undefined.
6311 struct LDKDecodeError *err;
6312 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
6315 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
6316 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
6317 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6319 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
6321 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
6322 * `err` or `result` depending on the state of `result_ok`.
6324 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
6326 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
6329 } LDKCResult_ChannelUpdateDecodeErrorZ;
6332 * The contents of CResult_ErrorMessageDecodeErrorZ
6334 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
6336 * A pointer to the contents in the success state.
6337 * Reading from this pointer when `result_ok` is not set is undefined.
6339 struct LDKErrorMessage *result;
6341 * A pointer to the contents in the error state.
6342 * Reading from this pointer when `result_ok` is set is undefined.
6344 struct LDKDecodeError *err;
6345 } LDKCResult_ErrorMessageDecodeErrorZPtr;
6348 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
6349 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
6350 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6352 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
6354 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
6355 * `err` or `result` depending on the state of `result_ok`.
6357 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
6359 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
6362 } LDKCResult_ErrorMessageDecodeErrorZ;
6367 * The unsigned part of a node_announcement
6369 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
6371 * A pointer to the opaque Rust object.
6372 * Nearly everywhere, inner must be non-null, however in places where
6373 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6375 LDKnativeUnsignedNodeAnnouncement *inner;
6377 * Indicates that this is the only struct which contains the same pointer.
6378 * Rust functions which take ownership of an object provided via an argument require
6379 * this to be true and invalidate the object pointed to by inner.
6382 } LDKUnsignedNodeAnnouncement;
6385 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
6387 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
6389 * A pointer to the contents in the success state.
6390 * Reading from this pointer when `result_ok` is not set is undefined.
6392 struct LDKUnsignedNodeAnnouncement *result;
6394 * A pointer to the contents in the error state.
6395 * Reading from this pointer when `result_ok` is set is undefined.
6397 struct LDKDecodeError *err;
6398 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
6401 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
6402 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
6403 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6405 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
6407 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
6408 * `err` or `result` depending on the state of `result_ok`.
6410 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
6412 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
6415 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
6418 * The contents of CResult_NodeAnnouncementDecodeErrorZ
6420 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
6422 * A pointer to the contents in the success state.
6423 * Reading from this pointer when `result_ok` is not set is undefined.
6425 struct LDKNodeAnnouncement *result;
6427 * A pointer to the contents in the error state.
6428 * Reading from this pointer when `result_ok` is set is undefined.
6430 struct LDKDecodeError *err;
6431 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
6434 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
6435 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
6436 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6438 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
6440 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
6441 * `err` or `result` depending on the state of `result_ok`.
6443 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
6445 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
6448 } LDKCResult_NodeAnnouncementDecodeErrorZ;
6451 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
6453 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
6455 * A pointer to the contents in the success state.
6456 * Reading from this pointer when `result_ok` is not set is undefined.
6458 struct LDKQueryShortChannelIds *result;
6460 * A pointer to the contents in the error state.
6461 * Reading from this pointer when `result_ok` is set is undefined.
6463 struct LDKDecodeError *err;
6464 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
6467 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
6468 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
6469 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6471 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
6473 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
6474 * `err` or `result` depending on the state of `result_ok`.
6476 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
6478 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
6481 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
6486 * A reply_short_channel_ids_end message is sent as a reply to a
6487 * query_short_channel_ids message. The query recipient makes a best
6488 * effort to respond based on their local network view which may not be
6489 * a perfect view of the network.
6491 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
6493 * A pointer to the opaque Rust object.
6494 * Nearly everywhere, inner must be non-null, however in places where
6495 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6497 LDKnativeReplyShortChannelIdsEnd *inner;
6499 * Indicates that this is the only struct which contains the same pointer.
6500 * Rust functions which take ownership of an object provided via an argument require
6501 * this to be true and invalidate the object pointed to by inner.
6504 } LDKReplyShortChannelIdsEnd;
6507 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
6509 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
6511 * A pointer to the contents in the success state.
6512 * Reading from this pointer when `result_ok` is not set is undefined.
6514 struct LDKReplyShortChannelIdsEnd *result;
6516 * A pointer to the contents in the error state.
6517 * Reading from this pointer when `result_ok` is set is undefined.
6519 struct LDKDecodeError *err;
6520 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
6523 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
6524 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
6525 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6527 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
6529 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
6530 * `err` or `result` depending on the state of `result_ok`.
6532 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
6534 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
6537 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
6540 * The contents of CResult_QueryChannelRangeDecodeErrorZ
6542 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
6544 * A pointer to the contents in the success state.
6545 * Reading from this pointer when `result_ok` is not set is undefined.
6547 struct LDKQueryChannelRange *result;
6549 * A pointer to the contents in the error state.
6550 * Reading from this pointer when `result_ok` is set is undefined.
6552 struct LDKDecodeError *err;
6553 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
6556 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
6557 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
6558 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6560 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
6562 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
6563 * `err` or `result` depending on the state of `result_ok`.
6565 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
6567 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
6570 } LDKCResult_QueryChannelRangeDecodeErrorZ;
6573 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
6575 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
6577 * A pointer to the contents in the success state.
6578 * Reading from this pointer when `result_ok` is not set is undefined.
6580 struct LDKReplyChannelRange *result;
6582 * A pointer to the contents in the error state.
6583 * Reading from this pointer when `result_ok` is set is undefined.
6585 struct LDKDecodeError *err;
6586 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
6589 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
6590 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
6591 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6593 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
6595 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
6596 * `err` or `result` depending on the state of `result_ok`.
6598 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
6600 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
6603 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
6608 * A gossip_timestamp_filter message is used by a node to request
6609 * gossip relay for messages in the requested time range when the
6610 * gossip_queries feature has been negotiated.
6612 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
6614 * A pointer to the opaque Rust object.
6615 * Nearly everywhere, inner must be non-null, however in places where
6616 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6618 LDKnativeGossipTimestampFilter *inner;
6620 * Indicates that this is the only struct which contains the same pointer.
6621 * Rust functions which take ownership of an object provided via an argument require
6622 * this to be true and invalidate the object pointed to by inner.
6625 } LDKGossipTimestampFilter;
6628 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
6630 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
6632 * A pointer to the contents in the success state.
6633 * Reading from this pointer when `result_ok` is not set is undefined.
6635 struct LDKGossipTimestampFilter *result;
6637 * A pointer to the contents in the error state.
6638 * Reading from this pointer when `result_ok` is set is undefined.
6640 struct LDKDecodeError *err;
6641 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
6644 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
6645 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
6646 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6648 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
6650 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
6651 * `err` or `result` depending on the state of `result_ok`.
6653 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
6655 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
6658 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
6661 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
6663 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
6665 * A pointer to the contents in the success state.
6666 * Reading from this pointer when `result_ok` is not set is undefined.
6668 struct LDKSpendableOutputDescriptor *result;
6670 * A pointer to the contents in the error state.
6671 * Reading from this pointer when `result_ok` is set is undefined.
6673 struct LDKDecodeError *err;
6674 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
6677 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
6678 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
6679 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6681 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
6683 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
6684 * `err` or `result` depending on the state of `result_ok`.
6686 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
6688 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
6691 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
6694 * The contents of CResult_SignDecodeErrorZ
6696 typedef union LDKCResult_SignDecodeErrorZPtr {
6698 * A pointer to the contents in the success state.
6699 * Reading from this pointer when `result_ok` is not set is undefined.
6701 struct LDKSign *result;
6703 * A pointer to the contents in the error state.
6704 * Reading from this pointer when `result_ok` is set is undefined.
6706 struct LDKDecodeError *err;
6707 } LDKCResult_SignDecodeErrorZPtr;
6710 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
6711 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
6712 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6714 typedef struct LDKCResult_SignDecodeErrorZ {
6716 * The contents of this CResult_SignDecodeErrorZ, accessible via either
6717 * `err` or `result` depending on the state of `result_ok`.
6719 union LDKCResult_SignDecodeErrorZPtr contents;
6721 * Whether this CResult_SignDecodeErrorZ represents a success state.
6724 } LDKCResult_SignDecodeErrorZ;
6727 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
6728 * This corresponds to std::vector in C++
6730 typedef struct LDKCVec_CVec_u8ZZ {
6732 * The elements in the array.
6733 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6735 struct LDKCVec_u8Z *data;
6737 * The number of elements pointed to by `data`.
6740 } LDKCVec_CVec_u8ZZ;
6743 * The contents of CResult_CVec_CVec_u8ZZNoneZ
6745 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
6747 * A pointer to the contents in the success state.
6748 * Reading from this pointer when `result_ok` is not set is undefined.
6750 struct LDKCVec_CVec_u8ZZ *result;
6752 * Note that this value is always NULL, as there are no contents in the Err variant
6755 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
6758 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
6759 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
6760 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6762 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
6764 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
6765 * `err` or `result` depending on the state of `result_ok`.
6767 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
6769 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
6772 } LDKCResult_CVec_CVec_u8ZZNoneZ;
6777 * A simple implementation of Sign that just keeps the private keys in memory.
6779 * This implementation performs no policy checks and is insufficient by itself as
6780 * a secure external signer.
6782 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
6784 * A pointer to the opaque Rust object.
6785 * Nearly everywhere, inner must be non-null, however in places where
6786 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6788 LDKnativeInMemorySigner *inner;
6790 * Indicates that this is the only struct which contains the same pointer.
6791 * Rust functions which take ownership of an object provided via an argument require
6792 * this to be true and invalidate the object pointed to by inner.
6795 } LDKInMemorySigner;
6798 * The contents of CResult_InMemorySignerDecodeErrorZ
6800 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
6802 * A pointer to the contents in the success state.
6803 * Reading from this pointer when `result_ok` is not set is undefined.
6805 struct LDKInMemorySigner *result;
6807 * A pointer to the contents in the error state.
6808 * Reading from this pointer when `result_ok` is set is undefined.
6810 struct LDKDecodeError *err;
6811 } LDKCResult_InMemorySignerDecodeErrorZPtr;
6814 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
6815 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
6816 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6818 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
6820 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
6821 * `err` or `result` depending on the state of `result_ok`.
6823 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
6825 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
6828 } LDKCResult_InMemorySignerDecodeErrorZ;
6831 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
6832 * This corresponds to std::vector in C++
6834 typedef struct LDKCVec_TxOutZ {
6836 * The elements in the array.
6837 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6839 struct LDKTxOut *data;
6841 * The number of elements pointed to by `data`.
6847 * The contents of CResult_TransactionNoneZ
6849 typedef union LDKCResult_TransactionNoneZPtr {
6851 * A pointer to the contents in the success state.
6852 * Reading from this pointer when `result_ok` is not set is undefined.
6854 struct LDKTransaction *result;
6856 * Note that this value is always NULL, as there are no contents in the Err variant
6859 } LDKCResult_TransactionNoneZPtr;
6862 * A CResult_TransactionNoneZ represents the result of a fallible operation,
6863 * containing a crate::c_types::Transaction on success and a () on failure.
6864 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6866 typedef struct LDKCResult_TransactionNoneZ {
6868 * The contents of this CResult_TransactionNoneZ, accessible via either
6869 * `err` or `result` depending on the state of `result_ok`.
6871 union LDKCResult_TransactionNoneZPtr contents;
6873 * Whether this CResult_TransactionNoneZ represents a success state.
6876 } LDKCResult_TransactionNoneZ;
6879 * The contents of CResult_NoneErrorZ
6881 typedef union LDKCResult_NoneErrorZPtr {
6883 * Note that this value is always NULL, as there are no contents in the OK variant
6887 * A pointer to the contents in the error state.
6888 * Reading from this pointer when `result_ok` is set is undefined.
6890 enum LDKIOError *err;
6891 } LDKCResult_NoneErrorZPtr;
6894 * A CResult_NoneErrorZ represents the result of a fallible operation,
6895 * containing a () on success and a crate::c_types::IOError on failure.
6896 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6898 typedef struct LDKCResult_NoneErrorZ {
6900 * The contents of this CResult_NoneErrorZ, accessible via either
6901 * `err` or `result` depending on the state of `result_ok`.
6903 union LDKCResult_NoneErrorZPtr contents;
6905 * Whether this CResult_NoneErrorZ represents a success state.
6908 } LDKCResult_NoneErrorZ;
6911 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
6912 * This corresponds to std::vector in C++
6914 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
6916 * The elements in the array.
6917 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6919 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
6921 * The number of elements pointed to by `data`.
6924 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
6927 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
6929 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
6931 * A pointer to the contents in the success state.
6932 * Reading from this pointer when `result_ok` is not set is undefined.
6934 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
6936 * A pointer to the contents in the error state.
6937 * Reading from this pointer when `result_ok` is set is undefined.
6939 enum LDKIOError *err;
6940 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
6943 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
6944 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
6945 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6947 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
6949 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
6950 * `err` or `result` depending on the state of `result_ok`.
6952 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
6954 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
6957 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
6960 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
6963 typedef enum LDKAPIError_Tag {
6965 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
6966 * are documented, but generally indicates some precondition of a function was violated.
6968 LDKAPIError_APIMisuseError,
6970 * Due to a high feerate, we were unable to complete the request.
6971 * For example, this may be returned if the feerate implies we cannot open a channel at the
6972 * requested value, but opening a larger channel would succeed.
6974 LDKAPIError_FeeRateTooHigh,
6976 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
6977 * too-many-hops, etc).
6979 LDKAPIError_RouteError,
6981 * We were unable to complete the request as the Channel required to do so is unable to
6982 * complete the request (or was not found). This can take many forms, including disconnected
6983 * peer, channel at capacity, channel shutting down, etc.
6985 LDKAPIError_ChannelUnavailable,
6987 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
6988 * attempted action to fail.
6990 LDKAPIError_MonitorUpdateFailed,
6992 * Must be last for serialization purposes
6994 LDKAPIError_Sentinel,
6997 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
6999 * A human-readable error message
7001 struct LDKCVec_u8Z err;
7002 } LDKAPIError_LDKAPIMisuseError_Body;
7004 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
7006 * A human-readable error message
7008 struct LDKCVec_u8Z err;
7010 * The feerate which was too high.
7013 } LDKAPIError_LDKFeeRateTooHigh_Body;
7015 typedef struct LDKAPIError_LDKRouteError_Body {
7017 * A human-readable error message
7020 } LDKAPIError_LDKRouteError_Body;
7022 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
7024 * A human-readable error message
7026 struct LDKCVec_u8Z err;
7027 } LDKAPIError_LDKChannelUnavailable_Body;
7029 typedef struct MUST_USE_STRUCT LDKAPIError {
7030 LDKAPIError_Tag tag;
7032 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
7033 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
7034 LDKAPIError_LDKRouteError_Body route_error;
7035 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
7040 * The contents of CResult_NoneAPIErrorZ
7042 typedef union LDKCResult_NoneAPIErrorZPtr {
7044 * Note that this value is always NULL, as there are no contents in the OK variant
7048 * A pointer to the contents in the error state.
7049 * Reading from this pointer when `result_ok` is set is undefined.
7051 struct LDKAPIError *err;
7052 } LDKCResult_NoneAPIErrorZPtr;
7055 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
7056 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
7057 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7059 typedef struct LDKCResult_NoneAPIErrorZ {
7061 * The contents of this CResult_NoneAPIErrorZ, accessible via either
7062 * `err` or `result` depending on the state of `result_ok`.
7064 union LDKCResult_NoneAPIErrorZPtr contents;
7066 * Whether this CResult_NoneAPIErrorZ represents a success state.
7069 } LDKCResult_NoneAPIErrorZ;
7072 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
7073 * This corresponds to std::vector in C++
7075 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
7077 * The elements in the array.
7078 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7080 struct LDKCResult_NoneAPIErrorZ *data;
7082 * The number of elements pointed to by `data`.
7085 } LDKCVec_CResult_NoneAPIErrorZZ;
7088 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
7089 * This corresponds to std::vector in C++
7091 typedef struct LDKCVec_APIErrorZ {
7093 * The elements in the array.
7094 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7096 struct LDKAPIError *data;
7098 * The number of elements pointed to by `data`.
7101 } LDKCVec_APIErrorZ;
7104 * If a payment fails to send, it can be in one of several states. This enum is returned as the
7105 * Err() type describing which state the payment is in, see the description of individual enum
7108 typedef enum LDKPaymentSendFailure_Tag {
7110 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
7111 * send the payment at all. No channel state has been changed or messages sent to peers, and
7112 * once you've changed the parameter at error, you can freely retry the payment in full.
7114 LDKPaymentSendFailure_ParameterError,
7116 * A parameter in a single path which was passed to send_payment was invalid, preventing us
7117 * from attempting to send the payment at all. No channel state has been changed or messages
7118 * sent to peers, and once you've changed the parameter at error, you can freely retry the
7121 * The results here are ordered the same as the paths in the route object which was passed to
7124 LDKPaymentSendFailure_PathParameterError,
7126 * All paths which were attempted failed to send, with no channel state change taking place.
7127 * You can freely retry the payment in full (though you probably want to do so over different
7128 * paths than the ones selected).
7130 LDKPaymentSendFailure_AllFailedRetrySafe,
7132 * Some paths which were attempted failed to send, though possibly not all. At least some
7133 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
7134 * in over-/re-payment.
7136 * The results here are ordered the same as the paths in the route object which was passed to
7137 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
7138 * retried (though there is currently no API with which to do so).
7140 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
7141 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
7142 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
7143 * with the latest update_id.
7145 LDKPaymentSendFailure_PartialFailure,
7147 * Must be last for serialization purposes
7149 LDKPaymentSendFailure_Sentinel,
7150 } LDKPaymentSendFailure_Tag;
7152 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
7153 LDKPaymentSendFailure_Tag tag;
7156 struct LDKAPIError parameter_error;
7159 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
7162 struct LDKCVec_APIErrorZ all_failed_retry_safe;
7165 struct LDKCVec_CResult_NoneAPIErrorZZ partial_failure;
7168 } LDKPaymentSendFailure;
7171 * The contents of CResult_NonePaymentSendFailureZ
7173 typedef union LDKCResult_NonePaymentSendFailureZPtr {
7175 * Note that this value is always NULL, as there are no contents in the OK variant
7179 * A pointer to the contents in the error state.
7180 * Reading from this pointer when `result_ok` is set is undefined.
7182 struct LDKPaymentSendFailure *err;
7183 } LDKCResult_NonePaymentSendFailureZPtr;
7186 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
7187 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
7188 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7190 typedef struct LDKCResult_NonePaymentSendFailureZ {
7192 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
7193 * `err` or `result` depending on the state of `result_ok`.
7195 union LDKCResult_NonePaymentSendFailureZPtr contents;
7197 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
7200 } LDKCResult_NonePaymentSendFailureZ;
7203 * A tuple of 2 elements. See the individual fields for the types contained.
7205 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
7207 * The element at position 0
7209 struct LDKThirtyTwoBytes a;
7211 * The element at position 1
7213 struct LDKThirtyTwoBytes b;
7214 } LDKC2Tuple_PaymentHashPaymentSecretZ;
7217 * The contents of CResult_PaymentSecretAPIErrorZ
7219 typedef union LDKCResult_PaymentSecretAPIErrorZPtr {
7221 * A pointer to the contents in the success state.
7222 * Reading from this pointer when `result_ok` is not set is undefined.
7224 struct LDKThirtyTwoBytes *result;
7226 * A pointer to the contents in the error state.
7227 * Reading from this pointer when `result_ok` is set is undefined.
7229 struct LDKAPIError *err;
7230 } LDKCResult_PaymentSecretAPIErrorZPtr;
7233 * A CResult_PaymentSecretAPIErrorZ represents the result of a fallible operation,
7234 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7235 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7237 typedef struct LDKCResult_PaymentSecretAPIErrorZ {
7239 * The contents of this CResult_PaymentSecretAPIErrorZ, accessible via either
7240 * `err` or `result` depending on the state of `result_ok`.
7242 union LDKCResult_PaymentSecretAPIErrorZPtr contents;
7244 * Whether this CResult_PaymentSecretAPIErrorZ represents a success state.
7247 } LDKCResult_PaymentSecretAPIErrorZ;
7250 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
7251 * This corresponds to std::vector in C++
7253 typedef struct LDKCVec_ChannelMonitorZ {
7255 * The elements in the array.
7256 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7258 struct LDKChannelMonitor *data;
7260 * The number of elements pointed to by `data`.
7263 } LDKCVec_ChannelMonitorZ;
7266 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
7267 * blocks are connected and disconnected.
7269 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
7270 * responsible for maintaining a set of monitors such that they can be updated accordingly as
7271 * channel state changes and HTLCs are resolved. See method documentation for specific
7274 * Implementations **must** ensure that updates are successfully applied and persisted upon method
7275 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
7276 * without taking any further action such as persisting the current state.
7278 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
7279 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
7280 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
7281 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
7282 * multiple instances.
7284 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
7285 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
7286 * [`PermanentFailure`]: channelmonitor::ChannelMonitorUpdateErr::PermanentFailure
7288 typedef struct LDKWatch {
7290 * An opaque pointer which is passed to your function implementations as an argument.
7291 * This has no meaning in the LDK, and can be NULL or any other value.
7295 * Watches a channel identified by `funding_txo` using `monitor`.
7297 * Implementations are responsible for watching the chain for the funding transaction along
7298 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
7299 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
7301 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
7302 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
7303 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
7305 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
7307 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
7309 * Implementations must call [`update_monitor`] with the given update. See
7310 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
7312 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
7313 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
7315 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
7317 * Returns any monitor events since the last call. Subsequent calls must only return new
7320 struct LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
7322 * Frees any resources associated with this object given its this_arg pointer.
7323 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7325 void (*free)(void *this_arg);
7329 * An interface to send a transaction to the Bitcoin network.
7331 typedef struct LDKBroadcasterInterface {
7333 * An opaque pointer which is passed to your function implementations as an argument.
7334 * This has no meaning in the LDK, and can be NULL or any other value.
7338 * Sends a transaction out to (hopefully) be mined.
7340 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
7342 * Frees any resources associated with this object given its this_arg pointer.
7343 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7345 void (*free)(void *this_arg);
7346 } LDKBroadcasterInterface;
7349 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
7350 * own the memory pointed to by data.
7352 typedef struct LDKu8slice {
7354 * A pointer to the byte buffer
7356 const uint8_t *data;
7358 * The number of bytes pointed to by `data`.
7364 * A trait to describe an object which can get user secrets and key material.
7366 typedef struct LDKKeysInterface {
7368 * An opaque pointer which is passed to your function implementations as an argument.
7369 * This has no meaning in the LDK, and can be NULL or any other value.
7373 * Get node secret key (aka node_id or network_key).
7375 * This method must return the same value each time it is called.
7377 struct LDKSecretKey (*get_node_secret)(const void *this_arg);
7379 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
7381 * This method should return a different value each time it is called, to avoid linking
7382 * on-chain funds across channels as controlled to the same user.
7384 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
7386 * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing
7389 * This method should return a different value each time it is called, to avoid linking
7390 * on-chain funds across channels as controlled to the same user.
7392 struct LDKPublicKey (*get_shutdown_pubkey)(const void *this_arg);
7394 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
7395 * restarted with some stale data!
7397 * This method must return a different value each time it is called.
7399 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
7401 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
7402 * onion packets and for temporary channel IDs. There is no requirement that these be
7403 * persisted anywhere, though they must be unique across restarts.
7405 * This method must return a different value each time it is called.
7407 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
7409 * Reads a `Signer` for this `KeysInterface` from the given input stream.
7410 * This is only called during deserialization of other objects which contain
7411 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
7412 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
7413 * contain no versioning scheme. You may wish to include your own version prefix and ensure
7414 * you've read all of the provided bytes to ensure no corruption occurred.
7416 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
7418 * Frees any resources associated with this object given its this_arg pointer.
7419 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7421 void (*free)(void *this_arg);
7425 * A trait which should be implemented to provide feerate information on a number of time
7428 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
7429 * called from inside the library in response to chain events, P2P events, or timer events).
7431 typedef struct LDKFeeEstimator {
7433 * An opaque pointer which is passed to your function implementations as an argument.
7434 * This has no meaning in the LDK, and can be NULL or any other value.
7438 * Gets estimated satoshis of fee required per 1000 Weight-Units.
7440 * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
7441 * don't put us below 1 satoshi-per-byte).
7443 * This translates to:
7444 * * satoshis-per-byte * 250
7445 * * ceil(satoshis-per-kbyte / 4)
7447 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
7449 * Frees any resources associated with this object given its this_arg pointer.
7450 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7452 void (*free)(void *this_arg);
7456 * A trait encapsulating the operations required of a logger
7458 typedef struct LDKLogger {
7460 * An opaque pointer which is passed to your function implementations as an argument.
7461 * This has no meaning in the LDK, and can be NULL or any other value.
7467 void (*log)(const void *this_arg, const char *record);
7469 * Frees any resources associated with this object given its this_arg pointer.
7470 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7472 void (*free)(void *this_arg);
7478 * Manager which keeps track of a number of channels and sends messages to the appropriate
7479 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
7481 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
7482 * to individual Channels.
7484 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
7485 * all peers during write/read (though does not modify this instance, only the instance being
7486 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
7487 * called funding_transaction_generated for outbound channels).
7489 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
7490 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
7491 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
7492 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
7493 * the serialization process). If the deserialized version is out-of-date compared to the
7494 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
7495 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
7497 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
7498 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
7499 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
7500 * block_connected() to step towards your best block) upon deserialization before using the
7503 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
7504 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
7505 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
7506 * offline for a full minute. In order to track this, you must call
7507 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
7509 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
7510 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
7511 * essentially you should default to using a SimpleRefChannelManager, and use a
7512 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
7513 * you're using lightning-net-tokio.
7515 typedef struct MUST_USE_STRUCT LDKChannelManager {
7517 * A pointer to the opaque Rust object.
7518 * Nearly everywhere, inner must be non-null, however in places where
7519 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7521 LDKnativeChannelManager *inner;
7523 * Indicates that this is the only struct which contains the same pointer.
7524 * Rust functions which take ownership of an object provided via an argument require
7525 * this to be true and invalidate the object pointed to by inner.
7528 } LDKChannelManager;
7531 * A tuple of 2 elements. See the individual fields for the types contained.
7533 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
7535 * The element at position 0
7537 struct LDKThirtyTwoBytes a;
7539 * The element at position 1
7541 struct LDKChannelManager b;
7542 } LDKC2Tuple_BlockHashChannelManagerZ;
7545 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
7547 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
7549 * A pointer to the contents in the success state.
7550 * Reading from this pointer when `result_ok` is not set is undefined.
7552 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
7554 * A pointer to the contents in the error state.
7555 * Reading from this pointer when `result_ok` is set is undefined.
7557 struct LDKDecodeError *err;
7558 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
7561 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
7562 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
7563 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7565 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
7567 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
7568 * `err` or `result` depending on the state of `result_ok`.
7570 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
7572 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
7575 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
7578 * A trait indicating an object may generate message send events
7580 typedef struct LDKMessageSendEventsProvider {
7582 * An opaque pointer which is passed to your function implementations as an argument.
7583 * This has no meaning in the LDK, and can be NULL or any other value.
7587 * Gets the list of pending events which were generated by previous actions, clearing the list
7590 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
7592 * Frees any resources associated with this object given its this_arg pointer.
7593 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7595 void (*free)(void *this_arg);
7596 } LDKMessageSendEventsProvider;
7599 * A trait indicating an object may generate events
7601 typedef struct LDKEventsProvider {
7603 * An opaque pointer which is passed to your function implementations as an argument.
7604 * This has no meaning in the LDK, and can be NULL or any other value.
7608 * Gets the list of pending events which were generated by previous actions, clearing the list
7611 struct LDKCVec_EventZ (*get_and_clear_pending_events)(const void *this_arg);
7613 * Frees any resources associated with this object given its this_arg pointer.
7614 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7616 void (*free)(void *this_arg);
7617 } LDKEventsProvider;
7622 * Configuration we set when applicable.
7624 * Default::default() provides sane defaults.
7626 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
7628 * A pointer to the opaque Rust object.
7629 * Nearly everywhere, inner must be non-null, however in places where
7630 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7632 LDKnativeChannelHandshakeConfig *inner;
7634 * Indicates that this is the only struct which contains the same pointer.
7635 * Rust functions which take ownership of an object provided via an argument require
7636 * this to be true and invalidate the object pointed to by inner.
7639 } LDKChannelHandshakeConfig;
7644 * Optional channel limits which are applied during channel creation.
7646 * These limits are only applied to our counterparty's limits, not our own.
7648 * Use 0/<type>::max_value() as appropriate to skip checking.
7650 * Provides sane defaults for most configurations.
7652 * Most additional limits are disabled except those with which specify a default in individual
7653 * field documentation. Note that this may result in barely-usable channels, but since they
7654 * are applied mostly only to incoming channels that's not much of a problem.
7656 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
7658 * A pointer to the opaque Rust object.
7659 * Nearly everywhere, inner must be non-null, however in places where
7660 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7662 LDKnativeChannelHandshakeLimits *inner;
7664 * Indicates that this is the only struct which contains the same pointer.
7665 * Rust functions which take ownership of an object provided via an argument require
7666 * this to be true and invalidate the object pointed to by inner.
7669 } LDKChannelHandshakeLimits;
7674 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
7676 * Default::default() provides sane defaults for most configurations
7677 * (but currently with 0 relay fees!)
7679 typedef struct MUST_USE_STRUCT LDKUserConfig {
7681 * A pointer to the opaque Rust object.
7682 * Nearly everywhere, inner must be non-null, however in places where
7683 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7685 LDKnativeUserConfig *inner;
7687 * Indicates that this is the only struct which contains the same pointer.
7688 * Rust functions which take ownership of an object provided via an argument require
7689 * this to be true and invalidate the object pointed to by inner.
7695 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
7698 typedef struct LDKAccess {
7700 * An opaque pointer which is passed to your function implementations as an argument.
7701 * This has no meaning in the LDK, and can be NULL or any other value.
7705 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
7706 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
7709 * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
7711 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
7713 * Frees any resources associated with this object given its this_arg pointer.
7714 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7716 void (*free)(void *this_arg);
7720 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
7723 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
7724 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
7725 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
7728 typedef struct LDKListen {
7730 * An opaque pointer which is passed to your function implementations as an argument.
7731 * This has no meaning in the LDK, and can be NULL or any other value.
7735 * Notifies the listener that a block was added at the given height.
7737 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
7739 * Notifies the listener that a block was removed at the given height.
7741 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
7743 * Frees any resources associated with this object given its this_arg pointer.
7744 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7746 void (*free)(void *this_arg);
7750 * The `Confirm` trait is used to notify when transactions have been confirmed on chain or
7751 * unconfirmed during a chain reorganization.
7753 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
7754 * [`Listen`]. For instance, an Electrum client may implement [`Filter`] by subscribing to activity
7755 * related to registered transactions and outputs. Upon notification, it would pass along the
7756 * matching transactions using this interface.
7760 * The intended use is as follows:
7761 * - Call [`transactions_confirmed`] to process any on-chain activity of interest.
7762 * - Call [`transaction_unconfirmed`] to process any transaction returned by [`get_relevant_txids`]
7763 * that has been reorganized out of the chain.
7764 * - Call [`best_block_updated`] whenever a new chain tip becomes available.
7768 * Clients must call these methods in chain order. Specifically:
7769 * - Transactions confirmed in a block must be given before transactions confirmed in a later
7771 * - Dependent transactions within the same block must be given in topological order, possibly in
7773 * - Unconfirmed transactions must be given after the original confirmations and before any
7776 * See individual method documentation for further details.
7778 * [`transactions_confirmed`]: Self::transactions_confirmed
7779 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
7780 * [`best_block_updated`]: Self::best_block_updated
7781 * [`get_relevant_txids`]: Self::get_relevant_txids
7783 typedef struct LDKConfirm {
7785 * An opaque pointer which is passed to your function implementations as an argument.
7786 * This has no meaning in the LDK, and can be NULL or any other value.
7790 * Processes transactions confirmed in a block with a given header and height.
7792 * Should be called for any transactions registered by [`Filter::register_tx`] or any
7793 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
7794 * appearing in the same block do not need to be included in the same call; instead, multiple
7795 * calls with additional transactions may be made so long as they are made in [chain order].
7797 * May be called before or after [`best_block_updated`] for the corresponding block. However,
7798 * in the event of a chain reorganization, it must not be called with a `header` that is no
7799 * longer in the chain as of the last call to [`best_block_updated`].
7801 * [chain order]: Confirm#Order
7802 * [`best_block_updated`]: Self::best_block_updated
7804 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
7806 * Processes a transaction that is no longer confirmed as result of a chain reorganization.
7808 * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
7809 * reorganized out of the best chain. Once called, the given transaction should not be returned
7810 * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`].
7812 * [`get_relevant_txids`]: Self::get_relevant_txids
7813 * [`transactions_confirmed`]: Self::transactions_confirmed
7815 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
7817 * Processes an update to the best header connected at the given height.
7819 * Should be called when a new header is available but may be skipped for intermediary blocks
7820 * if they become available at the same time.
7822 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
7824 * Returns transactions that should be monitored for reorganization out of the chain.
7826 * Should include any transactions passed to [`transactions_confirmed`] that have insufficient
7827 * confirmations to be safe from a chain reorganization. Should not include any transactions
7828 * passed to [`transaction_unconfirmed`] unless later reconfirmed.
7830 * May be called to determine the subset of transactions that must still be monitored for
7831 * reorganization. Will be idempotent between calls but may change as a result of calls to the
7832 * other interface methods. Thus, this is useful to determine which transactions may need to be
7833 * given to [`transaction_unconfirmed`].
7835 * [`transactions_confirmed`]: Self::transactions_confirmed
7836 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
7838 struct LDKCVec_TxidZ (*get_relevant_txids)(const void *this_arg);
7840 * Frees any resources associated with this object given its this_arg pointer.
7841 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7843 void (*free)(void *this_arg);
7849 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
7851 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
7852 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
7853 * the return value of [`Filter::register_output`].
7855 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
7856 * may have been spent there. See [`Filter::register_output`] for details.
7858 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
7859 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
7861 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
7863 * A pointer to the opaque Rust object.
7864 * Nearly everywhere, inner must be non-null, however in places where
7865 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7867 LDKnativeWatchedOutput *inner;
7869 * Indicates that this is the only struct which contains the same pointer.
7870 * Rust functions which take ownership of an object provided via an argument require
7871 * this to be true and invalidate the object pointed to by inner.
7877 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
7880 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
7881 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
7882 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
7883 * receiving full blocks from a chain source, any further filtering is unnecessary.
7885 * After an output has been registered, subsequent block retrievals from the chain source must not
7886 * exclude any transactions matching the new criteria nor any in-block descendants of such
7889 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
7890 * should not block on I/O. Implementations should instead queue the newly monitored data to be
7891 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
7892 * invocation that has called the `Filter` must return [`TemporaryFailure`].
7894 * [`TemporaryFailure`]: channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure
7895 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
7896 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
7898 typedef struct LDKFilter {
7900 * An opaque pointer which is passed to your function implementations as an argument.
7901 * This has no meaning in the LDK, and can be NULL or any other value.
7905 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
7906 * a spending condition.
7908 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
7910 * Registers interest in spends of a transaction output.
7912 * Optionally, when `output.block_hash` is set, should return any transaction spending the
7913 * output that is found in the corresponding block along with its index.
7915 * This return value is useful for Electrum clients in order to supply in-block descendant
7916 * transactions which otherwise were not included. This is not necessary for other clients if
7917 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
7920 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
7922 * Frees any resources associated with this object given its this_arg pointer.
7923 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7925 void (*free)(void *this_arg);
7929 * `Persist` defines behavior for persisting channel monitors: this could mean
7930 * writing once to disk, and/or uploading to one or more backup services.
7932 * Note that for every new monitor, you **must** persist the new `ChannelMonitor`
7933 * to disk/backups. And, on every update, you **must** persist either the
7934 * `ChannelMonitorUpdate` or the updated monitor itself. Otherwise, there is risk
7935 * of situations such as revoking a transaction, then crashing before this
7936 * revocation can be persisted, then unintentionally broadcasting a revoked
7937 * transaction and losing money. This is a risk because previous channel states
7938 * are toxic, so it's important that whatever channel state is persisted is
7941 typedef struct LDKPersist {
7943 * An opaque pointer which is passed to your function implementations as an argument.
7944 * This has no meaning in the LDK, and can be NULL or any other value.
7948 * Persist a new channel's data. The data can be stored any way you want, but
7949 * the identifier provided by Rust-Lightning is the channel's outpoint (and
7950 * it is up to you to maintain a correct mapping between the outpoint and the
7951 * stored channel data). Note that you **must** persist every new monitor to
7952 * disk. See the `Persist` trait documentation for more details.
7954 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
7955 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
7957 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data);
7959 * Update one channel's data. The provided `ChannelMonitor` has already
7960 * applied the given update.
7962 * Note that on every update, you **must** persist either the
7963 * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See
7964 * the `Persist` trait documentation for more details.
7966 * If an implementer chooses to persist the updates only, they need to make
7967 * sure that all the updates are applied to the `ChannelMonitors` *before*
7968 * the set of channel monitors is given to the `ChannelManager`
7969 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
7970 * applying a monitor update to a monitor. If full `ChannelMonitors` are
7971 * persisted, then there is no need to persist individual updates.
7973 * Note that there could be a performance tradeoff between persisting complete
7974 * channel monitors on every update vs. persisting only updates and applying
7975 * them in batches. The size of each monitor grows `O(number of state updates)`
7976 * whereas updates are small and `O(1)`.
7978 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
7979 * [`ChannelMonitorUpdate::write`] for writing out an update, and
7980 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
7982 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);
7984 * Frees any resources associated with this object given its this_arg pointer.
7985 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7987 void (*free)(void *this_arg);
7993 * An implementation of [`chain::Watch`] for monitoring channels.
7995 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
7996 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
7997 * or used independently to monitor channels remotely. See the [module-level documentation] for
8000 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
8001 * [module-level documentation]: crate::chain::chainmonitor
8003 typedef struct MUST_USE_STRUCT LDKChainMonitor {
8005 * A pointer to the opaque Rust object.
8006 * Nearly everywhere, inner must be non-null, however in places where
8007 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8009 LDKnativeChainMonitor *inner;
8011 * Indicates that this is the only struct which contains the same pointer.
8012 * Rust functions which take ownership of an object provided via an argument require
8013 * this to be true and invalidate the object pointed to by inner.
8021 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
8022 * and derives keys from that.
8024 * Your node_id is seed/0'
8025 * ChannelMonitor closes may use seed/1'
8026 * Cooperative closes may use seed/2'
8027 * The two close keys may be needed to claim on-chain funds!
8029 typedef struct MUST_USE_STRUCT LDKKeysManager {
8031 * A pointer to the opaque Rust object.
8032 * Nearly everywhere, inner must be non-null, however in places where
8033 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8035 LDKnativeKeysManager *inner;
8037 * Indicates that this is the only struct which contains the same pointer.
8038 * Rust functions which take ownership of an object provided via an argument require
8039 * this to be true and invalidate the object pointed to by inner.
8047 * Chain-related parameters used to construct a new `ChannelManager`.
8049 * Typically, the block-specific parameters are derived from the best block hash for the network,
8050 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
8051 * are not needed when deserializing a previously constructed `ChannelManager`.
8053 typedef struct MUST_USE_STRUCT LDKChainParameters {
8055 * A pointer to the opaque Rust object.
8056 * Nearly everywhere, inner must be non-null, however in places where
8057 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8059 LDKnativeChainParameters *inner;
8061 * Indicates that this is the only struct which contains the same pointer.
8062 * Rust functions which take ownership of an object provided via an argument require
8063 * this to be true and invalidate the object pointed to by inner.
8066 } LDKChainParameters;
8071 * The best known block as identified by its hash and height.
8073 typedef struct MUST_USE_STRUCT LDKBestBlock {
8075 * A pointer to the opaque Rust object.
8076 * Nearly everywhere, inner must be non-null, however in places where
8077 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8079 LDKnativeBestBlock *inner;
8081 * Indicates that this is the only struct which contains the same pointer.
8082 * Rust functions which take ownership of an object provided via an argument require
8083 * this to be true and invalidate the object pointed to by inner.
8089 * A 3-byte byte array.
8091 typedef struct LDKThreeBytes {
8099 * A trait to describe an object which can receive channel messages.
8101 * Messages MAY be called in parallel when they originate from different their_node_ids, however
8102 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
8104 typedef struct LDKChannelMessageHandler {
8106 * An opaque pointer which is passed to your function implementations as an argument.
8107 * This has no meaning in the LDK, and can be NULL or any other value.
8111 * Handle an incoming open_channel message from the given peer.
8113 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
8115 * Handle an incoming accept_channel message from the given peer.
8117 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
8119 * Handle an incoming funding_created message from the given peer.
8121 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
8123 * Handle an incoming funding_signed message from the given peer.
8125 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
8127 * Handle an incoming funding_locked message from the given peer.
8129 void (*handle_funding_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg);
8131 * Handle an incoming shutdown message from the given peer.
8133 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);
8135 * Handle an incoming closing_signed message from the given peer.
8137 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
8139 * Handle an incoming update_add_htlc message from the given peer.
8141 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
8143 * Handle an incoming update_fulfill_htlc message from the given peer.
8145 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
8147 * Handle an incoming update_fail_htlc message from the given peer.
8149 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
8151 * Handle an incoming update_fail_malformed_htlc message from the given peer.
8153 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
8155 * Handle an incoming commitment_signed message from the given peer.
8157 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
8159 * Handle an incoming revoke_and_ack message from the given peer.
8161 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
8163 * Handle an incoming update_fee message from the given peer.
8165 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
8167 * Handle an incoming announcement_signatures message from the given peer.
8169 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
8171 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
8172 * is believed to be possible in the future (eg they're sending us messages we don't
8173 * understand or indicate they require unknown feature bits), no_connection_possible is set
8174 * and any outstanding channels should be failed.
8176 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
8178 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
8180 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
8182 * Handle an incoming channel_reestablish message from the given peer.
8184 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
8186 * Handle an incoming channel update from the given peer.
8188 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
8190 * Handle an incoming error message from the given peer.
8192 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
8194 * Implementation of MessageSendEventsProvider for this object.
8196 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
8198 * Frees any resources associated with this object given its this_arg pointer.
8199 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8201 void (*free)(void *this_arg);
8202 } LDKChannelMessageHandler;
8207 * Arguments for the creation of a ChannelManager that are not deserialized.
8209 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
8211 * 1) Deserialize all stored ChannelMonitors.
8212 * 2) Deserialize the ChannelManager by filling in this struct and calling:
8213 * <(BlockHash, ChannelManager)>::read(reader, args)
8214 * This may result in closing some Channels if the ChannelMonitor is newer than the stored
8215 * ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted.
8216 * 3) If you are not fetching full blocks, register all relevant ChannelMonitor outpoints the same
8217 * way you would handle a `chain::Filter` call using ChannelMonitor::get_outputs_to_watch() and
8218 * ChannelMonitor::get_funding_txo().
8219 * 4) Reconnect blocks on your ChannelMonitors.
8220 * 5) Disconnect/connect blocks on the ChannelManager.
8221 * 6) Move the ChannelMonitors into your local chain::Watch.
8223 * Note that the ordering of #4-6 is not of importance, however all three must occur before you
8224 * call any other methods on the newly-deserialized ChannelManager.
8226 * Note that because some channels may be closed during deserialization, it is critical that you
8227 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
8228 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
8229 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
8230 * not force-close the same channels but consider them live), you may end up revoking a state for
8231 * which you've already broadcasted the transaction.
8233 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
8235 * A pointer to the opaque Rust object.
8236 * Nearly everywhere, inner must be non-null, however in places where
8237 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8239 LDKnativeChannelManagerReadArgs *inner;
8241 * Indicates that this is the only struct which contains the same pointer.
8242 * Rust functions which take ownership of an object provided via an argument require
8243 * this to be true and invalidate the object pointed to by inner.
8246 } LDKChannelManagerReadArgs;
8251 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
8252 * This is used to convince the recipient that the channel is at a certain commitment
8253 * number even if they lost that data due to a local failure. Of course, the peer may lie
8254 * and even later commitments may have been revoked.
8256 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
8258 * A pointer to the opaque Rust object.
8259 * Nearly everywhere, inner must be non-null, however in places where
8260 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8262 LDKnativeDataLossProtect *inner;
8264 * Indicates that this is the only struct which contains the same pointer.
8265 * Rust functions which take ownership of an object provided via an argument require
8266 * this to be true and invalidate the object pointed to by inner.
8269 } LDKDataLossProtect;
8272 * A trait to describe an object which can receive routing messages.
8274 * # Implementor DoS Warnings
8276 * For `gossip_queries` messages there are potential DoS vectors when handling
8277 * inbound queries. Implementors using an on-disk network graph should be aware of
8278 * repeated disk I/O for queries accessing different parts of the network graph.
8280 typedef struct LDKRoutingMessageHandler {
8282 * An opaque pointer which is passed to your function implementations as an argument.
8283 * This has no meaning in the LDK, and can be NULL or any other value.
8287 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
8288 * false or returning an Err otherwise.
8290 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
8292 * Handle a channel_announcement message, returning true if it should be forwarded on, false
8293 * or returning an Err otherwise.
8295 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
8297 * Handle an incoming channel_update message, returning true if it should be forwarded on,
8298 * false or returning an Err otherwise.
8300 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
8302 * Handle some updates to the route graph that we learned due to an outbound failed payment.
8304 void (*handle_htlc_fail_channel_update)(const void *this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update);
8306 * Gets a subset of the channel announcements and updates required to dump our routing table
8307 * to a remote node, starting at the short_channel_id indicated by starting_point and
8308 * including the batch_amount entries immediately higher in numerical value than starting_point.
8310 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
8312 * Gets a subset of the node announcements required to dump our routing table to a remote node,
8313 * starting at the node *after* the provided publickey and including batch_amount entries
8314 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
8315 * If None is provided for starting_point, we start at the first node.
8317 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
8319 * Called when a connection is established with a peer. This can be used to
8320 * perform routing table synchronization using a strategy defined by the
8323 void (*sync_routing_table)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
8325 * Handles the reply of a query we initiated to learn about channels
8326 * for a given range of blocks. We can expect to receive one or more
8327 * replies to a single query.
8329 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
8331 * Handles the reply of a query we initiated asking for routing gossip
8332 * messages for a list of channels. We should receive this message when
8333 * a node has completed its best effort to send us the pertaining routing
8336 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
8338 * Handles when a peer asks us to send a list of short_channel_ids
8339 * for the requested range of blocks.
8341 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
8343 * Handles when a peer asks us to send routing gossip messages for a
8344 * list of short_channel_ids.
8346 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
8348 * Implementation of MessageSendEventsProvider for this object.
8350 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
8352 * Frees any resources associated with this object given its this_arg pointer.
8353 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8355 void (*free)(void *this_arg);
8356 } LDKRoutingMessageHandler;
8361 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
8362 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
8364 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
8366 * A pointer to the opaque Rust object.
8367 * Nearly everywhere, inner must be non-null, however in places where
8368 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8370 LDKnativeIgnoringMessageHandler *inner;
8372 * Indicates that this is the only struct which contains the same pointer.
8373 * Rust functions which take ownership of an object provided via an argument require
8374 * this to be true and invalidate the object pointed to by inner.
8377 } LDKIgnoringMessageHandler;
8382 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
8383 * You can provide one of these as the route_handler in a MessageHandler.
8385 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
8387 * A pointer to the opaque Rust object.
8388 * Nearly everywhere, inner must be non-null, however in places where
8389 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8391 LDKnativeErroringMessageHandler *inner;
8393 * Indicates that this is the only struct which contains the same pointer.
8394 * Rust functions which take ownership of an object provided via an argument require
8395 * this to be true and invalidate the object pointed to by inner.
8398 } LDKErroringMessageHandler;
8403 * Provides references to trait impls which handle different types of messages.
8405 typedef struct MUST_USE_STRUCT LDKMessageHandler {
8407 * A pointer to the opaque Rust object.
8408 * Nearly everywhere, inner must be non-null, however in places where
8409 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8411 LDKnativeMessageHandler *inner;
8413 * Indicates that this is the only struct which contains the same pointer.
8414 * Rust functions which take ownership of an object provided via an argument require
8415 * this to be true and invalidate the object pointed to by inner.
8418 } LDKMessageHandler;
8421 * Provides an object which can be used to send data to and which uniquely identifies a connection
8422 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
8423 * implement Hash to meet the PeerManager API.
8425 * For efficiency, Clone should be relatively cheap for this type.
8427 * You probably want to just extend an int and put a file descriptor in a struct and implement
8428 * send_data. Note that if you are using a higher-level net library that may call close() itself,
8429 * be careful to ensure you don't have races whereby you might register a new connection with an
8430 * fd which is the same as a previous one which has yet to be removed via
8431 * PeerManager::socket_disconnected().
8433 typedef struct LDKSocketDescriptor {
8435 * An opaque pointer which is passed to your function implementations as an argument.
8436 * This has no meaning in the LDK, and can be NULL or any other value.
8440 * Attempts to send some data from the given slice to the peer.
8442 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
8443 * Note that in the disconnected case, socket_disconnected must still fire and further write
8444 * attempts may occur until that time.
8446 * If the returned size is smaller than data.len(), a write_available event must
8447 * trigger the next time more data can be written. Additionally, until the a send_data event
8448 * completes fully, no further read_events should trigger on the same peer!
8450 * If a read_event on this descriptor had previously returned true (indicating that read
8451 * events should be paused to prevent DoS in the send buffer), resume_read may be set
8452 * indicating that read events on this descriptor should resume. A resume_read of false does
8453 * *not* imply that further read events should be paused.
8455 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
8457 * Disconnect the socket pointed to by this SocketDescriptor. Once this function returns, no
8458 * more calls to write_buffer_space_avail, read_event or socket_disconnected may be made with
8459 * this descriptor. No socket_disconnected call should be generated as a result of this call,
8460 * though races may occur whereby disconnect_socket is called after a call to
8461 * socket_disconnected but prior to socket_disconnected returning.
8463 void (*disconnect_socket)(void *this_arg);
8465 * Checks if two objects are equal given this object's this_arg pointer and another object.
8467 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
8469 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
8470 * This is used, for example, for inclusion of this object in a hash map.
8472 uint64_t (*hash)(const void *this_arg);
8474 * Creates a copy of the object pointed to by this_arg, for a copy of this SocketDescriptor.
8475 * Note that the ultimate copy of the SocketDescriptor will have all function pointers the same as the original.
8476 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new SocketDescriptor.
8478 void *(*clone)(const void *this_arg);
8480 * Frees any resources associated with this object given its this_arg pointer.
8481 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8483 void (*free)(void *this_arg);
8484 } LDKSocketDescriptor;
8489 * A PeerManager manages a set of peers, described by their SocketDescriptor and marshalls socket
8490 * events into messages which it passes on to its MessageHandlers.
8492 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
8493 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
8494 * essentially you should default to using a SimpleRefPeerManager, and use a
8495 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
8496 * you're using lightning-net-tokio.
8498 typedef struct MUST_USE_STRUCT LDKPeerManager {
8500 * A pointer to the opaque Rust object.
8501 * Nearly everywhere, inner must be non-null, however in places where
8502 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8504 LDKnativePeerManager *inner;
8506 * Indicates that this is the only struct which contains the same pointer.
8507 * Rust functions which take ownership of an object provided via an argument require
8508 * this to be true and invalidate the object pointed to by inner.
8516 * Static channel fields used to build transactions given per-commitment fields, organized by
8517 * broadcaster/countersignatory.
8519 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
8520 * as_holder_broadcastable and as_counterparty_broadcastable functions.
8522 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
8524 * A pointer to the opaque Rust object.
8525 * Nearly everywhere, inner must be non-null, however in places where
8526 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8528 LDKnativeDirectedChannelTransactionParameters *inner;
8530 * Indicates that this is the only struct which contains the same pointer.
8531 * Rust functions which take ownership of an object provided via an argument require
8532 * this to be true and invalidate the object pointed to by inner.
8535 } LDKDirectedChannelTransactionParameters;
8540 * A simple newtype for RwLockReadGuard<'a, NetworkGraph>.
8541 * This exists only to make accessing a RwLock<NetworkGraph> possible from
8542 * the C bindings, as it can be done directly in Rust code.
8544 typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
8546 * A pointer to the opaque Rust object.
8547 * Nearly everywhere, inner must be non-null, however in places where
8548 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8550 LDKnativeLockedNetworkGraph *inner;
8552 * Indicates that this is the only struct which contains the same pointer.
8553 * Rust functions which take ownership of an object provided via an argument require
8554 * this to be true and invalidate the object pointed to by inner.
8557 } LDKLockedNetworkGraph;
8562 * Receives and validates network updates from peers,
8563 * stores authentic and relevant data as a network graph.
8564 * This network graph is then used for routing payments.
8565 * Provides interface to help with initial routing sync by
8566 * serving historical announcements.
8568 typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
8570 * A pointer to the opaque Rust object.
8571 * Nearly everywhere, inner must be non-null, however in places where
8572 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8574 LDKnativeNetGraphMsgHandler *inner;
8576 * Indicates that this is the only struct which contains the same pointer.
8577 * Rust functions which take ownership of an object provided via an argument require
8578 * this to be true and invalidate the object pointed to by inner.
8581 } LDKNetGraphMsgHandler;
8586 * FilesystemPersister persists channel data on disk, where each channel's
8587 * data is stored in a file named after its funding outpoint.
8589 * Warning: this module does the best it can with calls to persist data, but it
8590 * can only guarantee that the data is passed to the drive. It is up to the
8591 * drive manufacturers to do the actual persistence properly, which they often
8592 * don't (especially on consumer-grade hardware). Therefore, it is up to the
8593 * user to validate their entire storage stack, to ensure the writes are
8595 * Corollary: especially when dealing with larger amounts of money, it is best
8596 * practice to have multiple channel data backups and not rely only on one
8597 * FilesystemPersister.
8599 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
8601 * A pointer to the opaque Rust object.
8602 * Nearly everywhere, inner must be non-null, however in places where
8603 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8605 LDKnativeFilesystemPersister *inner;
8607 * Indicates that this is the only struct which contains the same pointer.
8608 * Rust functions which take ownership of an object provided via an argument require
8609 * this to be true and invalidate the object pointed to by inner.
8612 } LDKFilesystemPersister;
8617 * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be
8621 * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`.
8623 typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
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 LDKnativeSignedRawInvoice *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.
8636 } LDKSignedRawInvoice;
8641 * Data of the `RawInvoice` that is encoded in the data part
8643 typedef struct MUST_USE_STRUCT LDKRawDataPart {
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 LDKnativeRawDataPart *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.
8658 extern const uintptr_t MAX_BUF_SIZE;
8660 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
8662 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
8664 extern const uint16_t BREAKDOWN_TIMEOUT;
8666 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
8668 extern const uint32_t MIN_FINAL_CLTV_EXPIRY;
8670 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
8672 extern const uint8_t TAG_PAYMENT_HASH;
8674 extern const uint8_t TAG_DESCRIPTION;
8676 extern const uint8_t TAG_PAYEE_PUB_KEY;
8678 extern const uint8_t TAG_DESCRIPTION_HASH;
8680 extern const uint8_t TAG_EXPIRY_TIME;
8682 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY;
8684 extern const uint8_t TAG_FALLBACK;
8686 extern const uint8_t TAG_ROUTE;
8688 extern const uint8_t TAG_PAYMENT_SECRET;
8690 extern const uint8_t TAG_FEATURES;
8693 * Frees the data buffer, if data_is_owned is set and datalen > 0.
8695 void Transaction_free(struct LDKTransaction _res);
8698 * Frees the data pointed to by script_pubkey.
8700 void TxOut_free(struct LDKTxOut _res);
8703 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
8705 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
8708 * Frees the data buffer, if chars_is_owned is set and len > 0.
8710 void Str_free(struct LDKStr _res);
8713 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
8715 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
8718 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
8720 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
8723 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
8725 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
8728 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
8729 * but with all dynamically-allocated buffers duplicated in new buffers.
8731 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
8734 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
8736 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
8739 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
8741 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
8744 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
8746 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
8749 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
8750 * but with all dynamically-allocated buffers duplicated in new buffers.
8752 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
8755 * Creates a new CResult_SecretKeyErrorZ in the success state.
8757 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
8760 * Creates a new CResult_SecretKeyErrorZ in the error state.
8762 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
8765 * Frees any resources used by the CResult_SecretKeyErrorZ.
8767 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
8770 * Creates a new CResult_PublicKeyErrorZ in the success state.
8772 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
8775 * Creates a new CResult_PublicKeyErrorZ in the error state.
8777 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
8780 * Frees any resources used by the CResult_PublicKeyErrorZ.
8782 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
8785 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
8787 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
8790 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
8792 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
8795 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
8797 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
8800 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
8801 * but with all dynamically-allocated buffers duplicated in new buffers.
8803 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
8806 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
8808 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
8811 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
8813 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
8816 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
8818 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
8821 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
8822 * but with all dynamically-allocated buffers duplicated in new buffers.
8824 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
8827 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
8829 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
8832 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
8834 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
8837 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
8839 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
8842 * Constructs a new COption_u32Z containing a u32
8844 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
8847 * Constructs a new COption_u32Z containing nothing
8849 struct LDKCOption_u32Z COption_u32Z_none(void);
8852 * Frees any resources associated with the u32, if we are in the Some state
8854 void COption_u32Z_free(struct LDKCOption_u32Z _res);
8857 * Creates a new COption_u32Z which has the same data as `orig`
8858 * but with all dynamically-allocated buffers duplicated in new buffers.
8860 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
8863 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
8865 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
8868 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
8870 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
8873 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
8875 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
8878 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
8879 * but with all dynamically-allocated buffers duplicated in new buffers.
8881 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
8884 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
8886 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
8889 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
8891 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
8894 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
8896 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
8899 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
8900 * but with all dynamically-allocated buffers duplicated in new buffers.
8902 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
8905 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
8907 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
8910 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
8912 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
8915 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
8917 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
8920 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
8921 * but with all dynamically-allocated buffers duplicated in new buffers.
8923 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
8926 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8928 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
8931 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
8933 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
8936 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
8938 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
8941 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
8943 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
8946 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
8947 * but with all dynamically-allocated buffers duplicated in new buffers.
8949 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
8952 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
8954 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
8957 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
8959 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
8962 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
8964 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
8967 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
8968 * but with all dynamically-allocated buffers duplicated in new buffers.
8970 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
8973 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
8975 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
8978 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
8980 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
8983 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
8985 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
8988 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
8989 * but with all dynamically-allocated buffers duplicated in new buffers.
8991 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
8994 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
8996 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
8999 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
9001 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
9004 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
9006 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
9009 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
9011 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
9014 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
9016 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
9019 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
9021 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
9024 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
9025 * but with all dynamically-allocated buffers duplicated in new buffers.
9027 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
9030 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9032 void CVec_RawTaggedFieldZ_free(struct LDKCVec_RawTaggedFieldZ _res);
9035 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9037 void CVec_u5Z_free(struct LDKCVec_u5Z _res);
9040 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9042 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
9045 * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements.
9047 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c);
9050 * Frees any resources used by the C3Tuple_RawInvoice_u832InvoiceSignatureZ.
9052 void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res);
9055 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
9057 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
9060 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
9062 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
9065 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
9067 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
9070 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9072 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
9075 * Constructs a new COption_u64Z containing a u64
9077 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
9080 * Constructs a new COption_u64Z containing nothing
9082 struct LDKCOption_u64Z COption_u64Z_none(void);
9085 * Frees any resources associated with the u64, if we are in the Some state
9087 void COption_u64Z_free(struct LDKCOption_u64Z _res);
9090 * Creates a new COption_u64Z which has the same data as `orig`
9091 * but with all dynamically-allocated buffers duplicated in new buffers.
9093 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
9096 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
9098 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
9101 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
9103 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
9106 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
9108 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
9111 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
9112 * but with all dynamically-allocated buffers duplicated in new buffers.
9114 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
9117 * Creates a new CResult_NoneSemanticErrorZ in the success state.
9119 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void);
9122 * Creates a new CResult_NoneSemanticErrorZ in the error state.
9124 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e);
9127 * Frees any resources used by the CResult_NoneSemanticErrorZ.
9129 void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res);
9132 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
9133 * but with all dynamically-allocated buffers duplicated in new buffers.
9135 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig);
9138 * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
9140 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o);
9143 * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
9145 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e);
9148 * Frees any resources used by the CResult_InvoiceSemanticErrorZ.
9150 void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res);
9153 * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig`
9154 * but with all dynamically-allocated buffers duplicated in new buffers.
9156 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig);
9159 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
9161 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
9164 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
9166 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
9169 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
9171 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
9174 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
9175 * but with all dynamically-allocated buffers duplicated in new buffers.
9177 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
9180 * Creates a new CResult_ExpiryTimeCreationErrorZ in the success state.
9182 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_ok(struct LDKExpiryTime o);
9185 * Creates a new CResult_ExpiryTimeCreationErrorZ in the error state.
9187 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_err(enum LDKCreationError e);
9190 * Frees any resources used by the CResult_ExpiryTimeCreationErrorZ.
9192 void CResult_ExpiryTimeCreationErrorZ_free(struct LDKCResult_ExpiryTimeCreationErrorZ _res);
9195 * Creates a new CResult_ExpiryTimeCreationErrorZ which has the same data as `orig`
9196 * but with all dynamically-allocated buffers duplicated in new buffers.
9198 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_clone(const struct LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR orig);
9201 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9203 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
9206 * Creates a new CResult_RouteHintCreationErrorZ in the success state.
9208 struct LDKCResult_RouteHintCreationErrorZ CResult_RouteHintCreationErrorZ_ok(struct LDKRouteHint o);
9211 * Creates a new CResult_RouteHintCreationErrorZ in the error state.
9213 struct LDKCResult_RouteHintCreationErrorZ CResult_RouteHintCreationErrorZ_err(enum LDKCreationError e);
9216 * Frees any resources used by the CResult_RouteHintCreationErrorZ.
9218 void CResult_RouteHintCreationErrorZ_free(struct LDKCResult_RouteHintCreationErrorZ _res);
9221 * Creates a new CResult_RouteHintCreationErrorZ which has the same data as `orig`
9222 * but with all dynamically-allocated buffers duplicated in new buffers.
9224 struct LDKCResult_RouteHintCreationErrorZ CResult_RouteHintCreationErrorZ_clone(const struct LDKCResult_RouteHintCreationErrorZ *NONNULL_PTR orig);
9227 * Creates a new CResult_StringErrorZ in the success state.
9229 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKCVec_u8Z o);
9232 * Creates a new CResult_StringErrorZ in the error state.
9234 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
9237 * Frees any resources used by the CResult_StringErrorZ.
9239 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
9242 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
9244 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
9247 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
9249 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
9252 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
9254 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
9257 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
9258 * but with all dynamically-allocated buffers duplicated in new buffers.
9260 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
9263 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
9265 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
9268 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
9270 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
9273 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
9275 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
9278 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
9279 * but with all dynamically-allocated buffers duplicated in new buffers.
9281 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
9284 * Creates a new CResult_NoneMonitorUpdateErrorZ in the success state.
9286 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
9289 * Creates a new CResult_NoneMonitorUpdateErrorZ in the error state.
9291 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e);
9294 * Frees any resources used by the CResult_NoneMonitorUpdateErrorZ.
9296 void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res);
9299 * Creates a new CResult_NoneMonitorUpdateErrorZ which has the same data as `orig`
9300 * but with all dynamically-allocated buffers duplicated in new buffers.
9302 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig);
9305 * Creates a new tuple which has the same data as `orig`
9306 * but with all dynamically-allocated buffers duplicated in new buffers.
9308 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
9311 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
9313 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
9316 * Frees any resources used by the C2Tuple_OutPointScriptZ.
9318 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
9321 * Creates a new tuple which has the same data as `orig`
9322 * but with all dynamically-allocated buffers duplicated in new buffers.
9324 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
9327 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
9329 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
9332 * Frees any resources used by the C2Tuple_u32ScriptZ.
9334 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
9337 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9339 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
9342 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
9344 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
9347 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
9349 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
9352 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9354 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
9357 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9359 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
9362 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9364 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
9367 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9369 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
9372 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
9374 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
9377 * Frees any resources used by the C2Tuple_usizeTransactionZ.
9379 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
9382 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9384 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
9387 * Creates a new tuple which has the same data as `orig`
9388 * but with all dynamically-allocated buffers duplicated in new buffers.
9390 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
9393 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
9395 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
9398 * Frees any resources used by the C2Tuple_u32TxOutZ.
9400 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
9403 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9405 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
9408 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
9410 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
9413 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
9415 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
9418 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9420 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
9423 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9425 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
9428 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
9430 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
9433 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
9435 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
9438 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
9440 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
9443 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
9444 * but with all dynamically-allocated buffers duplicated in new buffers.
9446 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
9449 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
9451 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
9454 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
9456 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
9459 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
9461 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
9464 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
9466 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
9469 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
9471 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
9474 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9476 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
9479 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9481 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
9484 * Creates a new CResult_RouteDecodeErrorZ in the success state.
9486 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
9489 * Creates a new CResult_RouteDecodeErrorZ in the error state.
9491 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
9494 * Frees any resources used by the CResult_RouteDecodeErrorZ.
9496 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
9499 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
9500 * but with all dynamically-allocated buffers duplicated in new buffers.
9502 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
9505 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9507 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
9510 * Creates a new CResult_RouteLightningErrorZ in the success state.
9512 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
9515 * Creates a new CResult_RouteLightningErrorZ in the error state.
9517 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
9520 * Frees any resources used by the CResult_RouteLightningErrorZ.
9522 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
9525 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
9526 * but with all dynamically-allocated buffers duplicated in new buffers.
9528 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
9531 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9533 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
9536 * Creates a new CResult_boolLightningErrorZ in the success state.
9538 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
9541 * Creates a new CResult_boolLightningErrorZ in the error state.
9543 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
9546 * Frees any resources used by the CResult_boolLightningErrorZ.
9548 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
9551 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
9552 * but with all dynamically-allocated buffers duplicated in new buffers.
9554 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
9557 * Creates a new tuple which has the same data as `orig`
9558 * but with all dynamically-allocated buffers duplicated in new buffers.
9560 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
9563 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
9565 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
9568 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
9570 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
9573 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9575 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
9578 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9580 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
9583 * Creates a new CResult_NoneLightningErrorZ in the success state.
9585 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
9588 * Creates a new CResult_NoneLightningErrorZ in the error state.
9590 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
9593 * Frees any resources used by the CResult_NoneLightningErrorZ.
9595 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
9598 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
9599 * but with all dynamically-allocated buffers duplicated in new buffers.
9601 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
9604 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9606 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
9609 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
9611 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
9614 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
9616 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
9619 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
9621 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
9624 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
9625 * but with all dynamically-allocated buffers duplicated in new buffers.
9627 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
9630 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
9632 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
9635 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
9637 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
9640 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
9642 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
9645 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
9646 * but with all dynamically-allocated buffers duplicated in new buffers.
9648 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
9651 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
9653 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
9656 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
9658 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
9661 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
9663 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
9666 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
9667 * but with all dynamically-allocated buffers duplicated in new buffers.
9669 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
9672 * Creates a new CResult_TxOutAccessErrorZ in the success state.
9674 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
9677 * Creates a new CResult_TxOutAccessErrorZ in the error state.
9679 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
9682 * Frees any resources used by the CResult_TxOutAccessErrorZ.
9684 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
9687 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
9688 * but with all dynamically-allocated buffers duplicated in new buffers.
9690 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
9693 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ
9695 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
9698 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing
9700 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
9703 * Frees any resources associated with the crate::c_types::derived::C2Tuple_usizeTransactionZ, if we are in the Some state
9705 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
9708 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9710 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
9713 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the success state.
9715 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o);
9718 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the error state.
9720 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
9723 * Frees any resources used by the CResult_DirectionalChannelInfoDecodeErrorZ.
9725 void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res);
9728 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ which has the same data as `orig`
9729 * but with all dynamically-allocated buffers duplicated in new buffers.
9731 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig);
9734 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
9736 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
9739 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
9741 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
9744 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
9746 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
9749 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
9750 * but with all dynamically-allocated buffers duplicated in new buffers.
9752 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
9755 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
9757 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
9760 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
9762 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
9765 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
9767 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
9770 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
9771 * but with all dynamically-allocated buffers duplicated in new buffers.
9773 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
9776 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9778 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
9781 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
9783 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
9786 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
9788 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
9791 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
9793 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
9796 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
9797 * but with all dynamically-allocated buffers duplicated in new buffers.
9799 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
9802 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9804 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
9807 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
9809 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
9812 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
9814 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
9817 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
9819 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
9822 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
9823 * but with all dynamically-allocated buffers duplicated in new buffers.
9825 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
9828 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
9830 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
9833 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
9835 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
9838 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
9840 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
9843 * Creates a new CResult_NetworkGraphDecodeErrorZ which has the same data as `orig`
9844 * but with all dynamically-allocated buffers duplicated in new buffers.
9846 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
9849 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
9851 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
9854 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
9856 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
9859 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
9861 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
9864 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
9866 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
9869 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
9871 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
9874 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
9876 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
9879 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
9881 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
9884 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
9886 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
9889 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
9891 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
9894 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
9896 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
9899 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
9901 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
9904 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
9906 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
9909 * Creates a new CResult_NetAddressu8Z in the success state.
9911 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
9914 * Creates a new CResult_NetAddressu8Z in the error state.
9916 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
9919 * Frees any resources used by the CResult_NetAddressu8Z.
9921 void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
9924 * Creates a new CResult_NetAddressu8Z which has the same data as `orig`
9925 * but with all dynamically-allocated buffers duplicated in new buffers.
9927 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
9930 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the success state.
9932 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
9935 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the error state.
9937 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
9940 * Frees any resources used by the CResult_CResult_NetAddressu8ZDecodeErrorZ.
9942 void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
9945 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ which has the same data as `orig`
9946 * but with all dynamically-allocated buffers duplicated in new buffers.
9948 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
9951 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9953 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
9956 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9958 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
9961 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9963 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
9966 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9968 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
9971 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
9973 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
9976 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
9978 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
9981 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
9983 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
9986 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
9987 * but with all dynamically-allocated buffers duplicated in new buffers.
9989 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
9992 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
9994 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
9997 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
9999 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
10002 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
10004 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
10007 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
10008 * but with all dynamically-allocated buffers duplicated in new buffers.
10010 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
10013 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
10015 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
10018 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
10020 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
10023 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
10025 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
10028 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
10029 * but with all dynamically-allocated buffers duplicated in new buffers.
10031 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
10034 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
10036 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
10039 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
10041 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
10044 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
10046 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
10049 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
10050 * but with all dynamically-allocated buffers duplicated in new buffers.
10052 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
10055 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
10057 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
10060 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
10062 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
10065 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
10067 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
10070 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
10071 * but with all dynamically-allocated buffers duplicated in new buffers.
10073 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
10076 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
10078 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
10081 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
10083 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
10086 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
10088 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
10091 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
10092 * but with all dynamically-allocated buffers duplicated in new buffers.
10094 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
10097 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
10099 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
10102 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
10104 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
10107 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
10109 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
10112 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
10113 * but with all dynamically-allocated buffers duplicated in new buffers.
10115 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
10118 * Creates a new CResult_FundingLockedDecodeErrorZ in the success state.
10120 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o);
10123 * Creates a new CResult_FundingLockedDecodeErrorZ in the error state.
10125 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e);
10128 * Frees any resources used by the CResult_FundingLockedDecodeErrorZ.
10130 void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res);
10133 * Creates a new CResult_FundingLockedDecodeErrorZ which has the same data as `orig`
10134 * but with all dynamically-allocated buffers duplicated in new buffers.
10136 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig);
10139 * Creates a new CResult_InitDecodeErrorZ in the success state.
10141 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
10144 * Creates a new CResult_InitDecodeErrorZ in the error state.
10146 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
10149 * Frees any resources used by the CResult_InitDecodeErrorZ.
10151 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
10154 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
10155 * but with all dynamically-allocated buffers duplicated in new buffers.
10157 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
10160 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
10162 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
10165 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
10167 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
10170 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
10172 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
10175 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
10176 * but with all dynamically-allocated buffers duplicated in new buffers.
10178 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
10181 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
10183 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
10186 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
10188 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
10191 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
10193 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
10196 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
10197 * but with all dynamically-allocated buffers duplicated in new buffers.
10199 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
10202 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
10204 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
10207 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
10209 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
10212 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
10214 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
10217 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
10218 * but with all dynamically-allocated buffers duplicated in new buffers.
10220 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
10223 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
10225 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
10228 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
10230 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
10233 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
10235 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
10238 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
10239 * but with all dynamically-allocated buffers duplicated in new buffers.
10241 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
10244 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
10246 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
10249 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
10251 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
10254 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
10256 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
10259 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
10260 * but with all dynamically-allocated buffers duplicated in new buffers.
10262 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
10265 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
10267 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
10270 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
10272 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
10275 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
10277 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
10280 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
10281 * but with all dynamically-allocated buffers duplicated in new buffers.
10283 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
10286 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
10288 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
10291 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
10293 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
10296 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
10298 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
10301 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
10302 * but with all dynamically-allocated buffers duplicated in new buffers.
10304 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
10307 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
10309 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
10312 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
10314 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
10317 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
10319 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
10322 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
10323 * but with all dynamically-allocated buffers duplicated in new buffers.
10325 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
10328 * Creates a new CResult_PingDecodeErrorZ in the success state.
10330 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
10333 * Creates a new CResult_PingDecodeErrorZ in the error state.
10335 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
10338 * Frees any resources used by the CResult_PingDecodeErrorZ.
10340 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
10343 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
10344 * but with all dynamically-allocated buffers duplicated in new buffers.
10346 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
10349 * Creates a new CResult_PongDecodeErrorZ in the success state.
10351 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
10354 * Creates a new CResult_PongDecodeErrorZ in the error state.
10356 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
10359 * Frees any resources used by the CResult_PongDecodeErrorZ.
10361 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
10364 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
10365 * but with all dynamically-allocated buffers duplicated in new buffers.
10367 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
10370 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
10372 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
10375 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
10377 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
10380 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
10382 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
10385 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
10386 * but with all dynamically-allocated buffers duplicated in new buffers.
10388 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
10391 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
10393 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
10396 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
10398 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
10401 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
10403 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
10406 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
10407 * but with all dynamically-allocated buffers duplicated in new buffers.
10409 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
10412 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
10414 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
10417 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
10419 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
10422 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
10424 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
10427 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
10428 * but with all dynamically-allocated buffers duplicated in new buffers.
10430 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
10433 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
10435 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
10438 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
10440 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
10443 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
10445 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
10448 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
10449 * but with all dynamically-allocated buffers duplicated in new buffers.
10451 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
10454 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
10456 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
10459 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
10461 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
10464 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
10466 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
10469 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
10470 * but with all dynamically-allocated buffers duplicated in new buffers.
10472 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
10475 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
10477 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
10480 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
10482 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
10485 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
10487 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
10490 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
10491 * but with all dynamically-allocated buffers duplicated in new buffers.
10493 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
10496 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
10498 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
10501 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
10503 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
10506 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
10508 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
10511 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
10512 * but with all dynamically-allocated buffers duplicated in new buffers.
10514 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
10517 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
10519 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
10522 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
10524 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
10527 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
10529 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
10532 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
10533 * but with all dynamically-allocated buffers duplicated in new buffers.
10535 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
10538 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
10540 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
10543 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
10545 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
10548 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
10550 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
10553 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
10554 * but with all dynamically-allocated buffers duplicated in new buffers.
10556 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
10559 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
10561 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
10564 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
10566 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
10569 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
10571 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
10574 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
10575 * but with all dynamically-allocated buffers duplicated in new buffers.
10577 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
10580 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
10582 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
10585 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
10587 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
10590 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
10592 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
10595 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
10596 * but with all dynamically-allocated buffers duplicated in new buffers.
10598 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
10601 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
10603 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
10606 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
10608 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
10611 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
10613 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
10616 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
10617 * but with all dynamically-allocated buffers duplicated in new buffers.
10619 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
10622 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
10624 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
10627 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
10629 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
10632 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
10634 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
10637 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
10638 * but with all dynamically-allocated buffers duplicated in new buffers.
10640 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
10643 * Creates a new tuple which has the same data as `orig`
10644 * but with all dynamically-allocated buffers duplicated in new buffers.
10646 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
10649 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
10651 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
10654 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
10656 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
10659 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
10661 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
10664 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
10666 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
10669 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
10671 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
10674 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
10675 * but with all dynamically-allocated buffers duplicated in new buffers.
10677 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
10680 * Creates a new CResult_SignatureNoneZ in the success state.
10682 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
10685 * Creates a new CResult_SignatureNoneZ in the error state.
10687 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
10690 * Frees any resources used by the CResult_SignatureNoneZ.
10692 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
10695 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
10696 * but with all dynamically-allocated buffers duplicated in new buffers.
10698 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
10701 * Creates a new CResult_SignDecodeErrorZ in the success state.
10703 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
10706 * Creates a new CResult_SignDecodeErrorZ in the error state.
10708 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
10711 * Frees any resources used by the CResult_SignDecodeErrorZ.
10713 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
10716 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
10717 * but with all dynamically-allocated buffers duplicated in new buffers.
10719 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
10722 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10724 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
10727 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
10729 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
10732 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
10734 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
10737 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
10739 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
10742 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
10743 * but with all dynamically-allocated buffers duplicated in new buffers.
10745 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
10748 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
10750 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
10753 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
10755 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
10758 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
10760 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
10763 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
10764 * but with all dynamically-allocated buffers duplicated in new buffers.
10766 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
10769 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10771 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
10774 * Creates a new CResult_TransactionNoneZ in the success state.
10776 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
10779 * Creates a new CResult_TransactionNoneZ in the error state.
10781 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
10784 * Frees any resources used by the CResult_TransactionNoneZ.
10786 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
10789 * Creates a new CResult_NoneErrorZ in the success state.
10791 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
10794 * Creates a new CResult_NoneErrorZ in the error state.
10796 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
10799 * Frees any resources used by the CResult_NoneErrorZ.
10801 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
10804 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10806 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
10809 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
10811 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
10814 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
10816 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
10819 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
10821 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
10824 * Creates a new CResult_NoneAPIErrorZ in the success state.
10826 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
10829 * Creates a new CResult_NoneAPIErrorZ in the error state.
10831 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
10834 * Frees any resources used by the CResult_NoneAPIErrorZ.
10836 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
10839 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
10840 * but with all dynamically-allocated buffers duplicated in new buffers.
10842 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
10845 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10847 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
10850 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10852 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
10855 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
10857 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
10860 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
10862 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
10865 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
10867 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
10870 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
10871 * but with all dynamically-allocated buffers duplicated in new buffers.
10873 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
10876 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
10878 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
10881 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
10883 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
10886 * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
10888 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
10891 * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
10893 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
10896 * Frees any resources used by the CResult_PaymentSecretAPIErrorZ.
10898 void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res);
10901 * Frees the buffer pointed to by `data` if `datalen` is non-0.
10903 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
10906 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
10908 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
10911 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
10913 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
10916 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
10918 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
10921 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
10923 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
10926 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
10928 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
10931 * Frees any resources used by the Event
10933 void Event_free(struct LDKEvent this_ptr);
10936 * Creates a copy of the Event
10938 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
10941 * Serialize the Event object into a byte array which can be read by Event_read
10943 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
10946 * Frees any resources used by the MessageSendEvent
10948 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
10951 * Creates a copy of the MessageSendEvent
10953 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
10956 * Calls the free function if one is set
10958 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
10961 * Calls the free function if one is set
10963 void EventsProvider_free(struct LDKEventsProvider this_ptr);
10966 * Frees any resources used by the APIError
10968 void APIError_free(struct LDKAPIError this_ptr);
10971 * Creates a copy of the APIError
10973 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
10976 * Creates a digital signature of a message given a SecretKey, like the node's secret.
10977 * 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.
10978 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
10980 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, struct LDKSecretKey sk);
10983 * Recovers the PublicKey of the signer of the message given the message and the signature.
10985 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
10988 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
10989 * and the PublicKey.
10991 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
10994 * Creates a copy of the Level
10996 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
10999 * Returns the most verbose logging level.
11001 MUST_USE_RES enum LDKLevel Level_max(void);
11004 * Calls the free function if one is set
11006 void Logger_free(struct LDKLogger this_ptr);
11009 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
11011 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
11014 * Confirmations we will wait for before considering the channel locked in.
11015 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
11016 * equivalent limit applied to outbound channels).
11018 * Default value: 6.
11020 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
11023 * Confirmations we will wait for before considering the channel locked in.
11024 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
11025 * equivalent limit applied to outbound channels).
11027 * Default value: 6.
11029 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
11032 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
11033 * the number of blocks we have to punish our counterparty if they broadcast a revoked
11036 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
11037 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
11038 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
11039 * possibly with time in between to RBF the spending transaction).
11041 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
11042 * case of an honest unilateral channel close, which implicitly decrease the economic value of
11045 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
11046 * can tweak config to ask for more security, not less.
11048 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
11051 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
11052 * the number of blocks we have to punish our counterparty if they broadcast a revoked
11055 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
11056 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
11057 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
11058 * possibly with time in between to RBF the spending transaction).
11060 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
11061 * case of an honest unilateral channel close, which implicitly decrease the economic value of
11064 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
11065 * can tweak config to ask for more security, not less.
11067 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
11070 * Set to the smallest value HTLC we will accept to process.
11072 * This value is sent to our counterparty on channel-open and we close the channel any time
11073 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
11075 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
11078 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
11081 * Set to the smallest value HTLC we will accept to process.
11083 * This value is sent to our counterparty on channel-open and we close the channel any time
11084 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
11086 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
11089 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
11092 * Constructs a new ChannelHandshakeConfig given each field
11094 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);
11097 * Creates a copy of the ChannelHandshakeConfig
11099 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
11102 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
11104 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
11107 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
11109 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
11112 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
11113 * only applies to inbound channels.
11115 * Default value: 0.
11117 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11120 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
11121 * only applies to inbound channels.
11123 * Default value: 0.
11125 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11128 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
11129 * you to limit the maximum minimum-size they can require.
11131 * Default value: u64::max_value.
11133 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11136 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
11137 * you to limit the maximum minimum-size they can require.
11139 * Default value: u64::max_value.
11141 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11144 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
11145 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
11147 * Default value: 0.
11149 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11152 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
11153 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
11155 * Default value: 0.
11157 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11160 * The remote node will require we keep a certain amount in direct payment to ourselves at all
11161 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
11162 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
11164 * Default value: u64::max_value.
11166 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11169 * The remote node will require we keep a certain amount in direct payment to ourselves at all
11170 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
11171 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
11173 * Default value: u64::max_value.
11175 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11178 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
11179 * time. This allows you to set a minimum such value.
11181 * Default value: 0.
11183 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11186 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
11187 * time. This allows you to set a minimum such value.
11189 * Default value: 0.
11191 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
11194 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
11195 * required to always be higher than this value so this only applies to HTLC outputs (and
11196 * potentially to-self outputs before any payments have been made).
11197 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
11198 * This setting allows you to set a minimum dust limit for their commitment transactions,
11199 * reflecting the reality that tiny outputs are not considered standard transactions and will
11200 * not propagate through the Bitcoin network.
11202 * Default value: 546, the current dust limit on the Bitcoin network.
11204 uint64_t ChannelHandshakeLimits_get_min_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11207 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
11208 * required to always be higher than this value so this only applies to HTLC outputs (and
11209 * potentially to-self outputs before any payments have been made).
11210 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
11211 * This setting allows you to set a minimum dust limit for their commitment transactions,
11212 * reflecting the reality that tiny outputs are not considered standard transactions and will
11213 * not propagate through the Bitcoin network.
11215 * Default value: 546, the current dust limit on the Bitcoin network.
11217 void ChannelHandshakeLimits_set_min_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11220 * Maximum allowed threshold above which outputs will not be generated in their commitment
11222 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
11224 * Default value: u64::max_value.
11226 uint64_t ChannelHandshakeLimits_get_max_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11229 * Maximum allowed threshold above which outputs will not be generated in their commitment
11231 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
11233 * Default value: u64::max_value.
11235 void ChannelHandshakeLimits_set_max_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
11238 * Before a channel is usable the funding transaction will need to be confirmed by at least a
11239 * certain number of blocks, specified by the node which is not the funder (as the funder can
11240 * assume they aren't going to double-spend themselves).
11241 * This config allows you to set a limit on the maximum amount of time to wait.
11243 * Default value: 144, or roughly one day and only applies to outbound channels.
11245 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11248 * Before a channel is usable the funding transaction will need to be confirmed by at least a
11249 * certain number of blocks, specified by the node which is not the funder (as the funder can
11250 * assume they aren't going to double-spend themselves).
11251 * This config allows you to set a limit on the maximum amount of time to wait.
11253 * Default value: 144, or roughly one day and only applies to outbound channels.
11255 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
11258 * Set to force the incoming channel to match our announced channel preference in
11261 * Default value: true, to make the default that no announced channels are possible (which is
11262 * appropriate for any nodes which are not online very reliably).
11264 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11267 * Set to force the incoming channel to match our announced channel preference in
11270 * Default value: true, to make the default that no announced channels are possible (which is
11271 * appropriate for any nodes which are not online very reliably).
11273 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
11276 * Set to the amount of time we're willing to wait to claim money back to us.
11278 * Not checking this value would be a security issue, as our peer would be able to set it to
11279 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
11281 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
11282 * reduce the loss of having useless locked funds (if your peer accepts)
11284 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
11287 * Set to the amount of time we're willing to wait to claim money back to us.
11289 * Not checking this value would be a security issue, as our peer would be able to set it to
11290 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
11292 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
11293 * reduce the loss of having useless locked funds (if your peer accepts)
11295 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
11298 * Constructs a new ChannelHandshakeLimits given each field
11300 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);
11303 * Creates a copy of the ChannelHandshakeLimits
11305 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
11308 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
11310 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
11313 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
11315 void ChannelConfig_free(struct LDKChannelConfig this_obj);
11318 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
11319 * This may be allowed to change at runtime in a later update, however doing so must result in
11320 * update messages sent to notify all nodes of our updated relay fee.
11322 * Default value: 0.
11324 uint32_t ChannelConfig_get_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
11327 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
11328 * This may be allowed to change at runtime in a later update, however doing so must result in
11329 * update messages sent to notify all nodes of our updated relay fee.
11331 * Default value: 0.
11333 void ChannelConfig_set_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
11336 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
11337 * the channel this config applies to.
11339 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
11340 * HTLC balance when a channel appears on-chain whereas
11341 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
11342 * (non-HTLC-encumbered) balance.
11344 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
11345 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
11346 * commitment transaction at least once per this many blocks (minus some margin to allow us
11347 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
11348 * the spending transaction).
11350 * Default value: 72 (12 hours at an average of 6 blocks/hour).
11351 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
11352 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
11354 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
11356 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
11359 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
11360 * the channel this config applies to.
11362 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
11363 * HTLC balance when a channel appears on-chain whereas
11364 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
11365 * (non-HTLC-encumbered) balance.
11367 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
11368 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
11369 * commitment transaction at least once per this many blocks (minus some margin to allow us
11370 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
11371 * the spending transaction).
11373 * Default value: 72 (12 hours at an average of 6 blocks/hour).
11374 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
11375 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
11377 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
11379 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
11382 * Set to announce the channel publicly and notify all nodes that they can route via this
11385 * This should only be set to true for nodes which expect to be online reliably.
11387 * As the node which funds a channel picks this value this will only apply for new outbound
11388 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
11390 * This cannot be changed after the initial channel handshake.
11392 * Default value: false.
11394 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
11397 * Set to announce the channel publicly and notify all nodes that they can route via this
11400 * This should only be set to true for nodes which expect to be online reliably.
11402 * As the node which funds a channel picks this value this will only apply for new outbound
11403 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
11405 * This cannot be changed after the initial channel handshake.
11407 * Default value: false.
11409 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
11412 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
11413 * supports it, they will then enforce the mutual-close output to us matches what we provided
11414 * at intialization, preventing us from closing to an alternate pubkey.
11416 * This is set to true by default to provide a slight increase in security, though ultimately
11417 * any attacker who is able to take control of a channel can just as easily send the funds via
11418 * lightning payments, so we never require that our counterparties support this option.
11420 * This cannot be changed after a channel has been initialized.
11422 * Default value: true.
11424 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
11427 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
11428 * supports it, they will then enforce the mutual-close output to us matches what we provided
11429 * at intialization, preventing us from closing to an alternate pubkey.
11431 * This is set to true by default to provide a slight increase in security, though ultimately
11432 * any attacker who is able to take control of a channel can just as easily send the funds via
11433 * lightning payments, so we never require that our counterparties support this option.
11435 * This cannot be changed after a channel has been initialized.
11437 * Default value: true.
11439 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
11442 * Constructs a new ChannelConfig given each field
11444 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);
11447 * Creates a copy of the ChannelConfig
11449 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
11452 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
11454 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
11457 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
11459 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
11462 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
11464 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
11467 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
11469 void UserConfig_free(struct LDKUserConfig this_obj);
11472 * Channel config that we propose to our counterparty.
11474 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
11477 * Channel config that we propose to our counterparty.
11479 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
11482 * Limits applied to our counterparty's proposed channel config settings.
11484 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
11487 * Limits applied to our counterparty's proposed channel config settings.
11489 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
11492 * Channel config which affects behavior during channel lifetime.
11494 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
11497 * Channel config which affects behavior during channel lifetime.
11499 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
11502 * Constructs a new UserConfig given each field
11504 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);
11507 * Creates a copy of the UserConfig
11509 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
11512 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
11514 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
11517 * Creates a copy of the AccessError
11519 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
11522 * Calls the free function if one is set
11524 void Access_free(struct LDKAccess this_ptr);
11527 * Calls the free function if one is set
11529 void Listen_free(struct LDKListen this_ptr);
11532 * Calls the free function if one is set
11534 void Confirm_free(struct LDKConfirm this_ptr);
11537 * Calls the free function if one is set
11539 void Watch_free(struct LDKWatch this_ptr);
11542 * Calls the free function if one is set
11544 void Filter_free(struct LDKFilter this_ptr);
11547 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
11549 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
11552 * First block where the transaction output may have been spent.
11554 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
11557 * First block where the transaction output may have been spent.
11559 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11562 * Outpoint identifying the transaction output.
11564 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
11567 * Outpoint identifying the transaction output.
11569 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
11572 * Spending condition of the transaction output.
11574 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
11577 * Spending condition of the transaction output.
11579 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
11582 * Constructs a new WatchedOutput given each field
11584 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
11587 * Calls the free function if one is set
11589 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
11592 * Creates a copy of the ConfirmationTarget
11594 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
11597 * Calls the free function if one is set
11599 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
11602 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
11604 void ChainMonitor_free(struct LDKChainMonitor this_obj);
11607 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
11609 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
11610 * will call back to it indicating transactions and outputs of interest. This allows clients to
11611 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
11612 * always need to fetch full blocks absent another means for determining which blocks contain
11613 * transactions relevant to the watched channels.
11615 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
11618 * Constructs a new Listen which calls the relevant methods on this_arg.
11619 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
11621 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
11624 * Constructs a new Confirm which calls the relevant methods on this_arg.
11625 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
11627 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
11630 * Constructs a new Watch which calls the relevant methods on this_arg.
11631 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
11633 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
11636 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
11637 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
11639 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
11642 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
11644 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
11647 * The sequence number of this update. Updates *must* be replayed in-order according to this
11648 * sequence number (and updates may panic if they are not). The update_id values are strictly
11649 * increasing and increase by one for each new update, with one exception specified below.
11651 * This sequence number is also used to track up to which points updates which returned
11652 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
11653 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
11655 * The only instance where update_id values are not strictly increasing is the case where we
11656 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
11657 * its docs for more details.
11659 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
11662 * The sequence number of this update. Updates *must* be replayed in-order according to this
11663 * sequence number (and updates may panic if they are not). The update_id values are strictly
11664 * increasing and increase by one for each new update, with one exception specified below.
11666 * This sequence number is also used to track up to which points updates which returned
11667 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
11668 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
11670 * The only instance where update_id values are not strictly increasing is the case where we
11671 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
11672 * its docs for more details.
11674 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
11677 * Creates a copy of the ChannelMonitorUpdate
11679 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
11682 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
11684 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
11687 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
11689 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
11692 * Creates a copy of the ChannelMonitorUpdateErr
11694 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
11697 * Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
11699 void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
11702 * Creates a copy of the MonitorUpdateError
11704 struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
11707 * Frees any resources used by the MonitorEvent
11709 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
11712 * Creates a copy of the MonitorEvent
11714 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
11717 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
11719 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
11722 * Creates a copy of the HTLCUpdate
11724 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
11727 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
11729 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
11732 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
11734 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
11737 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
11739 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
11742 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
11744 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
11747 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
11750 * panics if the given update is not the next update by update_id.
11752 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);
11755 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
11758 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
11761 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
11763 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
11766 * Gets a list of txids, with their output scripts (in the order they appear in the
11767 * transaction), which we must learn about spends of via block_connected().
11769 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
11772 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
11773 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
11774 * have been registered.
11776 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
11779 * Get the list of HTLCs who's status has been updated on chain. This should be called by
11780 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
11782 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
11785 * Gets the list of pending events which were generated by previous actions, clearing the list
11788 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
11789 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
11790 * no internal locking in ChannelMonitors.
11792 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
11795 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
11796 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
11797 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
11798 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
11799 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
11800 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
11801 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
11802 * out-of-band the other node operator to coordinate with him if option is available to you.
11803 * In any-case, choice is up to the user.
11805 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);
11808 * Processes transactions in a newly connected block, which may result in any of the following:
11809 * - update the monitor's state against resolved HTLCs
11810 * - punish the counterparty in the case of seeing a revoked commitment transaction
11811 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
11812 * - detect settled outputs for later spending
11813 * - schedule and bump any in-flight claims
11815 * Returns any new outputs to watch from `txdata`; after called, these are also included in
11816 * [`get_outputs_to_watch`].
11818 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
11820 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);
11823 * Determines if the disconnected block contained any transactions of interest and updates
11826 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);
11829 * Processes transactions confirmed in a block with the given header and height, returning new
11830 * outputs to watch. See [`block_connected`] for details.
11832 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
11833 * blocks. See [`chain::Confirm`] for calling expectations.
11835 * [`block_connected`]: Self::block_connected
11837 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);
11840 * Processes a transaction that was reorganized out of the chain.
11842 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
11843 * than blocks. See [`chain::Confirm`] for calling expectations.
11845 * [`block_disconnected`]: Self::block_disconnected
11847 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);
11850 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
11851 * [`block_connected`] for details.
11853 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
11854 * blocks. See [`chain::Confirm`] for calling expectations.
11856 * [`block_connected`]: Self::block_connected
11858 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);
11861 * Returns the set of txids that should be monitored for re-organization out of the chain.
11863 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
11866 * Calls the free function if one is set
11868 void Persist_free(struct LDKPersist this_ptr);
11871 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
11873 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
11876 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
11878 void OutPoint_free(struct LDKOutPoint this_obj);
11881 * The referenced transaction's txid.
11883 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
11886 * The referenced transaction's txid.
11888 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11891 * The index of the referenced output in its transaction's vout.
11893 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
11896 * The index of the referenced output in its transaction's vout.
11898 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
11901 * Constructs a new OutPoint given each field
11903 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
11906 * Creates a copy of the OutPoint
11908 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
11911 * Convert an `OutPoint` to a lightning channel id.
11913 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
11916 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
11918 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
11921 * Read a OutPoint from a byte array, created by OutPoint_write
11923 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
11926 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
11928 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
11931 * The outpoint which is spendable
11933 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
11936 * The outpoint which is spendable
11938 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
11941 * Per commitment point to derive delayed_payment_key by key holder
11943 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
11946 * Per commitment point to derive delayed_payment_key by key holder
11948 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11951 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
11952 * the witness_script.
11954 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
11957 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
11958 * the witness_script.
11960 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
11963 * The output which is referenced by the given outpoint
11965 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
11968 * The revocation point specific to the commitment transaction which was broadcast. Used to
11969 * derive the witnessScript for this output.
11971 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
11974 * The revocation point specific to the commitment transaction which was broadcast. Used to
11975 * derive the witnessScript for this output.
11977 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11980 * Arbitrary identification information returned by a call to
11981 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
11982 * the channel to spend the output.
11984 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
11987 * Arbitrary identification information returned by a call to
11988 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
11989 * the channel to spend the output.
11991 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11994 * The value of the channel which this output originated from, possibly indirectly.
11996 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
11999 * The value of the channel which this output originated from, possibly indirectly.
12001 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
12004 * Constructs a new DelayedPaymentOutputDescriptor given each field
12006 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);
12009 * Creates a copy of the DelayedPaymentOutputDescriptor
12011 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
12014 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
12016 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
12019 * The outpoint which is spendable
12021 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12024 * The outpoint which is spendable
12026 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
12029 * The output which is referenced by the given outpoint
12031 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
12034 * Arbitrary identification information returned by a call to
12035 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12036 * the channel to spend the output.
12038 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
12041 * Arbitrary identification information returned by a call to
12042 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
12043 * the channel to spend the output.
12045 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12048 * The value of the channel which this transactions spends.
12050 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
12053 * The value of the channel which this transactions spends.
12055 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
12058 * Constructs a new StaticPaymentOutputDescriptor given each field
12060 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);
12063 * Creates a copy of the StaticPaymentOutputDescriptor
12065 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
12068 * Frees any resources used by the SpendableOutputDescriptor
12070 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
12073 * Creates a copy of the SpendableOutputDescriptor
12075 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
12078 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
12080 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
12083 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
12085 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
12088 * Calls the free function if one is set
12090 void BaseSign_free(struct LDKBaseSign this_ptr);
12093 * Creates a copy of a Sign
12095 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
12098 * Calls the free function if one is set
12100 void Sign_free(struct LDKSign this_ptr);
12103 * Calls the free function if one is set
12105 void KeysInterface_free(struct LDKKeysInterface this_ptr);
12108 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
12110 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
12113 * Private key of anchor tx
12115 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12118 * Private key of anchor tx
12120 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12123 * Holder secret key for blinded revocation pubkey
12125 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12128 * Holder secret key for blinded revocation pubkey
12130 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12133 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
12135 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12138 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
12140 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12143 * Holder secret key used in HTLC tx
12145 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12148 * Holder secret key used in HTLC tx
12150 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12153 * Holder htlc secret key used in commitment tx htlc outputs
12155 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12158 * Holder htlc secret key used in commitment tx htlc outputs
12160 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
12165 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
12170 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12173 * Creates a copy of the InMemorySigner
12175 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
12178 * Create a new InMemorySigner
12180 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);
12183 * Counterparty pubkeys.
12184 * Will panic if ready_channel wasn't called.
12186 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12189 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
12190 * transactions, ie the amount of time that we have to wait to recover our funds if we
12191 * broadcast a transaction.
12192 * Will panic if ready_channel wasn't called.
12194 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12197 * The contest_delay value specified by us and applied on transactions broadcastable
12198 * by our counterparty, ie the amount of time that they have to wait to recover their funds
12199 * if they broadcast a transaction.
12200 * Will panic if ready_channel wasn't called.
12202 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12205 * Whether the holder is the initiator
12206 * Will panic if ready_channel wasn't called.
12208 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12212 * Will panic if ready_channel wasn't called.
12214 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12217 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
12218 * building transactions.
12220 * Will panic if ready_channel wasn't called.
12222 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12225 * Sign the single input of spend_tx at index `input_idx` which spends the output
12226 * described by descriptor, returning the witness stack for the input.
12228 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
12229 * or is not spending the outpoint described by `descriptor.outpoint`.
12231 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);
12234 * Sign the single input of spend_tx at index `input_idx` which spends the output
12235 * described by descriptor, returning the witness stack for the input.
12237 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
12238 * is not spending the outpoint described by `descriptor.outpoint`, or does not have a
12239 * sequence set to `descriptor.to_self_delay`.
12241 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);
12244 * Constructs a new BaseSign which calls the relevant methods on this_arg.
12245 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
12247 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12250 * Constructs a new Sign which calls the relevant methods on this_arg.
12251 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
12253 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
12256 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
12258 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
12261 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
12263 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
12266 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
12268 void KeysManager_free(struct LDKKeysManager this_obj);
12271 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
12272 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
12273 * starting_time isn't strictly required to actually be a time, but it must absolutely,
12274 * without a doubt, be unique to this instance. ie if you start multiple times with the same
12275 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
12276 * simply use the current time (with very high precision).
12278 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
12279 * obviously, starting_time should be unique every time you reload the library - it is only
12280 * used to generate new ephemeral key data (which will be stored by the individual channel if
12283 * Note that the seed is required to recover certain on-chain funds independent of
12284 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
12285 * channel, and some on-chain during-closing funds.
12287 * Note that until the 0.1 release there is no guarantee of backward compatibility between
12288 * versions. Once the library is more fully supported, the docs will be updated to include a
12289 * detailed description of the guarantee.
12291 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
12294 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
12296 * Key derivation parameters are accessible through a per-channel secrets
12297 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
12298 * onchain output detection for which a corresponding delayed_payment_key must be derived.
12300 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]);
12303 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
12304 * output to the given change destination (if sufficient change value remains). The
12305 * transaction will have a feerate, at least, of the given value.
12307 * Returns `Err(())` if the output value is greater than the input value minus required fee or
12308 * if a descriptor was duplicated.
12310 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
12312 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
12313 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
12315 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);
12318 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
12319 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
12321 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
12324 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
12326 void ChannelManager_free(struct LDKChannelManager this_obj);
12329 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
12331 void ChainParameters_free(struct LDKChainParameters this_obj);
12334 * The network for determining the `chain_hash` in Lightning messages.
12336 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
12339 * The network for determining the `chain_hash` in Lightning messages.
12341 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
12344 * The hash and height of the latest block successfully connected.
12346 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
12348 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
12351 * The hash and height of the latest block successfully connected.
12353 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
12355 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
12358 * Constructs a new ChainParameters given each field
12360 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
12363 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
12365 void BestBlock_free(struct LDKBestBlock this_obj);
12368 * Creates a copy of the BestBlock
12370 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
12373 * Returns the best block from the genesis of the given network.
12375 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
12378 * Returns the best block as identified by the given block hash and height.
12380 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
12383 * Returns the best block hash.
12385 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
12388 * Returns the best block height.
12390 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
12393 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
12395 void ChannelDetails_free(struct LDKChannelDetails this_obj);
12398 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
12399 * thereafter this is the txid of the funding transaction xor the funding transaction output).
12400 * Note that this means this value is *not* persistent - it can change once during the
12401 * lifetime of the channel.
12403 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
12406 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
12407 * thereafter this is the txid of the funding transaction xor the funding transaction output).
12408 * Note that this means this value is *not* persistent - it can change once during the
12409 * lifetime of the channel.
12411 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12414 * The position of the funding transaction in the chain. None if the funding transaction has
12415 * not yet been confirmed and the channel fully opened.
12417 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12420 * The position of the funding transaction in the chain. None if the funding transaction has
12421 * not yet been confirmed and the channel fully opened.
12423 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
12426 * The node_id of our counterparty
12428 struct LDKPublicKey ChannelDetails_get_remote_network_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12431 * The node_id of our counterparty
12433 void ChannelDetails_set_remote_network_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12436 * The Features the channel counterparty provided upon last connection.
12437 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
12438 * many routing-relevant features are present in the init context.
12440 struct LDKInitFeatures ChannelDetails_get_counterparty_features(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12443 * The Features the channel counterparty provided upon last connection.
12444 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
12445 * many routing-relevant features are present in the init context.
12447 void ChannelDetails_set_counterparty_features(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
12450 * The value, in satoshis, of this channel as appears in the funding output
12452 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12455 * The value, in satoshis, of this channel as appears in the funding output
12457 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
12460 * The user_id passed in to create_channel, or 0 if the channel was inbound.
12462 uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12465 * The user_id passed in to create_channel, or 0 if the channel was inbound.
12467 void ChannelDetails_set_user_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
12470 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
12471 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
12472 * available for inclusion in new outbound HTLCs). This further does not include any pending
12473 * outgoing HTLCs which are awaiting some other resolution to be sent.
12475 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12478 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
12479 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
12480 * available for inclusion in new outbound HTLCs). This further does not include any pending
12481 * outgoing HTLCs which are awaiting some other resolution to be sent.
12483 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
12486 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
12487 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
12488 * available for inclusion in new inbound HTLCs).
12489 * Note that there are some corner cases not fully handled here, so the actual available
12490 * inbound capacity may be slightly higher than this.
12492 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12495 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
12496 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
12497 * available for inclusion in new inbound HTLCs).
12498 * Note that there are some corner cases not fully handled here, so the actual available
12499 * inbound capacity may be slightly higher than this.
12501 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
12504 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
12505 * the peer is connected, and (c) no monitor update failure is pending resolution.
12507 bool ChannelDetails_get_is_live(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
12510 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
12511 * the peer is connected, and (c) no monitor update failure is pending resolution.
12513 void ChannelDetails_set_is_live(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
12516 * Creates a copy of the ChannelDetails
12518 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
12521 * Frees any resources used by the PaymentSendFailure
12523 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
12526 * Creates a copy of the PaymentSendFailure
12528 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
12531 * Constructs a new ChannelManager to hold several channels and route between them.
12533 * This is the main \"logic hub\" for all channel-related actions, and implements
12534 * ChannelMessageHandler.
12536 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
12538 * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
12540 * Users need to notify the new ChannelManager when a new block is connected or
12541 * disconnected using its `block_connected` and `block_disconnected` methods, starting
12542 * from after `params.latest_hash`.
12544 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);
12547 * Gets the current configuration applied to all new channels, as
12549 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
12552 * Creates a new outbound channel to the given remote node and with the given value.
12554 * user_id will be provided back as user_channel_id in FundingGenerationReady events to allow
12555 * tracking of which events correspond with which create_channel call. Note that the
12556 * user_channel_id defaults to 0 for inbound channels, so you may wish to avoid using 0 for
12557 * user_id here. user_id has no meaning inside of LDK, it is simply copied to events and
12558 * otherwise ignored.
12560 * If successful, will generate a SendOpenChannel message event, so you should probably poll
12561 * PeerManager::process_events afterwards.
12563 * Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
12564 * greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
12566 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);
12569 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
12570 * more information.
12572 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
12575 * Gets the list of usable channels, in random order. Useful as an argument to
12576 * get_route to ensure non-announced channels are used.
12578 * These are guaranteed to have their is_live value set to true, see the documentation for
12579 * ChannelDetails::is_live for more info on exactly what the criteria are.
12581 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
12584 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
12585 * will be accepted on the given channel, and after additional timeout/the closing of all
12586 * pending HTLCs, the channel will be closed on chain.
12588 * May generate a SendShutdown message event on success, which should be relayed.
12590 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
12593 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
12594 * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
12596 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
12599 * Force close all channels, immediately broadcasting the latest local commitment transaction
12600 * for each to the chain and rejecting new HTLCs on each.
12602 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
12605 * Sends a payment along a given route.
12607 * Value parameters are provided via the last hop in route, see documentation for RouteHop
12608 * fields for more info.
12610 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
12611 * payment), we don't do anything to stop you! We always try to ensure that if the provided
12612 * next hop knows the preimage to payment_hash they can claim an additional amount as
12613 * specified in the last hop in the route! Thus, you should probably do your own
12614 * payment_preimage tracking (which you should already be doing as they represent \"proof of
12615 * payment\") and prevent double-sends yourself.
12617 * May generate SendHTLCs message(s) event on success, which should be relayed.
12619 * Each path may have a different return value, and PaymentSendValue may return a Vec with
12620 * each entry matching the corresponding-index entry in the route paths, see
12621 * PaymentSendFailure for more info.
12623 * In general, a path may raise:
12624 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
12625 * node public key) is specified.
12626 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
12627 * (including due to previous monitor update failure or new permanent monitor update
12629 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
12630 * relevant updates.
12632 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
12633 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
12634 * different route unless you intend to pay twice!
12636 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
12637 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
12638 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
12639 * must not contain multiple paths as multi-path payments require a recipient-provided
12641 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
12642 * bit set (either as required or as available). If multiple paths are present in the Route,
12643 * we assume the invoice had the basic_mpp feature set.
12645 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);
12648 * Call this upon creation of a funding transaction for the given channel.
12650 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
12651 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
12653 * Panics if a funding transaction has already been provided for this channel.
12655 * May panic if the output found in the funding transaction is duplicative with some other
12656 * channel (note that this should be trivially prevented by using unique funding transaction
12657 * keys per-channel).
12659 * Do NOT broadcast the funding transaction yourself. When we have safely received our
12660 * counterparty's signature the funding transaction will automatically be broadcast via the
12661 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
12663 * Note that this includes RBF or similar transaction replacement strategies - lightning does
12664 * not currently support replacing a funding transaction on an existing channel. Instead,
12665 * create a new channel with a conflicting funding transaction.
12667 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);
12670 * Generates a signed node_announcement from the given arguments and creates a
12671 * BroadcastNodeAnnouncement event. Note that such messages will be ignored unless peers have
12672 * seen a channel_announcement from us (ie unless we have public channels open).
12674 * RGB is a node \"color\" and alias is a printable human-readable string to describe this node
12675 * to humans. They carry no in-protocol meaning.
12677 * addresses represent the set (possibly empty) of socket addresses on which this node accepts
12678 * incoming connections. These will be broadcast to the network, publicly tying these
12679 * addresses together. If you wish to preserve user privacy, addresses should likely contain
12680 * only Tor Onion addresses.
12682 * Panics if addresses is absurdly large (more than 500).
12684 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
12687 * Processes HTLCs which are pending waiting on random forward delay.
12689 * Should only really ever be called in response to a PendingHTLCsForwardable event.
12690 * Will likely generate further events.
12692 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
12695 * If a peer is disconnected we mark any channels with that peer as 'disabled'.
12696 * After some time, if channels are still disabled we need to broadcast a ChannelUpdate
12697 * to inform the network about the uselessness of these channels.
12699 * This method handles all the details, and must be called roughly once per minute.
12701 * Note that in some rare cases this may generate a `chain::Watch::update_channel` call.
12703 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
12706 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
12707 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
12708 * along the path (including in our own channel on which we received it).
12709 * Returns false if no payment was found to fail backwards, true if the process of failing the
12710 * HTLC backwards has been started.
12712 MUST_USE_RES bool ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
12715 * Provides a payment preimage in response to a PaymentReceived event, returning true and
12716 * generating message events for the net layer to claim the payment, if possible. Thus, you
12717 * should probably kick the net layer to go send messages if this returns true!
12719 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
12720 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
12721 * event matches your expectation. If you fail to do so and call this method, you may provide
12722 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
12724 * May panic if called except in response to a PaymentReceived event.
12726 * [`create_inbound_payment`]: Self::create_inbound_payment
12727 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
12729 MUST_USE_RES bool ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
12732 * Gets the node_id held by this ChannelManager
12734 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
12737 * Restores a single, given channel to normal operation after a
12738 * ChannelMonitorUpdateErr::TemporaryFailure was returned from a channel monitor update
12741 * All ChannelMonitor updates up to and including highest_applied_update_id must have been
12742 * fully committed in every copy of the given channels' ChannelMonitors.
12744 * Note that there is no effect to calling with a highest_applied_update_id other than the
12745 * current latest ChannelMonitorUpdate and one call to this function after multiple
12746 * ChannelMonitorUpdateErr::TemporaryFailures is fine. The highest_applied_update_id field
12747 * exists largely only to prevent races between this and concurrent update_monitor calls.
12749 * Thus, the anticipated use is, at a high level:
12750 * 1) You register a chain::Watch with this ChannelManager,
12751 * 2) it stores each update to disk, and begins updating any remote (eg watchtower) copies of
12752 * said ChannelMonitors as it can, returning ChannelMonitorUpdateErr::TemporaryFailures
12753 * any time it cannot do so instantly,
12754 * 3) update(s) are applied to each remote copy of a ChannelMonitor,
12755 * 4) once all remote copies are updated, you call this function with the update_id that
12756 * completed, and once it is the latest the Channel will be re-enabled.
12758 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);
12761 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
12764 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
12765 * [`PaymentHash`] and [`PaymentPreimage`] for you, returning the first and storing the second.
12767 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
12768 * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
12769 * passed directly to [`claim_funds`].
12771 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
12773 * [`claim_funds`]: Self::claim_funds
12774 * [`PaymentReceived`]: events::Event::PaymentReceived
12775 * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
12776 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
12778 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);
12781 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
12782 * stored external to LDK.
12784 * A [`PaymentReceived`] event will only be generated if the [`PaymentSecret`] matches a
12785 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
12786 * the `min_value_msat` provided here, if one is provided.
12788 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) must be globally unique. This
12789 * method may return an Err if another payment with the same payment_hash is still pending.
12791 * `user_payment_id` will be provided back in [`PaymentReceived::user_payment_id`] events to
12792 * allow tracking of which events correspond with which calls to this and
12793 * [`create_inbound_payment`]. `user_payment_id` has no meaning inside of LDK, it is simply
12794 * copied to events and otherwise ignored. It may be used to correlate PaymentReceived events
12795 * with invoice metadata stored elsewhere.
12797 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
12798 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
12799 * before a [`PaymentReceived`] event will be generated, ensuring that we do not provide the
12800 * sender \"proof-of-payment\" unless they have paid the required amount.
12802 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
12803 * in excess of the current time. This should roughly match the expiry time set in the invoice.
12804 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
12805 * pay the invoice failing. The BOLT spec suggests 7,200 secs as a default validity time for
12806 * invoices when no timeout is set.
12808 * Note that we use block header time to time-out pending inbound payments (with some margin
12809 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
12810 * accept a payment and generate a [`PaymentReceived`] event for some time after the expiry.
12811 * If you need exact expiry semantics, you should enforce them upon receipt of
12812 * [`PaymentReceived`].
12814 * May panic if `invoice_expiry_delta_secs` is greater than one year.
12816 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
12817 * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
12819 * [`create_inbound_payment`]: Self::create_inbound_payment
12820 * [`PaymentReceived`]: events::Event::PaymentReceived
12821 * [`PaymentReceived::user_payment_id`]: events::Event::PaymentReceived::user_payment_id
12823 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);
12826 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
12827 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
12829 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
12832 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
12833 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
12835 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
12838 * Constructs a new Listen which calls the relevant methods on this_arg.
12839 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
12841 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
12844 * Constructs a new Confirm which calls the relevant methods on this_arg.
12845 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
12847 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
12850 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
12851 * indicating whether persistence is necessary. Only one listener on
12852 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
12854 * Note that the feature `allow_wallclock_use` must be enabled to use this function.
12856 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
12859 * Blocks until ChannelManager needs to be persisted. Only one listener on
12860 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
12863 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
12866 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
12867 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
12869 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
12872 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
12874 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
12877 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
12879 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
12882 * The keys provider which will give us relevant keys. Some keys will be loaded during
12883 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
12886 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
12889 * The keys provider which will give us relevant keys. Some keys will be loaded during
12890 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
12893 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
12896 * The fee_estimator for use in the ChannelManager in the future.
12898 * No calls to the FeeEstimator will be made during deserialization.
12900 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
12903 * The fee_estimator for use in the ChannelManager in the future.
12905 * No calls to the FeeEstimator will be made during deserialization.
12907 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
12910 * The chain::Watch for use in the ChannelManager in the future.
12912 * No calls to the chain::Watch will be made during deserialization. It is assumed that
12913 * you have deserialized ChannelMonitors separately and will add them to your
12914 * chain::Watch after deserializing this ChannelManager.
12916 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
12919 * The chain::Watch for use in the ChannelManager in the future.
12921 * No calls to the chain::Watch will be made during deserialization. It is assumed that
12922 * you have deserialized ChannelMonitors separately and will add them to your
12923 * chain::Watch after deserializing this ChannelManager.
12925 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
12928 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
12929 * used to broadcast the latest local commitment transactions of channels which must be
12930 * force-closed during deserialization.
12932 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
12935 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
12936 * used to broadcast the latest local commitment transactions of channels which must be
12937 * force-closed during deserialization.
12939 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
12942 * The Logger for use in the ChannelManager and which may be used to log information during
12945 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
12948 * The Logger for use in the ChannelManager and which may be used to log information during
12951 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
12954 * Default settings used for new channels. Any existing channels will continue to use the
12955 * runtime settings which were stored when the ChannelManager was serialized.
12957 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
12960 * Default settings used for new channels. Any existing channels will continue to use the
12961 * runtime settings which were stored when the ChannelManager was serialized.
12963 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
12966 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
12967 * HashMap for you. This is primarily useful for C bindings where it is not practical to
12968 * populate a HashMap directly from C.
12970 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);
12973 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
12975 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
12978 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
12980 void DecodeError_free(struct LDKDecodeError this_obj);
12983 * Creates a copy of the DecodeError
12985 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
12988 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
12990 void Init_free(struct LDKInit this_obj);
12993 * The relevant features which the sender supports
12995 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
12998 * The relevant features which the sender supports
13000 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
13003 * Constructs a new Init given each field
13005 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
13008 * Creates a copy of the Init
13010 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
13013 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
13015 void ErrorMessage_free(struct LDKErrorMessage this_obj);
13018 * The channel ID involved in the error
13020 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
13023 * The channel ID involved in the error
13025 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13028 * A possibly human-readable error description.
13029 * The string should be sanitized before it is used (e.g. emitted to logs
13030 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
13031 * vulnerability in the terminal emulator or the logging subsystem.
13033 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
13036 * A possibly human-readable error description.
13037 * The string should be sanitized before it is used (e.g. emitted to logs
13038 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
13039 * vulnerability in the terminal emulator or the logging subsystem.
13041 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
13044 * Constructs a new ErrorMessage given each field
13046 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg);
13049 * Creates a copy of the ErrorMessage
13051 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
13054 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
13056 void Ping_free(struct LDKPing this_obj);
13059 * The desired response length
13061 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
13064 * The desired response length
13066 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
13069 * The ping packet size.
13070 * This field is not sent on the wire. byteslen zeros are sent.
13072 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
13075 * The ping packet size.
13076 * This field is not sent on the wire. byteslen zeros are sent.
13078 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
13081 * Constructs a new Ping given each field
13083 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
13086 * Creates a copy of the Ping
13088 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
13091 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
13093 void Pong_free(struct LDKPong this_obj);
13096 * The pong packet size.
13097 * This field is not sent on the wire. byteslen zeros are sent.
13099 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
13102 * The pong packet size.
13103 * This field is not sent on the wire. byteslen zeros are sent.
13105 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
13108 * Constructs a new Pong given each field
13110 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
13113 * Creates a copy of the Pong
13115 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
13118 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
13120 void OpenChannel_free(struct LDKOpenChannel this_obj);
13123 * The genesis hash of the blockchain where the channel is to be opened
13125 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
13128 * The genesis hash of the blockchain where the channel is to be opened
13130 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13133 * A temporary channel ID, until the funding outpoint is announced
13135 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
13138 * A temporary channel ID, until the funding outpoint is announced
13140 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13143 * The channel value
13145 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13148 * The channel value
13150 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13153 * The amount to push to the counterparty as part of the open, in milli-satoshi
13155 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13158 * The amount to push to the counterparty as part of the open, in milli-satoshi
13160 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13163 * The threshold below which outputs on transactions broadcast by sender will be omitted
13165 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13168 * The threshold below which outputs on transactions broadcast by sender will be omitted
13170 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13173 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
13175 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13178 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
13180 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13183 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
13185 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13188 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
13190 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13193 * The minimum HTLC size incoming to sender, in milli-satoshi
13195 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13198 * The minimum HTLC size incoming to sender, in milli-satoshi
13200 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
13203 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
13205 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13208 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
13210 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
13213 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
13215 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13218 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
13220 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
13223 * The maximum number of inbound HTLCs towards sender
13225 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13228 * The maximum number of inbound HTLCs towards sender
13230 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
13233 * The sender's key controlling the funding transaction
13235 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13238 * The sender's key controlling the funding transaction
13240 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13243 * Used to derive a revocation key for transactions broadcast by counterparty
13245 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13248 * Used to derive a revocation key for transactions broadcast by counterparty
13250 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13253 * A payment key to sender for transactions broadcast by counterparty
13255 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13258 * A payment key to sender for transactions broadcast by counterparty
13260 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13263 * Used to derive a payment key to sender for transactions broadcast by sender
13265 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13268 * Used to derive a payment key to sender for transactions broadcast by sender
13270 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13273 * Used to derive an HTLC payment key to sender
13275 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13278 * Used to derive an HTLC payment key to sender
13280 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13283 * The first to-be-broadcast-by-sender transaction's per commitment point
13285 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13288 * The first to-be-broadcast-by-sender transaction's per commitment point
13290 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13295 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
13300 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
13303 * Creates a copy of the OpenChannel
13305 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
13308 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
13310 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
13313 * A temporary channel ID, until the funding outpoint is announced
13315 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
13318 * A temporary channel ID, until the funding outpoint is announced
13320 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13323 * The threshold below which outputs on transactions broadcast by sender will be omitted
13325 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13328 * The threshold below which outputs on transactions broadcast by sender will be omitted
13330 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
13333 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
13335 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13338 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
13340 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
13343 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
13345 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13348 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
13350 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
13353 * The minimum HTLC size incoming to sender, in milli-satoshi
13355 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13358 * The minimum HTLC size incoming to sender, in milli-satoshi
13360 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
13363 * Minimum depth of the funding transaction before the channel is considered open
13365 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13368 * Minimum depth of the funding transaction before the channel is considered open
13370 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
13373 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
13375 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13378 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
13380 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
13383 * The maximum number of inbound HTLCs towards sender
13385 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13388 * The maximum number of inbound HTLCs towards sender
13390 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
13393 * The sender's key controlling the funding transaction
13395 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13398 * The sender's key controlling the funding transaction
13400 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13403 * Used to derive a revocation key for transactions broadcast by counterparty
13405 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13408 * Used to derive a revocation key for transactions broadcast by counterparty
13410 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13413 * A payment key to sender for transactions broadcast by counterparty
13415 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13418 * A payment key to sender for transactions broadcast by counterparty
13420 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13423 * Used to derive a payment key to sender for transactions broadcast by sender
13425 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13428 * Used to derive a payment key to sender for transactions broadcast by sender
13430 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13433 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
13435 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13438 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
13440 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13443 * The first to-be-broadcast-by-sender transaction's per commitment point
13445 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
13448 * The first to-be-broadcast-by-sender transaction's per commitment point
13450 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13453 * Creates a copy of the AcceptChannel
13455 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
13458 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
13460 void FundingCreated_free(struct LDKFundingCreated this_obj);
13463 * A temporary channel ID, until the funding is established
13465 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
13468 * A temporary channel ID, until the funding is established
13470 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13473 * The funding transaction ID
13475 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
13478 * The funding transaction ID
13480 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13483 * The specific output index funding this channel
13485 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
13488 * The specific output index funding this channel
13490 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
13493 * The signature of the channel initiator (funder) on the funding transaction
13495 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
13498 * The signature of the channel initiator (funder) on the funding transaction
13500 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
13503 * Constructs a new FundingCreated given each field
13505 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);
13508 * Creates a copy of the FundingCreated
13510 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
13513 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
13515 void FundingSigned_free(struct LDKFundingSigned this_obj);
13520 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
13525 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13528 * The signature of the channel acceptor (fundee) on the funding transaction
13530 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
13533 * The signature of the channel acceptor (fundee) on the funding transaction
13535 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
13538 * Constructs a new FundingSigned given each field
13540 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
13543 * Creates a copy of the FundingSigned
13545 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
13548 * Frees any resources used by the FundingLocked, if is_owned is set and inner is non-NULL.
13550 void FundingLocked_free(struct LDKFundingLocked this_obj);
13555 const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32];
13560 void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13563 * The per-commitment point of the second commitment transaction
13565 struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr);
13568 * The per-commitment point of the second commitment transaction
13570 void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13573 * Constructs a new FundingLocked given each field
13575 MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
13578 * Creates a copy of the FundingLocked
13580 struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
13583 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
13585 void Shutdown_free(struct LDKShutdown this_obj);
13590 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
13595 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13598 * The destination of this peer's funds on closing.
13599 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
13601 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
13604 * The destination of this peer's funds on closing.
13605 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
13607 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
13610 * Constructs a new Shutdown given each field
13612 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
13615 * Creates a copy of the Shutdown
13617 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
13620 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
13622 void ClosingSigned_free(struct LDKClosingSigned this_obj);
13627 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
13632 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13635 * The proposed total fee for the closing transaction
13637 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
13640 * The proposed total fee for the closing transaction
13642 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
13645 * A signature on the closing transaction
13647 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
13650 * A signature on the closing transaction
13652 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
13655 * Constructs a new ClosingSigned given each field
13657 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg);
13660 * Creates a copy of the ClosingSigned
13662 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
13665 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
13667 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
13672 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
13677 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13682 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
13687 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
13690 * The HTLC value in milli-satoshi
13692 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
13695 * The HTLC value in milli-satoshi
13697 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
13700 * The payment hash, the pre-image of which controls HTLC redemption
13702 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
13705 * The payment hash, the pre-image of which controls HTLC redemption
13707 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13710 * The expiry height of the HTLC
13712 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
13715 * The expiry height of the HTLC
13717 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
13720 * Creates a copy of the UpdateAddHTLC
13722 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
13725 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
13727 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
13732 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
13737 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13742 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
13747 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
13750 * The pre-image of the payment hash, allowing HTLC redemption
13752 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
13755 * The pre-image of the payment hash, allowing HTLC redemption
13757 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13760 * Constructs a new UpdateFulfillHTLC given each field
13762 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
13765 * Creates a copy of the UpdateFulfillHTLC
13767 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
13770 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
13772 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
13777 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
13782 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13787 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
13792 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
13795 * Creates a copy of the UpdateFailHTLC
13797 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
13800 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
13802 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
13807 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
13812 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13817 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
13822 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
13827 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
13832 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
13835 * Creates a copy of the UpdateFailMalformedHTLC
13837 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
13840 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
13842 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
13847 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
13852 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13855 * A signature on the commitment transaction
13857 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
13860 * A signature on the commitment transaction
13862 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
13865 * Signatures on the HTLC transactions
13867 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
13870 * Constructs a new CommitmentSigned given each field
13872 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
13875 * Creates a copy of the CommitmentSigned
13877 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
13880 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
13882 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
13887 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
13892 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13895 * The secret corresponding to the per-commitment point
13897 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
13900 * The secret corresponding to the per-commitment point
13902 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13905 * The next sender-broadcast commitment transaction's per-commitment point
13907 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
13910 * The next sender-broadcast commitment transaction's per-commitment point
13912 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13915 * Constructs a new RevokeAndACK given each field
13917 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);
13920 * Creates a copy of the RevokeAndACK
13922 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
13925 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
13927 void UpdateFee_free(struct LDKUpdateFee this_obj);
13932 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
13937 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13940 * Fee rate per 1000-weight of the transaction
13942 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
13945 * Fee rate per 1000-weight of the transaction
13947 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
13950 * Constructs a new UpdateFee given each field
13952 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
13955 * Creates a copy of the UpdateFee
13957 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
13960 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
13962 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
13965 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
13966 * belonging to the recipient
13968 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
13971 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
13972 * belonging to the recipient
13974 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13977 * The sender's per-commitment point for their current commitment transaction
13979 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
13982 * The sender's per-commitment point for their current commitment transaction
13984 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13987 * Constructs a new DataLossProtect given each field
13989 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
13992 * Creates a copy of the DataLossProtect
13994 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
13997 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
13999 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
14004 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
14009 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14012 * The next commitment number for the sender
14014 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
14017 * The next commitment number for the sender
14019 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
14022 * The next commitment number for the recipient
14024 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
14027 * The next commitment number for the recipient
14029 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
14032 * Creates a copy of the ChannelReestablish
14034 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
14037 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
14039 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
14044 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
14049 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14052 * The short channel ID
14054 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
14057 * The short channel ID
14059 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
14062 * A signature by the node key
14064 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
14067 * A signature by the node key
14069 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
14072 * A signature by the funding key
14074 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
14077 * A signature by the funding key
14079 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
14082 * Constructs a new AnnouncementSignatures given each field
14084 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);
14087 * Creates a copy of the AnnouncementSignatures
14089 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
14092 * Frees any resources used by the NetAddress
14094 void NetAddress_free(struct LDKNetAddress this_ptr);
14097 * Creates a copy of the NetAddress
14099 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
14102 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
14104 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
14107 * Read a Result from a byte array, created by Result_write
14109 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
14112 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
14114 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
14117 * The advertised features
14119 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
14122 * The advertised features
14124 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
14127 * A strictly monotonic announcement counter, with gaps allowed
14129 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
14132 * A strictly monotonic announcement counter, with gaps allowed
14134 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
14137 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
14140 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
14143 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
14146 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14149 * An RGB color for UI purposes
14151 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
14154 * An RGB color for UI purposes
14156 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
14159 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
14162 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
14165 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
14168 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14171 * List of addresses on which this node is reachable
14173 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
14176 * Creates a copy of the UnsignedNodeAnnouncement
14178 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
14181 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
14183 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
14186 * The signature by the node key
14188 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
14191 * The signature by the node key
14193 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14196 * The actual content of the announcement
14198 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
14201 * The actual content of the announcement
14203 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
14206 * Constructs a new NodeAnnouncement given each field
14208 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
14211 * Creates a copy of the NodeAnnouncement
14213 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
14216 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
14218 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
14221 * The advertised channel features
14223 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14226 * The advertised channel features
14228 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
14231 * The genesis hash of the blockchain where the channel is to be opened
14233 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
14236 * The genesis hash of the blockchain where the channel is to be opened
14238 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14241 * The short channel ID
14243 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14246 * The short channel ID
14248 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
14251 * One of the two node_ids which are endpoints of this channel
14253 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14256 * One of the two node_ids which are endpoints of this channel
14258 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14261 * The other of the two node_ids which are endpoints of this channel
14263 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14266 * The other of the two node_ids which are endpoints of this channel
14268 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14271 * The funding key for the first node
14273 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14276 * The funding key for the first node
14278 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14281 * The funding key for the second node
14283 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
14286 * The funding key for the second node
14288 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14291 * Creates a copy of the UnsignedChannelAnnouncement
14293 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
14296 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
14298 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
14301 * Authentication of the announcement by the first public node
14303 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
14306 * Authentication of the announcement by the first public node
14308 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14311 * Authentication of the announcement by the second public node
14313 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
14316 * Authentication of the announcement by the second public node
14318 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14321 * Proof of funding UTXO ownership by the first public node
14323 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
14326 * Proof of funding UTXO ownership by the first public node
14328 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14331 * Proof of funding UTXO ownership by the second public node
14333 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
14336 * Proof of funding UTXO ownership by the second public node
14338 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
14341 * The actual announcement
14343 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
14346 * The actual announcement
14348 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
14351 * Constructs a new ChannelAnnouncement given each field
14353 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);
14356 * Creates a copy of the ChannelAnnouncement
14358 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
14361 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
14363 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
14366 * The genesis hash of the blockchain where the channel is to be opened
14368 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
14371 * The genesis hash of the blockchain where the channel is to be opened
14373 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14376 * The short channel ID
14378 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14381 * The short channel ID
14383 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
14386 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
14388 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14391 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
14393 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
14398 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14403 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
14406 * The number of blocks such that if:
14407 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
14408 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
14409 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
14410 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
14411 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
14412 * forwarding. Note that the HTLC sender is the one who originally sets this value when
14413 * constructing the route.
14415 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14418 * The number of blocks such that if:
14419 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
14420 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
14421 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
14422 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
14423 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
14424 * forwarding. Note that the HTLC sender is the one who originally sets this value when
14425 * constructing the route.
14427 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
14430 * The minimum HTLC size incoming to sender, in milli-satoshi
14432 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14435 * The minimum HTLC size incoming to sender, in milli-satoshi
14437 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
14440 * The base HTLC fee charged by sender, in milli-satoshi
14442 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14445 * The base HTLC fee charged by sender, in milli-satoshi
14447 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
14450 * The amount to fee multiplier, in micro-satoshi
14452 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
14455 * The amount to fee multiplier, in micro-satoshi
14457 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
14460 * Creates a copy of the UnsignedChannelUpdate
14462 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
14465 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
14467 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
14470 * A signature of the channel update
14472 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
14475 * A signature of the channel update
14477 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
14480 * The actual channel update
14482 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
14485 * The actual channel update
14487 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
14490 * Constructs a new ChannelUpdate given each field
14492 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
14495 * Creates a copy of the ChannelUpdate
14497 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
14500 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
14502 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
14505 * The genesis hash of the blockchain being queried
14507 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
14510 * The genesis hash of the blockchain being queried
14512 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14515 * The height of the first block for the channel UTXOs being queried
14517 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
14520 * The height of the first block for the channel UTXOs being queried
14522 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
14525 * The number of blocks to include in the query results
14527 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
14530 * The number of blocks to include in the query results
14532 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
14535 * Constructs a new QueryChannelRange given each field
14537 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
14540 * Creates a copy of the QueryChannelRange
14542 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
14545 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
14547 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
14550 * The genesis hash of the blockchain being queried
14552 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
14555 * The genesis hash of the blockchain being queried
14557 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14560 * The height of the first block in the range of the reply
14562 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
14565 * The height of the first block in the range of the reply
14567 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
14570 * The number of blocks included in the range of the reply
14572 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
14575 * The number of blocks included in the range of the reply
14577 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
14580 * True when this is the final reply for a query
14582 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
14585 * True when this is the final reply for a query
14587 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
14590 * The short_channel_ids in the channel range
14592 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
14595 * Constructs a new ReplyChannelRange given each field
14597 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);
14600 * Creates a copy of the ReplyChannelRange
14602 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
14605 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
14607 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
14610 * The genesis hash of the blockchain being queried
14612 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
14615 * The genesis hash of the blockchain being queried
14617 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14620 * The short_channel_ids that are being queried
14622 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
14625 * Constructs a new QueryShortChannelIds given each field
14627 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
14630 * Creates a copy of the QueryShortChannelIds
14632 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
14635 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
14637 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
14640 * The genesis hash of the blockchain that was queried
14642 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
14645 * The genesis hash of the blockchain that was queried
14647 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14650 * Indicates if the query recipient maintains up-to-date channel
14651 * information for the chain_hash
14653 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
14656 * Indicates if the query recipient maintains up-to-date channel
14657 * information for the chain_hash
14659 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
14662 * Constructs a new ReplyShortChannelIdsEnd given each field
14664 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
14667 * Creates a copy of the ReplyShortChannelIdsEnd
14669 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
14672 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
14674 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
14677 * The genesis hash of the blockchain for channel and node information
14679 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
14682 * The genesis hash of the blockchain for channel and node information
14684 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14687 * The starting unix timestamp
14689 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
14692 * The starting unix timestamp
14694 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
14697 * The range of information in seconds
14699 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
14702 * The range of information in seconds
14704 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
14707 * Constructs a new GossipTimestampFilter given each field
14709 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
14712 * Creates a copy of the GossipTimestampFilter
14714 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
14717 * Frees any resources used by the ErrorAction
14719 void ErrorAction_free(struct LDKErrorAction this_ptr);
14722 * Creates a copy of the ErrorAction
14724 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
14727 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
14729 void LightningError_free(struct LDKLightningError this_obj);
14732 * A human-readable message describing the error
14734 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
14737 * A human-readable message describing the error
14739 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
14742 * The action which should be taken against the offending peer.
14744 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
14747 * The action which should be taken against the offending peer.
14749 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
14752 * Constructs a new LightningError given each field
14754 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKCVec_u8Z err_arg, struct LDKErrorAction action_arg);
14757 * Creates a copy of the LightningError
14759 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
14762 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
14764 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
14767 * update_add_htlc messages which should be sent
14769 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
14772 * update_fulfill_htlc messages which should be sent
14774 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
14777 * update_fail_htlc messages which should be sent
14779 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
14782 * update_fail_malformed_htlc messages which should be sent
14784 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
14787 * An update_fee message which should be sent
14789 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
14792 * An update_fee message which should be sent
14794 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
14797 * Finally, the commitment_signed message which should be sent
14799 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
14802 * Finally, the commitment_signed message which should be sent
14804 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
14807 * Constructs a new CommitmentUpdate given each field
14809 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);
14812 * Creates a copy of the CommitmentUpdate
14814 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
14817 * Frees any resources used by the HTLCFailChannelUpdate
14819 void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr);
14822 * Creates a copy of the HTLCFailChannelUpdate
14824 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig);
14827 * Calls the free function if one is set
14829 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
14832 * Calls the free function if one is set
14834 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
14837 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
14839 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
14842 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
14844 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
14847 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
14849 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
14852 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
14854 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
14857 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
14859 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
14862 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
14864 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
14867 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
14869 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
14872 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
14874 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
14877 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
14879 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
14882 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
14884 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
14887 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
14889 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
14892 * Read a FundingCreated from a byte array, created by FundingCreated_write
14894 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
14897 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
14899 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
14902 * Read a FundingSigned from a byte array, created by FundingSigned_write
14904 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
14907 * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
14909 struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
14912 * Read a FundingLocked from a byte array, created by FundingLocked_write
14914 struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
14917 * Serialize the Init object into a byte array which can be read by Init_read
14919 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
14922 * Read a Init from a byte array, created by Init_write
14924 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
14927 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
14929 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
14932 * Read a OpenChannel from a byte array, created by OpenChannel_write
14934 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
14937 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
14939 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
14942 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
14944 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
14947 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
14949 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
14952 * Read a Shutdown from a byte array, created by Shutdown_write
14954 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
14957 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
14959 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
14962 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
14964 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
14967 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
14969 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
14972 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
14974 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
14977 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
14979 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
14982 * Read a UpdateFee from a byte array, created by UpdateFee_write
14984 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
14987 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
14989 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
14992 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
14994 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
14997 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
14999 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
15002 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
15004 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
15007 * Serialize the Ping object into a byte array which can be read by Ping_read
15009 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
15012 * Read a Ping from a byte array, created by Ping_write
15014 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
15017 * Serialize the Pong object into a byte array which can be read by Pong_read
15019 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
15022 * Read a Pong from a byte array, created by Pong_write
15024 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
15027 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
15029 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
15032 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
15034 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
15037 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
15039 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
15042 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
15044 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
15047 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
15049 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
15052 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
15054 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
15057 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
15059 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
15062 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
15064 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
15067 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
15069 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
15072 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
15074 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
15077 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
15079 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
15082 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
15084 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
15087 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
15089 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
15092 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
15094 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
15097 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
15099 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
15102 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
15104 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
15107 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
15109 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
15112 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
15114 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
15117 *\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
15119 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
15122 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
15124 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
15127 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
15129 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
15132 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
15134 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
15137 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
15139 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
15142 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
15144 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
15147 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
15149 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
15152 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
15154 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
15157 * Constructs a new IgnoringMessageHandler given each field
15159 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
15162 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
15163 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
15165 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
15168 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
15169 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
15171 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
15174 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
15176 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
15179 * Constructs a new ErroringMessageHandler
15181 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
15184 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
15185 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
15187 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
15190 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
15191 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
15193 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
15196 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
15198 void MessageHandler_free(struct LDKMessageHandler this_obj);
15201 * A message handler which handles messages specific to channels. Usually this is just a
15202 * ChannelManager object or a ErroringMessageHandler.
15204 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
15207 * A message handler which handles messages specific to channels. Usually this is just a
15208 * ChannelManager object or a ErroringMessageHandler.
15210 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
15213 * A message handler which handles messages updating our knowledge of the network channel
15214 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
15216 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
15219 * A message handler which handles messages updating our knowledge of the network channel
15220 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
15222 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
15225 * Constructs a new MessageHandler given each field
15227 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
15230 * Creates a copy of a SocketDescriptor
15232 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
15235 * Calls the free function if one is set
15237 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
15240 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
15242 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
15245 * Used to indicate that we probably can't make any future connections to this peer, implying
15246 * we should go ahead and force-close any channels we have with it.
15248 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
15251 * Used to indicate that we probably can't make any future connections to this peer, implying
15252 * we should go ahead and force-close any channels we have with it.
15254 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
15257 * Constructs a new PeerHandleError given each field
15259 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
15262 * Creates a copy of the PeerHandleError
15264 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
15267 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
15269 void PeerManager_free(struct LDKPeerManager this_obj);
15272 * Constructs a new PeerManager with the given message handlers and node_id secret key
15273 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
15274 * cryptographically secure random bytes.
15276 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);
15279 * Get the list of node ids for peers which have completed the initial handshake.
15281 * For outbound connections, this will be the same as the their_node_id parameter passed in to
15282 * new_outbound_connection, however entries will only appear once the initial handshake has
15283 * completed and we are sure the remote peer has the private key for the given node_id.
15285 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
15288 * Indicates a new outbound connection has been established to a node with the given node_id.
15289 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
15290 * descriptor but must disconnect the connection immediately.
15292 * Returns a small number of bytes to send to the remote node (currently always 50).
15294 * Panics if descriptor is duplicative with some other descriptor which has not yet had a
15295 * socket_disconnected().
15297 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);
15300 * Indicates a new inbound connection has been established.
15302 * May refuse the connection by returning an Err, but will never write bytes to the remote end
15303 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
15304 * call socket_disconnected for the new descriptor but must disconnect the connection
15307 * Panics if descriptor is duplicative with some other descriptor which has not yet had
15308 * socket_disconnected called.
15310 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor);
15313 * Indicates that there is room to write data to the given socket descriptor.
15315 * May return an Err to indicate that the connection should be closed.
15317 * Will most likely call send_data on the descriptor passed in (or the descriptor handed into
15318 * new_*\\_connection) before returning. Thus, be very careful with reentrancy issues! The
15319 * invariants around calling write_buffer_space_avail in case a write did not fully complete
15320 * must still hold - be ready to call write_buffer_space_avail again if a write call generated
15321 * here isn't sufficient! Panics if the descriptor was not previously registered in a
15322 * new_\\*_connection event.
15324 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
15327 * Indicates that data was read from the given socket descriptor.
15329 * May return an Err to indicate that the connection should be closed.
15331 * Will *not* call back into send_data on any descriptors to avoid reentrancy complexity.
15332 * Thus, however, you almost certainly want to call process_events() after any read_event to
15333 * generate send_data calls to handle responses.
15335 * If Ok(true) is returned, further read_events should not be triggered until a send_data call
15336 * on this file descriptor has resume_read set (preventing DoS issues in the send buffer).
15338 * Panics if the descriptor was not previously registered in a new_*_connection event.
15340 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);
15343 * Checks for any events generated by our handlers and processes them. Includes sending most
15344 * response messages as well as messages generated by calls to handler functions directly (eg
15345 * functions like ChannelManager::process_pending_htlc_forward or send_payment).
15347 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
15350 * Indicates that the given socket descriptor's connection is now closed.
15352 * This must only be called if the socket has been disconnected by the peer or your own
15353 * decision to disconnect it and must NOT be called in any case where other parts of this
15354 * library (eg PeerHandleError, explicit disconnect_socket calls) instruct you to disconnect
15357 * Panics if the descriptor was not previously registered in a successful new_*_connection event.
15359 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
15362 * Disconnect a peer given its node id.
15364 * Set no_connection_possible to true to prevent any further connection with this peer,
15365 * force-closing any channels we have with it.
15367 * If a peer is connected, this will call `disconnect_socket` on the descriptor for the peer,
15368 * so be careful about reentrancy issues.
15370 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
15373 * This function should be called roughly once every 30 seconds.
15374 * It will send pings to each peer and disconnect those which did not respond to the last round of pings.
15375 * Will most likely call send_data on all of the registered descriptors, thus, be very careful with reentrancy issues!
15377 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
15380 * Build the commitment secret from the seed and the commitment number
15382 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
15385 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
15386 * from the base secret and the per_commitment_point.
15388 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
15389 * generated (ie our own).
15391 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
15394 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
15395 * from the base point and the per_commitment_key. This is the public equivalent of
15396 * derive_private_key - using only public keys to derive a public key instead of private keys.
15398 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
15399 * generated (ie our own).
15401 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
15404 * Derives a per-commitment-transaction revocation key from its constituent parts.
15406 * Only the cheating participant owns a valid witness to propagate a revoked
15407 * commitment transaction, thus per_commitment_secret always come from cheater
15408 * and revocation_base_secret always come from punisher, which is the broadcaster
15409 * of the transaction spending with this key knowledge.
15411 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
15412 * generated (ie our own).
15414 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
15417 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
15418 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
15419 * public key instead of private keys.
15421 * Only the cheating participant owns a valid witness to propagate a revoked
15422 * commitment transaction, thus per_commitment_point always come from cheater
15423 * and revocation_base_point always come from punisher, which is the broadcaster
15424 * of the transaction spending with this key knowledge.
15426 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
15427 * generated (ie our own).
15429 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
15432 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
15434 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
15437 * The broadcaster's per-commitment public key which was used to derive the other keys.
15439 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
15442 * The broadcaster's per-commitment public key which was used to derive the other keys.
15444 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15447 * The revocation key which is used to allow the broadcaster of the commitment
15448 * transaction to provide their counterparty the ability to punish them if they broadcast
15451 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
15454 * The revocation key which is used to allow the broadcaster of the commitment
15455 * transaction to provide their counterparty the ability to punish them if they broadcast
15458 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15461 * Broadcaster's HTLC Key
15463 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
15466 * Broadcaster's HTLC Key
15468 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15471 * Countersignatory's HTLC Key
15473 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
15476 * Countersignatory's HTLC Key
15478 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15481 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
15483 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
15486 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
15488 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15491 * Constructs a new TxCreationKeys given each field
15493 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);
15496 * Creates a copy of the TxCreationKeys
15498 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
15501 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
15503 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
15506 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
15508 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
15511 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
15513 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
15516 * The public key which is used to sign all commitment transactions, as it appears in the
15517 * on-chain channel lock-in 2-of-2 multisig output.
15519 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
15522 * The public key which is used to sign all commitment transactions, as it appears in the
15523 * on-chain channel lock-in 2-of-2 multisig output.
15525 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15528 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
15529 * revocation keys. This is combined with the per-commitment-secret generated by the
15530 * counterparty to create a secret which the counterparty can reveal to revoke previous
15533 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
15536 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
15537 * revocation keys. This is combined with the per-commitment-secret generated by the
15538 * counterparty to create a secret which the counterparty can reveal to revoke previous
15541 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15544 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
15545 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
15546 * static across every commitment transaction.
15548 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
15551 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
15552 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
15553 * static across every commitment transaction.
15555 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15558 * The base point which is used (with derive_public_key) to derive a per-commitment payment
15559 * public key which receives non-HTLC-encumbered funds which are only available for spending
15560 * after some delay (or can be claimed via the revocation path).
15562 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
15565 * The base point which is used (with derive_public_key) to derive a per-commitment payment
15566 * public key which receives non-HTLC-encumbered funds which are only available for spending
15567 * after some delay (or can be claimed via the revocation path).
15569 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15572 * The base point which is used (with derive_public_key) to derive a per-commitment public key
15573 * which is used to encumber HTLC-in-flight outputs.
15575 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
15578 * The base point which is used (with derive_public_key) to derive a per-commitment public key
15579 * which is used to encumber HTLC-in-flight outputs.
15581 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15584 * Constructs a new ChannelPublicKeys given each field
15586 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);
15589 * Creates a copy of the ChannelPublicKeys
15591 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
15594 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
15596 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
15599 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
15601 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
15604 * Create per-state keys from channel base points and the per-commitment point.
15605 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
15607 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);
15610 * Generate per-state keys from channel static keys.
15611 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
15613 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);
15616 * A script either spendable by the revocation
15617 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
15618 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
15620 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
15623 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
15625 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
15628 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
15629 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
15630 * need to compare this value to whether the commitment transaction in question is that of
15631 * the counterparty or our own.
15633 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
15636 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
15637 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
15638 * need to compare this value to whether the commitment transaction in question is that of
15639 * the counterparty or our own.
15641 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
15644 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
15645 * this divided by 1000.
15647 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
15650 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
15651 * this divided by 1000.
15653 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
15656 * The CLTV lock-time at which this HTLC expires.
15658 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
15661 * The CLTV lock-time at which this HTLC expires.
15663 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
15666 * The hash of the preimage which unlocks this HTLC.
15668 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
15671 * The hash of the preimage which unlocks this HTLC.
15673 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15676 * The position within the commitment transactions' outputs. This may be None if the value is
15677 * below the dust limit (in which case no output appears in the commitment transaction and the
15678 * value is spent to additional transaction fees).
15680 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
15683 * The position within the commitment transactions' outputs. This may be None if the value is
15684 * below the dust limit (in which case no output appears in the commitment transaction and the
15685 * value is spent to additional transaction fees).
15687 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
15690 * Constructs a new HTLCOutputInCommitment given each field
15692 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);
15695 * Creates a copy of the HTLCOutputInCommitment
15697 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
15700 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
15702 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
15705 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
15707 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
15710 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
15711 * does not need to have its previous_output_index filled.
15713 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys);
15716 * Gets the redeemscript for a funding output from the two funding public keys.
15717 * Note that the order of funding public keys does not matter.
15719 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
15722 * panics if htlc.transaction_output_index.is_none()!
15724 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);
15727 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
15729 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
15732 * Holder public keys
15734 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
15737 * Holder public keys
15739 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
15742 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
15744 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
15747 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
15749 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
15752 * Whether the holder is the initiator of this channel.
15753 * This is an input to the commitment number obscure factor computation.
15755 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
15758 * Whether the holder is the initiator of this channel.
15759 * This is an input to the commitment number obscure factor computation.
15761 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
15764 * The late-bound counterparty channel transaction parameters.
15765 * These parameters are populated at the point in the protocol where the counterparty provides them.
15767 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
15770 * The late-bound counterparty channel transaction parameters.
15771 * These parameters are populated at the point in the protocol where the counterparty provides them.
15773 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
15776 * The late-bound funding outpoint
15778 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
15781 * The late-bound funding outpoint
15783 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
15786 * Constructs a new ChannelTransactionParameters given each field
15788 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);
15791 * Creates a copy of the ChannelTransactionParameters
15793 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
15796 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
15798 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
15801 * Counter-party public keys
15803 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
15806 * Counter-party public keys
15808 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
15811 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
15813 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
15816 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
15818 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
15821 * Constructs a new CounterpartyChannelTransactionParameters given each field
15823 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
15826 * Creates a copy of the CounterpartyChannelTransactionParameters
15828 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
15831 * Whether the late bound parameters are populated.
15833 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
15836 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
15837 * given that the holder is the broadcaster.
15839 * self.is_populated() must be true before calling this function.
15841 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
15844 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
15845 * given that the counterparty is the broadcaster.
15847 * self.is_populated() must be true before calling this function.
15849 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
15852 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
15854 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
15857 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
15859 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
15862 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
15864 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
15867 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
15869 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
15872 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
15874 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
15877 * Get the channel pubkeys for the broadcaster
15879 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
15882 * Get the channel pubkeys for the countersignatory
15884 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
15887 * Get the contest delay applicable to the transactions.
15888 * Note that the contest delay was selected by the countersignatory.
15890 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
15893 * Whether the channel is outbound from the broadcaster.
15895 * The boolean representing the side that initiated the channel is
15896 * an input to the commitment number obscure factor computation.
15898 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
15901 * The funding outpoint
15903 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
15906 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
15908 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
15911 * Our counterparty's signature for the transaction
15913 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
15916 * Our counterparty's signature for the transaction
15918 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
15921 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
15923 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
15926 * Creates a copy of the HolderCommitmentTransaction
15928 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
15931 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
15933 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
15936 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
15938 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
15941 * Create a new holder transaction with the given counterparty signatures.
15942 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
15944 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);
15947 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
15949 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
15952 * The commitment transaction
15954 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
15957 * The commitment transaction
15959 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
15962 * The txid for the commitment transaction.
15964 * This is provided as a performance optimization, instead of calling transaction.txid()
15967 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
15970 * The txid for the commitment transaction.
15972 * This is provided as a performance optimization, instead of calling transaction.txid()
15975 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15978 * Constructs a new BuiltCommitmentTransaction given each field
15980 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
15983 * Creates a copy of the BuiltCommitmentTransaction
15985 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
15988 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
15990 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
15993 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
15995 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
15998 * Get the SIGHASH_ALL sighash value of the transaction.
16000 * This can be used to verify a signature.
16002 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);
16005 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
16006 * because we are about to broadcast a holder transaction.
16008 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);
16011 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
16013 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
16016 * Creates a copy of the CommitmentTransaction
16018 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
16021 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
16023 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
16026 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
16028 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
16031 * The backwards-counting commitment number
16033 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16036 * The value to be sent to the broadcaster
16038 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16041 * The value to be sent to the counterparty
16043 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16046 * The feerate paid per 1000-weight-unit in this commitment transaction.
16048 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16051 * Trust our pre-built transaction and derived transaction creation public keys.
16053 * Applies a wrapper which allows access to these fields.
16055 * This should only be used if you fully trust the builder of this object. It should not
16056 *\tbe used by an external signer - instead use the verify function.
16058 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
16061 * Verify our pre-built transaction and derived transaction creation public keys.
16063 * Applies a wrapper which allows access to these fields.
16065 * An external validating signer must call this method before signing
16066 * or using the built transaction.
16068 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);
16071 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
16073 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
16076 * The transaction ID of the built Bitcoin transaction
16078 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
16081 * The pre-built Bitcoin commitment transaction
16083 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
16086 * The pre-calculated transaction creation public keys.
16088 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
16091 * Get a signature for each HTLC which was included in the commitment transaction (ie for
16092 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
16094 * The returned Vec has one entry for each HTLC, and in the same order.
16096 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);
16099 * Get the transaction number obscure factor
16101 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
16104 * Creates a copy of the InitFeatures
16106 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
16109 * Creates a copy of the NodeFeatures
16111 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
16114 * Creates a copy of the ChannelFeatures
16116 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
16119 * Creates a copy of the InvoiceFeatures
16121 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
16124 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
16126 void InitFeatures_free(struct LDKInitFeatures this_obj);
16129 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
16131 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
16134 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
16136 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
16139 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
16141 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
16144 * Create a blank Features with no features set
16146 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
16149 * Creates a Features with the bits set which are known by the implementation
16151 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
16154 * Create a blank Features with no features set
16156 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
16159 * Creates a Features with the bits set which are known by the implementation
16161 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
16164 * Create a blank Features with no features set
16166 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
16169 * Creates a Features with the bits set which are known by the implementation
16171 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
16174 * Create a blank Features with no features set
16176 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
16179 * Creates a Features with the bits set which are known by the implementation
16181 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
16184 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
16186 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
16189 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
16191 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
16194 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
16196 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
16199 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
16201 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
16204 * Read a InitFeatures from a byte array, created by InitFeatures_write
16206 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
16209 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
16211 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
16214 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
16216 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
16219 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
16221 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
16224 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
16226 void RouteHop_free(struct LDKRouteHop this_obj);
16229 * The node_id of the node at this hop.
16231 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16234 * The node_id of the node at this hop.
16236 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16239 * The node_announcement features of the node at this hop. For the last hop, these may be
16240 * amended to match the features present in the invoice this node generated.
16242 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16245 * The node_announcement features of the node at this hop. For the last hop, these may be
16246 * amended to match the features present in the invoice this node generated.
16248 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
16251 * The channel that should be used from the previous hop to reach this node.
16253 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16256 * The channel that should be used from the previous hop to reach this node.
16258 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
16261 * The channel_announcement features of the channel that should be used from the previous hop
16262 * to reach this node.
16264 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16267 * The channel_announcement features of the channel that should be used from the previous hop
16268 * to reach this node.
16270 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
16273 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
16274 * For the last hop, this should be the full value of the payment (might be more than
16275 * requested if we had to match htlc_minimum_msat).
16277 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16280 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
16281 * For the last hop, this should be the full value of the payment (might be more than
16282 * requested if we had to match htlc_minimum_msat).
16284 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
16287 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
16288 * expected at the destination, in excess of the current block height.
16290 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
16293 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
16294 * expected at the destination, in excess of the current block height.
16296 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
16299 * Constructs a new RouteHop given each field
16301 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);
16304 * Creates a copy of the RouteHop
16306 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
16309 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
16311 void Route_free(struct LDKRoute this_obj);
16314 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
16315 * last RouteHop in each path must be the same.
16316 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
16317 * destination. Thus, this must always be at least length one. While the maximum length of any
16318 * given path is variable, keeping the length of any path to less than 20 should currently
16319 * ensure it is viable.
16321 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
16324 * Constructs a new Route given each field
16326 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
16329 * Creates a copy of the Route
16331 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
16334 * Serialize the Route object into a byte array which can be read by Route_read
16336 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
16339 * Read a Route from a byte array, created by Route_write
16341 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
16344 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
16346 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
16349 * The node_id of the non-target end of the route
16351 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16354 * The node_id of the non-target end of the route
16356 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16359 * The short_channel_id of this channel
16361 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16364 * The short_channel_id of this channel
16366 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
16369 * The fees which must be paid to use this channel
16371 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16374 * The fees which must be paid to use this channel
16376 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
16379 * The difference in CLTV values between this node and the next node.
16381 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16384 * The difference in CLTV values between this node and the next node.
16386 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
16389 * The minimum value, in msat, which must be relayed to the next hop.
16391 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16394 * The minimum value, in msat, which must be relayed to the next hop.
16396 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
16399 * The maximum value in msat available for routing with a single HTLC.
16401 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
16404 * The maximum value in msat available for routing with a single HTLC.
16406 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
16409 * Constructs a new RouteHintHop given each field
16411 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);
16414 * Creates a copy of the RouteHintHop
16416 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
16419 * Gets a route from us (payer) to the given target node (payee).
16421 * If the payee provided features in their invoice, they should be provided via payee_features.
16422 * Without this, MPP will only be used if the payee's features are available in the network graph.
16424 * Extra routing hops between known nodes and the target will be used if they are included in
16427 * If some channels aren't announced, it may be useful to fill in a first_hops with the
16428 * results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
16429 * view of our local channels (from net_graph_msg_handler) will be ignored, and only those
16430 * in first_hops will be used.
16432 * Panics if first_hops contains channels without short_channel_ids
16433 * (ChannelManager::list_usable_channels will never include such channels).
16435 * The fees on channels from us to next-hops are ignored (as they are assumed to all be
16436 * equal), however the enabled/disabled bit on such channels as well as the
16437 * htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
16439 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);
16442 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
16444 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
16447 * Creates a copy of the NetworkGraph
16449 struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
16452 * Frees any resources used by the LockedNetworkGraph, if is_owned is set and inner is non-NULL.
16454 void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj);
16457 * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
16459 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
16462 * Creates a new tracker of the actual state of the network of channels and nodes,
16463 * assuming a fresh network graph.
16464 * Chain monitor is used to make sure announced channels exist on-chain,
16465 * channel data is correct, and that the announcement is signed with
16466 * channel owners' keys.
16468 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger);
16471 * Creates a new tracker of the actual state of the network of channels and nodes,
16472 * assuming an existing Network Graph.
16474 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph);
16477 * Adds a provider used to check new announcements. Does not affect
16478 * existing announcements unless they are updated.
16479 * Add, update or remove the provider would replace the current one.
16481 void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKAccess *chain_access);
16484 * Take a read lock on the network_graph and return it in the C-bindings
16485 * newtype helper. This is likely only useful when called via the C
16486 * bindings as you can call `self.network_graph.read().unwrap()` in Rust
16489 MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
16492 * Get a reference to the NetworkGraph which this read-lock contains.
16494 MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg);
16497 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
16498 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
16500 struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
16503 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
16504 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
16506 struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
16509 * Frees any resources used by the DirectionalChannelInfo, if is_owned is set and inner is non-NULL.
16511 void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_obj);
16514 * When the last update to the channel direction was issued.
16515 * Value is opaque, as set in the announcement.
16517 uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
16520 * When the last update to the channel direction was issued.
16521 * Value is opaque, as set in the announcement.
16523 void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val);
16526 * Whether the channel can be currently used for payments (in this one direction).
16528 bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
16531 * Whether the channel can be currently used for payments (in this one direction).
16533 void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, bool val);
16536 * The difference in CLTV values that you must have when routing through this channel.
16538 uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
16541 * The difference in CLTV values that you must have when routing through this channel.
16543 void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint16_t val);
16546 * The minimum value, which must be relayed to the next hop via the channel
16548 uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
16551 * The minimum value, which must be relayed to the next hop via the channel
16553 void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val);
16556 * The maximum value which may be relayed to the next hop via the channel.
16558 struct LDKCOption_u64Z DirectionalChannelInfo_get_htlc_maximum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
16561 * The maximum value which may be relayed to the next hop via the channel.
16563 void DirectionalChannelInfo_set_htlc_maximum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
16566 * Fees charged when the channel is used for routing
16568 struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
16571 * Fees charged when the channel is used for routing
16573 void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
16576 * Most recent update for the channel received from the network
16577 * Mostly redundant with the data we store in fields explicitly.
16578 * Everything else is useful only for sending out for initial routing sync.
16579 * Not stored if contains excess data to prevent DoS.
16581 struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
16584 * Most recent update for the channel received from the network
16585 * Mostly redundant with the data we store in fields explicitly.
16586 * Everything else is useful only for sending out for initial routing sync.
16587 * Not stored if contains excess data to prevent DoS.
16589 void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
16592 * Constructs a new DirectionalChannelInfo given each field
16594 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);
16597 * Creates a copy of the DirectionalChannelInfo
16599 struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig);
16602 * Serialize the DirectionalChannelInfo object into a byte array which can be read by DirectionalChannelInfo_read
16604 struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj);
16607 * Read a DirectionalChannelInfo from a byte array, created by DirectionalChannelInfo_write
16609 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser);
16612 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
16614 void ChannelInfo_free(struct LDKChannelInfo this_obj);
16617 * Protocol features of a channel communicated during its announcement
16619 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
16622 * Protocol features of a channel communicated during its announcement
16624 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
16627 * Source node of the first direction of a channel
16629 struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
16632 * Source node of the first direction of a channel
16634 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16637 * Details about the first direction of a channel
16639 struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
16642 * Details about the first direction of a channel
16644 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
16647 * Source node of the second direction of a channel
16649 struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
16652 * Source node of the second direction of a channel
16654 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
16657 * Details about the second direction of a channel
16659 struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
16662 * Details about the second direction of a channel
16664 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
16667 * The channel capacity as seen on-chain, if chain lookup is available.
16669 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
16672 * The channel capacity as seen on-chain, if chain lookup is available.
16674 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
16677 * An initial announcement of the channel
16678 * Mostly redundant with the data we store in fields explicitly.
16679 * Everything else is useful only for sending out for initial routing sync.
16680 * Not stored if contains excess data to prevent DoS.
16682 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
16685 * An initial announcement of the channel
16686 * Mostly redundant with the data we store in fields explicitly.
16687 * Everything else is useful only for sending out for initial routing sync.
16688 * Not stored if contains excess data to prevent DoS.
16690 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
16693 * Constructs a new ChannelInfo given each field
16695 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);
16698 * Creates a copy of the ChannelInfo
16700 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
16703 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
16705 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
16708 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
16710 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
16713 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
16715 void RoutingFees_free(struct LDKRoutingFees this_obj);
16718 * Flat routing fee in satoshis
16720 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
16723 * Flat routing fee in satoshis
16725 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
16728 * Liquidity-based routing fee in millionths of a routed amount.
16729 * In other words, 10000 is 1%.
16731 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
16734 * Liquidity-based routing fee in millionths of a routed amount.
16735 * In other words, 10000 is 1%.
16737 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
16740 * Constructs a new RoutingFees given each field
16742 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
16745 * Creates a copy of the RoutingFees
16747 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
16750 * Read a RoutingFees from a byte array, created by RoutingFees_write
16752 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
16755 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
16757 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
16760 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
16762 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
16765 * Protocol features the node announced support for
16767 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
16770 * Protocol features the node announced support for
16772 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
16775 * When the last known update to the node state was issued.
16776 * Value is opaque, as set in the announcement.
16778 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
16781 * When the last known update to the node state was issued.
16782 * Value is opaque, as set in the announcement.
16784 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
16787 * Color assigned to the node
16789 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
16792 * Color assigned to the node
16794 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
16797 * Moniker assigned to the node.
16798 * May be invalid or malicious (eg control chars),
16799 * should not be exposed to the user.
16801 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
16804 * Moniker assigned to the node.
16805 * May be invalid or malicious (eg control chars),
16806 * should not be exposed to the user.
16808 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
16811 * Internet-level addresses via which one can connect to the node
16813 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
16816 * An initial announcement of the node
16817 * Mostly redundant with the data we store in fields explicitly.
16818 * Everything else is useful only for sending out for initial routing sync.
16819 * Not stored if contains excess data to prevent DoS.
16821 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
16824 * An initial announcement of the node
16825 * Mostly redundant with the data we store in fields explicitly.
16826 * Everything else is useful only for sending out for initial routing sync.
16827 * Not stored if contains excess data to prevent DoS.
16829 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
16832 * Constructs a new NodeAnnouncementInfo given each field
16834 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);
16837 * Creates a copy of the NodeAnnouncementInfo
16839 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
16842 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
16844 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
16847 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
16849 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
16852 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
16854 void NodeInfo_free(struct LDKNodeInfo this_obj);
16857 * All valid channels a node has announced
16859 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
16862 * Lowest fees enabling routing via any of the enabled, known channels to a node.
16863 * The two fields (flat and proportional fee) are independent,
16864 * meaning they don't have to refer to the same channel.
16866 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
16869 * Lowest fees enabling routing via any of the enabled, known channels to a node.
16870 * The two fields (flat and proportional fee) are independent,
16871 * meaning they don't have to refer to the same channel.
16873 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
16876 * More information about a node from node_announcement.
16877 * Optional because we store a Node entry after learning about it from
16878 * a channel announcement, but before receiving a node announcement.
16880 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
16883 * More information about a node from node_announcement.
16884 * Optional because we store a Node entry after learning about it from
16885 * a channel announcement, but before receiving a node announcement.
16887 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
16890 * Constructs a new NodeInfo given each field
16892 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
16895 * Creates a copy of the NodeInfo
16897 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
16900 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
16902 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
16905 * Read a NodeInfo from a byte array, created by NodeInfo_write
16907 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
16910 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
16912 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
16915 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
16917 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
16920 * Creates a new, empty, network graph.
16922 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
16925 * For an already known node (from channel announcements), update its stored properties from a
16926 * given node announcement.
16928 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
16929 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
16930 * routing messages from a source using a protocol other than the lightning P2P protocol.
16932 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
16935 * For an already known node (from channel announcements), update its stored properties from a
16936 * given node announcement without verifying the associated signatures. Because we aren't
16937 * given the associated signatures here we cannot relay the node announcement to any of our
16940 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
16943 * Store or update channel info from a channel announcement.
16945 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
16946 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
16947 * routing messages from a source using a protocol other than the lightning P2P protocol.
16949 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
16950 * the corresponding UTXO exists on chain and is correctly-formatted.
16952 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);
16955 * Store or update channel info from a channel announcement without verifying the associated
16956 * signatures. Because we aren't given the associated signatures here we cannot relay the
16957 * channel announcement to any of our peers.
16959 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
16960 * the corresponding UTXO exists on chain and is correctly-formatted.
16962 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);
16965 * Close a channel if a corresponding HTLC fail was sent.
16966 * If permanent, removes a channel from the local storage.
16967 * May cause the removal of nodes too, if this was their last channel.
16968 * If not permanent, makes channels unavailable for routing.
16970 void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
16973 * For an already known (from announcement) channel, update info about one of the directions
16976 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
16977 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
16978 * routing messages from a source using a protocol other than the lightning P2P protocol.
16980 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
16983 * For an already known (from announcement) channel, update info about one of the directions
16984 * of the channel without verifying the associated signatures. Because we aren't given the
16985 * associated signatures here we cannot relay the channel update to any of our peers.
16987 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
16990 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
16992 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
16995 * Initialize a new FilesystemPersister and set the path to the individual channels'
16998 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKCVec_u8Z path_to_channel_data);
17001 * Get the directory which was provided when this persister was initialized.
17003 MUST_USE_RES struct LDKCVec_u8Z FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
17006 * Writes the provided `ChannelManager` to the path provided at `FilesystemPersister`
17007 * initialization, within a file called \"manager\".
17009 MUST_USE_RES struct LDKCResult_NoneErrorZ FilesystemPersister_persist_manager(struct LDKCVec_u8Z data_dir, const struct LDKChannelManager *NONNULL_PTR manager);
17012 * Read `ChannelMonitor`s from disk.
17014 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
17017 * Constructs a new Persist which calls the relevant methods on this_arg.
17018 * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
17020 struct LDKPersist FilesystemPersister_as_Persist(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
17023 * **Call this function on startup to ensure that all assumptions about the platform are valid.**
17025 * Unfortunately we have to make assumptions about the upper bounds of the `SystemTime` type on
17026 * your platform which we can't fully verify at compile time and which isn't part of it's contract.
17027 * To our best knowledge our assumptions hold for all platforms officially supported by rust, but
17028 * since this check is fast we recommend to do it anyway.
17030 * If this function fails this is considered a bug. Please open an issue describing your
17031 * platform and stating your current system time.
17034 * If the check fails this function panics. By calling this function on startup you ensure that
17035 * this wont happen at an arbitrary later point in time.
17037 void check_platform(void);
17040 * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
17042 void Invoice_free(struct LDKInvoice this_obj);
17045 * Creates a copy of the Invoice
17047 struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
17050 * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
17052 void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
17055 * Creates a copy of the SignedRawInvoice
17057 struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
17060 * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
17062 void RawInvoice_free(struct LDKRawInvoice this_obj);
17067 struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
17072 void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
17075 * Creates a copy of the RawInvoice
17077 struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
17080 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
17082 void RawDataPart_free(struct LDKRawDataPart this_obj);
17085 * generation time of the invoice
17087 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
17090 * generation time of the invoice
17092 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
17095 * tagged fields of the payment request
17097 void RawDataPart_set_tagged_fields(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKCVec_RawTaggedFieldZ val);
17100 * Constructs a new RawDataPart given each field
17102 MUST_USE_RES struct LDKRawDataPart RawDataPart_new(struct LDKPositiveTimestamp timestamp_arg, struct LDKCVec_RawTaggedFieldZ tagged_fields_arg);
17105 * Creates a copy of the RawDataPart
17107 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
17110 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
17112 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
17115 * Creates a copy of the PositiveTimestamp
17117 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
17120 * Creates a copy of the SiPrefix
17122 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
17125 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
17126 * This is effectively 10^12 * the prefix multiplier
17128 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
17131 * Creates a copy of the Currency
17133 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
17136 * Frees any resources used by the RawTaggedField
17138 void RawTaggedField_free(struct LDKRawTaggedField this_ptr);
17141 * Creates a copy of the RawTaggedField
17143 struct LDKRawTaggedField RawTaggedField_clone(const struct LDKRawTaggedField *NONNULL_PTR orig);
17146 * Frees any resources used by the TaggedField
17148 void TaggedField_free(struct LDKTaggedField this_ptr);
17151 * Creates a copy of the TaggedField
17153 struct LDKTaggedField TaggedField_clone(const struct LDKTaggedField *NONNULL_PTR orig);
17156 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
17158 void Sha256_free(struct LDKSha256 this_obj);
17161 * Creates a copy of the Sha256
17163 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
17166 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
17168 void Description_free(struct LDKDescription this_obj);
17171 * Creates a copy of the Description
17173 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
17176 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
17178 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
17181 * Creates a copy of the PayeePubKey
17183 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
17186 * Frees any resources used by the PaymentSecret, if is_owned is set and inner is non-NULL.
17188 void PaymentSecret_free(struct LDKPaymentSecret this_obj);
17191 * Creates a copy of the PaymentSecret
17193 struct LDKPaymentSecret PaymentSecret_clone(const struct LDKPaymentSecret *NONNULL_PTR orig);
17196 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
17198 void ExpiryTime_free(struct LDKExpiryTime this_obj);
17201 * Creates a copy of the ExpiryTime
17203 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
17206 * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
17208 void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
17211 * Creates a copy of the MinFinalCltvExpiry
17213 struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
17216 * Frees any resources used by the Fallback
17218 void Fallback_free(struct LDKFallback this_ptr);
17221 * Creates a copy of the Fallback
17223 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
17226 * Frees any resources used by the InvoiceSignature, if is_owned is set and inner is non-NULL.
17228 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
17231 * Creates a copy of the InvoiceSignature
17233 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
17236 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
17238 void RouteHint_free(struct LDKRouteHint this_obj);
17241 * Creates a copy of the RouteHint
17243 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
17246 * Disassembles the `SignedRawInvoice` into its three parts:
17248 * 2. hash of the raw invoice
17251 MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg);
17254 * The `RawInvoice` which was signed.
17256 MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
17259 * The hash of the `RawInvoice` that was signed.
17261 MUST_USE_RES const uint8_t (*SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32];
17264 * InvoiceSignature for the invoice.
17266 MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
17269 * Recovers the public key used for signing the invoice from the recoverable signature.
17271 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
17274 * Checks if the signature is valid for the included payee public key or if none exists if it's
17275 * valid for the recovered signature (which should always be true?).
17277 MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
17280 * Calculate the hash of the encoded `RawInvoice`
17282 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17284 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17286 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17288 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17290 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17292 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17294 MUST_USE_RES struct LDKMinFinalCltvExpiry RawInvoice_min_final_cltv_expiry(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17296 MUST_USE_RES struct LDKPaymentSecret RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17298 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17300 MUST_USE_RES struct LDKCVec_RouteHintZ RawInvoice_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17302 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17304 MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg);
17307 * Create a new `PositiveTimestamp` from a unix timestamp in the Range
17308 * `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a
17309 * `CreationError::TimestampOutOfBounds`.
17311 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
17314 * Create a new `PositiveTimestamp` from a `SystemTime` with a corresponding unix timestamp in
17315 * the Range `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a
17316 * `CreationError::TimestampOutOfBounds`.
17318 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
17321 * Returns the UNIX timestamp representing the stored time
17323 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
17326 * Returns a reference to the internal `SystemTime` time representation
17328 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
17331 * Transform the `Invoice` into it's unchecked version
17333 MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg);
17336 * Check that the invoice is signed correctly and that key recovery works
17338 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
17341 * Constructs an `Invoice` from a `SignedInvoice` by checking all its invariants.
17343 * use lightning_invoice::*;
17345 * let invoice = \"lnbc1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdp\\
17346 * \tl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq8rkx3yf5tcsyz3d7\\
17347 * \t3gafnh3cax9rn449d9p5uxz9ezhhypd0elx87sjle52x86fux2ypatgddc6k63n7erqz25le42c4u4ec\\
17348 * \tky03ylcqca784w\";
17350 * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
17352 * assert!(Invoice::from_signed(signed).is_ok());
17355 MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice);
17358 * Returns the `Invoice`'s timestamp (should equal it's creation time)
17360 MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg);
17363 * Returns the hash to which we will receive the preimage on completion of the payment
17365 MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
17368 * Get the payee's public key if one was included in the invoice
17370 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
17373 * Get the payment secret if one was included in the invoice
17375 MUST_USE_RES struct LDKPaymentSecret Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg);
17378 * Get the invoice features if they were included in the invoice
17380 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
17383 * Recover the payee's public key (only to be used if none was included in the invoice)
17385 MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
17388 * Returns the invoice's expiry time if present
17390 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
17393 * Returns the invoice's `min_cltv_expiry` time if present
17395 MUST_USE_RES struct LDKCOption_u64Z Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
17398 * Returns a list of all routes included in the invoice
17400 MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
17403 * Returns the currency for which the invoice was issued
17405 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
17408 * Returns the amount if specified in the invoice as pico <currency>.
17410 MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_pico_btc(const struct LDKInvoice *NONNULL_PTR this_arg);
17413 * Numeric representation of the field's tag
17415 MUST_USE_RES struct LDKu5 TaggedField_tag(const struct LDKTaggedField *NONNULL_PTR this_arg);
17418 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
17419 * returns `CreationError::DescriptionTooLong` otherwise
17421 * Please note that single characters may use more than one byte due to UTF8 encoding.
17423 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKCVec_u8Z description);
17426 * Returns the underlying description `String`
17428 MUST_USE_RES struct LDKCVec_u8Z Description_into_inner(struct LDKDescription this_arg);
17431 * Construct an `ExpiryTime` from seconds. If there exists a `PositiveTimestamp` which would
17432 * overflow on adding the `EpiryTime` to it then this function will return a
17433 * `CreationError::ExpiryTimeOutOfBounds`.
17435 MUST_USE_RES struct LDKCResult_ExpiryTimeCreationErrorZ ExpiryTime_from_seconds(uint64_t seconds);
17438 * Construct an `ExpiryTime` from a `Duration`. If there exists a `PositiveTimestamp` which
17439 * would overflow on adding the `EpiryTime` to it then this function will return a
17440 * `CreationError::ExpiryTimeOutOfBounds`.
17442 MUST_USE_RES struct LDKCResult_ExpiryTimeCreationErrorZ ExpiryTime_from_duration(uint64_t duration);
17445 * Returns the expiry time in seconds
17447 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
17450 * Returns a reference to the underlying `Duration` (=expiry time)
17452 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
17455 * Create a new (partial) route from a list of hops
17457 MUST_USE_RES struct LDKCResult_RouteHintCreationErrorZ RouteHint_new(struct LDKCVec_RouteHintHopZ hops);
17460 * Returrn the underlying vector of hops
17462 MUST_USE_RES struct LDKCVec_RouteHintHopZ RouteHint_into_inner(struct LDKRouteHint this_arg);
17465 * Creates a copy of the CreationError
17467 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
17470 * Get the string representation of a CreationError object
17472 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
17475 * Creates a copy of the SemanticError
17477 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
17480 * Get the string representation of a SemanticError object
17482 struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
17484 #endif /* LDK_C_BINDINGS_H */