1 #ifndef LDK_C_BINDINGS_H
2 #define LDK_C_BINDINGS_H
4 /* Generated with cbindgen:0.16.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 * Represents an IO Error. Note that some information is lost in the conversion from Rust.
127 typedef enum LDKIOError {
129 LDKIOError_PermissionDenied,
130 LDKIOError_ConnectionRefused,
131 LDKIOError_ConnectionReset,
132 LDKIOError_ConnectionAborted,
133 LDKIOError_NotConnected,
134 LDKIOError_AddrInUse,
135 LDKIOError_AddrNotAvailable,
136 LDKIOError_BrokenPipe,
137 LDKIOError_AlreadyExists,
138 LDKIOError_WouldBlock,
139 LDKIOError_InvalidInput,
140 LDKIOError_InvalidData,
142 LDKIOError_WriteZero,
143 LDKIOError_Interrupted,
145 LDKIOError_UnexpectedEof,
147 * Must be last for serialization purposes
153 * An enum representing the available verbosity levels of the logger.
155 typedef enum LDKLevel {
157 *Designates logger being silent
161 * Designates very serious errors
165 * Designates hazardous situations
169 * Designates useful information
173 * Designates lower priority information
177 * Designates very low priority, often extremely verbose, information
181 * Must be last for serialization purposes
187 * An enum representing the possible Bitcoin or test networks which we can run on
189 typedef enum LDKNetwork {
191 * The main Bitcoin blockchain.
195 * The testnet3 blockchain.
199 * A local test blockchain.
203 * A blockchain on which blocks are signed instead of mined.
207 * Must be last for serialization purposes
213 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
215 typedef enum LDKSecp256k1Error {
217 * Signature failed verification
219 LDKSecp256k1Error_IncorrectSignature,
221 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
223 LDKSecp256k1Error_InvalidMessage,
227 LDKSecp256k1Error_InvalidPublicKey,
231 LDKSecp256k1Error_InvalidSignature,
235 LDKSecp256k1Error_InvalidSecretKey,
239 LDKSecp256k1Error_InvalidRecoveryId,
241 * Invalid tweak for add_assign or mul_assign
243 LDKSecp256k1Error_InvalidTweak,
245 * tweak_add_check failed on an xonly public key
247 LDKSecp256k1Error_TweakCheckFailed,
249 * Didn't pass enough memory to context creation with preallocated memory
251 LDKSecp256k1Error_NotEnoughMemory,
253 * Must be last for serialization purposes
255 LDKSecp256k1Error_Sentinel,
259 * A serialized transaction, in (pointer, length) form.
261 * This type optionally owns its own memory, and thus the semantics around access change based on
262 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
263 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
264 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
265 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
266 * you would be invalid.
268 * Note that, while it may change in the future, because transactions on the Rust side are stored
269 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
270 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
271 * `data_is_owned` either set or unset at your discretion.
273 typedef struct LDKTransaction {
275 * The serialized transaction data.
277 * This is non-const for your convenience, an object passed to Rust is never written to.
281 * The length of the serialized transaction
285 * Whether the data pointed to by `data` should be freed or not.
291 * A dynamically-allocated array of u8s of arbitrary size.
292 * This corresponds to std::vector in C++
294 typedef struct LDKCVec_u8Z {
296 * The elements in the array.
297 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
301 * The number of elements pointed to by `data`.
307 * A transaction output including a scriptPubKey and value.
308 * This type *does* own its own memory, so must be free'd appropriately.
310 typedef struct LDKTxOut {
312 * The script_pubkey in this output
314 struct LDKCVec_u8Z script_pubkey;
316 * The value, in satoshis, of this output
324 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
325 * with our counterparty.
327 typedef struct MUST_USE_STRUCT LDKChannelConfig {
329 * A pointer to the opaque Rust object.
330 * Nearly everywhere, inner must be non-null, however in places where
331 * the Rust equivalent takes an Option, it may be set to null to indicate None.
333 LDKnativeChannelConfig *inner;
335 * Indicates that this is the only struct which contains the same pointer.
336 * Rust functions which take ownership of an object provided via an argument require
337 * this to be true and invalidate the object pointed to by inner.
345 * An error in decoding a message or struct.
347 typedef struct MUST_USE_STRUCT LDKDecodeError {
349 * A pointer to the opaque Rust object.
350 * Nearly everywhere, inner must be non-null, however in places where
351 * the Rust equivalent takes an Option, it may be set to null to indicate None.
353 LDKnativeDecodeError *inner;
355 * Indicates that this is the only struct which contains the same pointer.
356 * Rust functions which take ownership of an object provided via an argument require
357 * this to be true and invalidate the object pointed to by inner.
363 * The contents of CResult_ChannelConfigDecodeErrorZ
365 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
367 * A pointer to the contents in the success state.
368 * Reading from this pointer when `result_ok` is not set is undefined.
370 struct LDKChannelConfig *result;
372 * A pointer to the contents in the error state.
373 * Reading from this pointer when `result_ok` is set is undefined.
375 struct LDKDecodeError *err;
376 } LDKCResult_ChannelConfigDecodeErrorZPtr;
379 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
380 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
381 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
383 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
385 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
386 * `err` or `result` depending on the state of `result_ok`.
388 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
390 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
393 } LDKCResult_ChannelConfigDecodeErrorZ;
398 * A reference to a transaction output.
400 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
401 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
403 typedef struct MUST_USE_STRUCT LDKOutPoint {
405 * A pointer to the opaque Rust object.
406 * Nearly everywhere, inner must be non-null, however in places where
407 * the Rust equivalent takes an Option, it may be set to null to indicate None.
409 LDKnativeOutPoint *inner;
411 * Indicates that this is the only struct which contains the same pointer.
412 * Rust functions which take ownership of an object provided via an argument require
413 * this to be true and invalidate the object pointed to by inner.
419 * The contents of CResult_OutPointDecodeErrorZ
421 typedef union LDKCResult_OutPointDecodeErrorZPtr {
423 * A pointer to the contents in the success state.
424 * Reading from this pointer when `result_ok` is not set is undefined.
426 struct LDKOutPoint *result;
428 * A pointer to the contents in the error state.
429 * Reading from this pointer when `result_ok` is set is undefined.
431 struct LDKDecodeError *err;
432 } LDKCResult_OutPointDecodeErrorZPtr;
435 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
436 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
437 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
439 typedef struct LDKCResult_OutPointDecodeErrorZ {
441 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
442 * `err` or `result` depending on the state of `result_ok`.
444 union LDKCResult_OutPointDecodeErrorZPtr contents;
446 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
449 } LDKCResult_OutPointDecodeErrorZ;
452 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
454 typedef struct LDKSecretKey {
456 * The bytes of the secret key
462 * The contents of CResult_SecretKeyErrorZ
464 typedef union LDKCResult_SecretKeyErrorZPtr {
466 * A pointer to the contents in the success state.
467 * Reading from this pointer when `result_ok` is not set is undefined.
469 struct LDKSecretKey *result;
471 * A pointer to the contents in the error state.
472 * Reading from this pointer when `result_ok` is set is undefined.
474 enum LDKSecp256k1Error *err;
475 } LDKCResult_SecretKeyErrorZPtr;
478 * A CResult_SecretKeyErrorZ represents the result of a fallible operation,
479 * containing a crate::c_types::SecretKey on success and a crate::c_types::Secp256k1Error on failure.
480 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
482 typedef struct LDKCResult_SecretKeyErrorZ {
484 * The contents of this CResult_SecretKeyErrorZ, accessible via either
485 * `err` or `result` depending on the state of `result_ok`.
487 union LDKCResult_SecretKeyErrorZPtr contents;
489 * Whether this CResult_SecretKeyErrorZ represents a success state.
492 } LDKCResult_SecretKeyErrorZ;
495 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
497 typedef struct LDKPublicKey {
499 * The bytes of the public key
501 uint8_t compressed_form[33];
505 * The contents of CResult_PublicKeyErrorZ
507 typedef union LDKCResult_PublicKeyErrorZPtr {
509 * A pointer to the contents in the success state.
510 * Reading from this pointer when `result_ok` is not set is undefined.
512 struct LDKPublicKey *result;
514 * A pointer to the contents in the error state.
515 * Reading from this pointer when `result_ok` is set is undefined.
517 enum LDKSecp256k1Error *err;
518 } LDKCResult_PublicKeyErrorZPtr;
521 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
522 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
523 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
525 typedef struct LDKCResult_PublicKeyErrorZ {
527 * The contents of this CResult_PublicKeyErrorZ, accessible via either
528 * `err` or `result` depending on the state of `result_ok`.
530 union LDKCResult_PublicKeyErrorZPtr contents;
532 * Whether this CResult_PublicKeyErrorZ represents a success state.
535 } LDKCResult_PublicKeyErrorZ;
540 * The set of public keys which are used in the creation of one commitment transaction.
541 * These are derived from the channel base keys and per-commitment data.
543 * A broadcaster key is provided from potential broadcaster of the computed transaction.
544 * A countersignatory key is coming from a protocol participant unable to broadcast the
547 * These keys are assumed to be good, either because the code derived them from
548 * channel basepoints via the new function, or they were obtained via
549 * CommitmentTransaction.trust().keys() because we trusted the source of the
550 * pre-calculated keys.
552 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
554 * A pointer to the opaque Rust object.
555 * Nearly everywhere, inner must be non-null, however in places where
556 * the Rust equivalent takes an Option, it may be set to null to indicate None.
558 LDKnativeTxCreationKeys *inner;
560 * Indicates that this is the only struct which contains the same pointer.
561 * Rust functions which take ownership of an object provided via an argument require
562 * this to be true and invalidate the object pointed to by inner.
568 * The contents of CResult_TxCreationKeysDecodeErrorZ
570 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
572 * A pointer to the contents in the success state.
573 * Reading from this pointer when `result_ok` is not set is undefined.
575 struct LDKTxCreationKeys *result;
577 * A pointer to the contents in the error state.
578 * Reading from this pointer when `result_ok` is set is undefined.
580 struct LDKDecodeError *err;
581 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
584 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
585 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
586 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
588 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
590 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
591 * `err` or `result` depending on the state of `result_ok`.
593 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
595 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
598 } LDKCResult_TxCreationKeysDecodeErrorZ;
603 * One counterparty's public keys which do not change over the life of a channel.
605 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
607 * A pointer to the opaque Rust object.
608 * Nearly everywhere, inner must be non-null, however in places where
609 * the Rust equivalent takes an Option, it may be set to null to indicate None.
611 LDKnativeChannelPublicKeys *inner;
613 * Indicates that this is the only struct which contains the same pointer.
614 * Rust functions which take ownership of an object provided via an argument require
615 * this to be true and invalidate the object pointed to by inner.
618 } LDKChannelPublicKeys;
621 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
623 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
625 * A pointer to the contents in the success state.
626 * Reading from this pointer when `result_ok` is not set is undefined.
628 struct LDKChannelPublicKeys *result;
630 * A pointer to the contents in the error state.
631 * Reading from this pointer when `result_ok` is set is undefined.
633 struct LDKDecodeError *err;
634 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
637 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
638 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
639 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
641 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
643 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
644 * `err` or `result` depending on the state of `result_ok`.
646 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
648 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
651 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
654 * The contents of CResult_TxCreationKeysErrorZ
656 typedef union LDKCResult_TxCreationKeysErrorZPtr {
658 * A pointer to the contents in the success state.
659 * Reading from this pointer when `result_ok` is not set is undefined.
661 struct LDKTxCreationKeys *result;
663 * A pointer to the contents in the error state.
664 * Reading from this pointer when `result_ok` is set is undefined.
666 enum LDKSecp256k1Error *err;
667 } LDKCResult_TxCreationKeysErrorZPtr;
670 * A CResult_TxCreationKeysErrorZ represents the result of a fallible operation,
671 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::c_types::Secp256k1Error on failure.
672 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
674 typedef struct LDKCResult_TxCreationKeysErrorZ {
676 * The contents of this CResult_TxCreationKeysErrorZ, accessible via either
677 * `err` or `result` depending on the state of `result_ok`.
679 union LDKCResult_TxCreationKeysErrorZPtr contents;
681 * Whether this CResult_TxCreationKeysErrorZ represents a success state.
684 } LDKCResult_TxCreationKeysErrorZ;
687 * An enum which can either contain a u32 or not
689 typedef enum LDKCOption_u32Z_Tag {
691 * When we're in this state, this COption_u32Z contains a u32
693 LDKCOption_u32Z_Some,
695 * When we're in this state, this COption_u32Z contains nothing
697 LDKCOption_u32Z_None,
699 * Must be last for serialization purposes
701 LDKCOption_u32Z_Sentinel,
702 } LDKCOption_u32Z_Tag;
704 typedef struct LDKCOption_u32Z {
705 LDKCOption_u32Z_Tag tag;
716 * Information about an HTLC as it appears in a commitment transaction
718 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
720 * A pointer to the opaque Rust object.
721 * Nearly everywhere, inner must be non-null, however in places where
722 * the Rust equivalent takes an Option, it may be set to null to indicate None.
724 LDKnativeHTLCOutputInCommitment *inner;
726 * Indicates that this is the only struct which contains the same pointer.
727 * Rust functions which take ownership of an object provided via an argument require
728 * this to be true and invalidate the object pointed to by inner.
731 } LDKHTLCOutputInCommitment;
734 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
736 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
738 * A pointer to the contents in the success state.
739 * Reading from this pointer when `result_ok` is not set is undefined.
741 struct LDKHTLCOutputInCommitment *result;
743 * A pointer to the contents in the error state.
744 * Reading from this pointer when `result_ok` is set is undefined.
746 struct LDKDecodeError *err;
747 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
750 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
751 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
752 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
754 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
756 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
757 * `err` or `result` depending on the state of `result_ok`.
759 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
761 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
764 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
769 * Late-bound per-channel counterparty data used to build transactions.
771 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
773 * A pointer to the opaque Rust object.
774 * Nearly everywhere, inner must be non-null, however in places where
775 * the Rust equivalent takes an Option, it may be set to null to indicate None.
777 LDKnativeCounterpartyChannelTransactionParameters *inner;
779 * Indicates that this is the only struct which contains the same pointer.
780 * Rust functions which take ownership of an object provided via an argument require
781 * this to be true and invalidate the object pointed to by inner.
784 } LDKCounterpartyChannelTransactionParameters;
787 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
789 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
791 * A pointer to the contents in the success state.
792 * Reading from this pointer when `result_ok` is not set is undefined.
794 struct LDKCounterpartyChannelTransactionParameters *result;
796 * A pointer to the contents in the error state.
797 * Reading from this pointer when `result_ok` is set is undefined.
799 struct LDKDecodeError *err;
800 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
803 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
804 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
805 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
807 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
809 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
810 * `err` or `result` depending on the state of `result_ok`.
812 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
814 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
817 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
822 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
823 * The fields are organized by holder/counterparty.
825 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
826 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
828 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
830 * A pointer to the opaque Rust object.
831 * Nearly everywhere, inner must be non-null, however in places where
832 * the Rust equivalent takes an Option, it may be set to null to indicate None.
834 LDKnativeChannelTransactionParameters *inner;
836 * Indicates that this is the only struct which contains the same pointer.
837 * Rust functions which take ownership of an object provided via an argument require
838 * this to be true and invalidate the object pointed to by inner.
841 } LDKChannelTransactionParameters;
844 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
846 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
848 * A pointer to the contents in the success state.
849 * Reading from this pointer when `result_ok` is not set is undefined.
851 struct LDKChannelTransactionParameters *result;
853 * A pointer to the contents in the error state.
854 * Reading from this pointer when `result_ok` is set is undefined.
856 struct LDKDecodeError *err;
857 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
860 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
861 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
862 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
864 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
866 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
867 * `err` or `result` depending on the state of `result_ok`.
869 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
871 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
874 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
877 * Represents a secp256k1 signature serialized as two 32-byte numbers
879 typedef struct LDKSignature {
881 * The bytes of the signature in "compact" form
883 uint8_t compact_form[64];
887 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
888 * This corresponds to std::vector in C++
890 typedef struct LDKCVec_SignatureZ {
892 * The elements in the array.
893 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
895 struct LDKSignature *data;
897 * The number of elements pointed to by `data`.
900 } LDKCVec_SignatureZ;
905 * Information needed to build and sign a holder's commitment transaction.
907 * The transaction is only signed once we are ready to broadcast.
909 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
911 * A pointer to the opaque Rust object.
912 * Nearly everywhere, inner must be non-null, however in places where
913 * the Rust equivalent takes an Option, it may be set to null to indicate None.
915 LDKnativeHolderCommitmentTransaction *inner;
917 * Indicates that this is the only struct which contains the same pointer.
918 * Rust functions which take ownership of an object provided via an argument require
919 * this to be true and invalidate the object pointed to by inner.
922 } LDKHolderCommitmentTransaction;
925 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
927 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
929 * A pointer to the contents in the success state.
930 * Reading from this pointer when `result_ok` is not set is undefined.
932 struct LDKHolderCommitmentTransaction *result;
934 * A pointer to the contents in the error state.
935 * Reading from this pointer when `result_ok` is set is undefined.
937 struct LDKDecodeError *err;
938 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
941 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
942 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
943 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
945 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
947 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
948 * `err` or `result` depending on the state of `result_ok`.
950 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
952 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
955 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
960 * A pre-built Bitcoin commitment transaction and its txid.
962 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
964 * A pointer to the opaque Rust object.
965 * Nearly everywhere, inner must be non-null, however in places where
966 * the Rust equivalent takes an Option, it may be set to null to indicate None.
968 LDKnativeBuiltCommitmentTransaction *inner;
970 * Indicates that this is the only struct which contains the same pointer.
971 * Rust functions which take ownership of an object provided via an argument require
972 * this to be true and invalidate the object pointed to by inner.
975 } LDKBuiltCommitmentTransaction;
978 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
980 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
982 * A pointer to the contents in the success state.
983 * Reading from this pointer when `result_ok` is not set is undefined.
985 struct LDKBuiltCommitmentTransaction *result;
987 * A pointer to the contents in the error state.
988 * Reading from this pointer when `result_ok` is set is undefined.
990 struct LDKDecodeError *err;
991 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
994 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
995 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
996 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
998 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
1000 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
1001 * `err` or `result` depending on the state of `result_ok`.
1003 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
1005 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
1008 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
1013 * This class tracks the per-transaction information needed to build a commitment transaction and to
1014 * actually build it and sign. It is used for holder transactions that we sign only when needed
1015 * and for transactions we sign for the counterparty.
1017 * This class can be used inside a signer implementation to generate a signature given the relevant
1020 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
1022 * A pointer to the opaque Rust object.
1023 * Nearly everywhere, inner must be non-null, however in places where
1024 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1026 LDKnativeCommitmentTransaction *inner;
1028 * Indicates that this is the only struct which contains the same pointer.
1029 * Rust functions which take ownership of an object provided via an argument require
1030 * this to be true and invalidate the object pointed to by inner.
1033 } LDKCommitmentTransaction;
1036 * The contents of CResult_CommitmentTransactionDecodeErrorZ
1038 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
1040 * A pointer to the contents in the success state.
1041 * Reading from this pointer when `result_ok` is not set is undefined.
1043 struct LDKCommitmentTransaction *result;
1045 * A pointer to the contents in the error state.
1046 * Reading from this pointer when `result_ok` is set is undefined.
1048 struct LDKDecodeError *err;
1049 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
1052 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1053 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1054 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1056 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
1058 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
1059 * `err` or `result` depending on the state of `result_ok`.
1061 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
1063 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
1066 } LDKCResult_CommitmentTransactionDecodeErrorZ;
1071 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
1072 * transaction and the transaction creation keys) are trusted.
1074 * See trust() and verify() functions on CommitmentTransaction.
1076 * This structure implements Deref.
1078 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
1080 * A pointer to the opaque Rust object.
1081 * Nearly everywhere, inner must be non-null, however in places where
1082 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1084 LDKnativeTrustedCommitmentTransaction *inner;
1086 * Indicates that this is the only struct which contains the same pointer.
1087 * Rust functions which take ownership of an object provided via an argument require
1088 * this to be true and invalidate the object pointed to by inner.
1091 } LDKTrustedCommitmentTransaction;
1094 * The contents of CResult_TrustedCommitmentTransactionNoneZ
1096 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
1098 * A pointer to the contents in the success state.
1099 * Reading from this pointer when `result_ok` is not set is undefined.
1101 struct LDKTrustedCommitmentTransaction *result;
1103 * Note that this value is always NULL, as there are no contents in the Err variant
1106 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
1109 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
1110 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
1111 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1113 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
1115 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
1116 * `err` or `result` depending on the state of `result_ok`.
1118 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
1120 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
1123 } LDKCResult_TrustedCommitmentTransactionNoneZ;
1126 * The contents of CResult_CVec_SignatureZNoneZ
1128 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
1130 * A pointer to the contents in the success state.
1131 * Reading from this pointer when `result_ok` is not set is undefined.
1133 struct LDKCVec_SignatureZ *result;
1135 * Note that this value is always NULL, as there are no contents in the Err variant
1138 } LDKCResult_CVec_SignatureZNoneZPtr;
1141 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
1142 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
1143 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1145 typedef struct LDKCResult_CVec_SignatureZNoneZ {
1147 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
1148 * `err` or `result` depending on the state of `result_ok`.
1150 union LDKCResult_CVec_SignatureZNoneZPtr contents;
1152 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
1155 } LDKCResult_CVec_SignatureZNoneZ;
1158 * The contents of CResult_StringErrorZ
1160 typedef union LDKCResult_StringErrorZPtr {
1162 * A pointer to the contents in the success state.
1163 * Reading from this pointer when `result_ok` is not set is undefined.
1165 struct LDKCVec_u8Z *result;
1167 * A pointer to the contents in the error state.
1168 * Reading from this pointer when `result_ok` is set is undefined.
1170 enum LDKSecp256k1Error *err;
1171 } LDKCResult_StringErrorZPtr;
1174 * A CResult_StringErrorZ represents the result of a fallible operation,
1175 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::c_types::Secp256k1Error on failure.
1176 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1178 typedef struct LDKCResult_StringErrorZ {
1180 * The contents of this CResult_StringErrorZ, accessible via either
1181 * `err` or `result` depending on the state of `result_ok`.
1183 union LDKCResult_StringErrorZPtr contents;
1185 * Whether this CResult_StringErrorZ represents a success state.
1188 } LDKCResult_StringErrorZ;
1193 * An update generated by the underlying Channel itself which contains some new information the
1194 * ChannelMonitor should be made aware of.
1196 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
1198 * A pointer to the opaque Rust object.
1199 * Nearly everywhere, inner must be non-null, however in places where
1200 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1202 LDKnativeChannelMonitorUpdate *inner;
1204 * Indicates that this is the only struct which contains the same pointer.
1205 * Rust functions which take ownership of an object provided via an argument require
1206 * this to be true and invalidate the object pointed to by inner.
1209 } LDKChannelMonitorUpdate;
1212 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
1214 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
1216 * A pointer to the contents in the success state.
1217 * Reading from this pointer when `result_ok` is not set is undefined.
1219 struct LDKChannelMonitorUpdate *result;
1221 * A pointer to the contents in the error state.
1222 * Reading from this pointer when `result_ok` is set is undefined.
1224 struct LDKDecodeError *err;
1225 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
1228 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
1229 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
1230 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1232 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
1234 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
1235 * `err` or `result` depending on the state of `result_ok`.
1237 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
1239 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
1242 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
1247 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
1248 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
1249 * preimage claim backward will lead to loss of funds.
1251 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
1253 * A pointer to the opaque Rust object.
1254 * Nearly everywhere, inner must be non-null, however in places where
1255 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1257 LDKnativeHTLCUpdate *inner;
1259 * Indicates that this is the only struct which contains the same pointer.
1260 * Rust functions which take ownership of an object provided via an argument require
1261 * this to be true and invalidate the object pointed to by inner.
1267 * The contents of CResult_HTLCUpdateDecodeErrorZ
1269 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
1271 * A pointer to the contents in the success state.
1272 * Reading from this pointer when `result_ok` is not set is undefined.
1274 struct LDKHTLCUpdate *result;
1276 * A pointer to the contents in the error state.
1277 * Reading from this pointer when `result_ok` is set is undefined.
1279 struct LDKDecodeError *err;
1280 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
1283 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
1284 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
1285 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1287 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
1289 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
1290 * `err` or `result` depending on the state of `result_ok`.
1292 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
1294 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
1297 } LDKCResult_HTLCUpdateDecodeErrorZ;
1302 * General Err type for ChannelMonitor actions. Generally, this implies that the data provided is
1303 * inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this
1304 * means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was
1306 * Contains a developer-readable error message.
1308 typedef struct MUST_USE_STRUCT LDKMonitorUpdateError {
1310 * A pointer to the opaque Rust object.
1311 * Nearly everywhere, inner must be non-null, however in places where
1312 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1314 LDKnativeMonitorUpdateError *inner;
1316 * Indicates that this is the only struct which contains the same pointer.
1317 * Rust functions which take ownership of an object provided via an argument require
1318 * this to be true and invalidate the object pointed to by inner.
1321 } LDKMonitorUpdateError;
1324 * The contents of CResult_NoneMonitorUpdateErrorZ
1326 typedef union LDKCResult_NoneMonitorUpdateErrorZPtr {
1328 * Note that this value is always NULL, as there are no contents in the OK variant
1332 * A pointer to the contents in the error state.
1333 * Reading from this pointer when `result_ok` is set is undefined.
1335 struct LDKMonitorUpdateError *err;
1336 } LDKCResult_NoneMonitorUpdateErrorZPtr;
1339 * A CResult_NoneMonitorUpdateErrorZ represents the result of a fallible operation,
1340 * containing a () on success and a crate::lightning::chain::channelmonitor::MonitorUpdateError on failure.
1341 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1343 typedef struct LDKCResult_NoneMonitorUpdateErrorZ {
1345 * The contents of this CResult_NoneMonitorUpdateErrorZ, accessible via either
1346 * `err` or `result` depending on the state of `result_ok`.
1348 union LDKCResult_NoneMonitorUpdateErrorZPtr contents;
1350 * Whether this CResult_NoneMonitorUpdateErrorZ represents a success state.
1353 } LDKCResult_NoneMonitorUpdateErrorZ;
1356 * A tuple of 2 elements. See the individual fields for the types contained.
1358 typedef struct LDKC2Tuple_OutPointScriptZ {
1360 * The element at position 0
1362 struct LDKOutPoint a;
1364 * The element at position 1
1366 struct LDKCVec_u8Z b;
1367 } LDKC2Tuple_OutPointScriptZ;
1370 * A tuple of 2 elements. See the individual fields for the types contained.
1372 typedef struct LDKC2Tuple_u32ScriptZ {
1374 * The element at position 0
1378 * The element at position 1
1380 struct LDKCVec_u8Z b;
1381 } LDKC2Tuple_u32ScriptZ;
1384 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
1385 * This corresponds to std::vector in C++
1387 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
1389 * The elements in the array.
1390 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1392 struct LDKC2Tuple_u32ScriptZ *data;
1394 * The number of elements pointed to by `data`.
1397 } LDKCVec_C2Tuple_u32ScriptZZ;
1400 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
1401 * look up the corresponding function in rust-lightning's docs.
1403 typedef struct LDKThirtyTwoBytes {
1405 * The thirty-two bytes
1408 } LDKThirtyTwoBytes;
1411 * A tuple of 2 elements. See the individual fields for the types contained.
1413 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
1415 * The element at position 0
1417 struct LDKThirtyTwoBytes a;
1419 * The element at position 1
1421 struct LDKCVec_C2Tuple_u32ScriptZZ b;
1422 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
1425 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
1426 * This corresponds to std::vector in C++
1428 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
1430 * The elements in the array.
1431 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1433 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
1435 * The number of elements pointed to by `data`.
1438 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
1441 * An event to be processed by the ChannelManager.
1443 typedef enum LDKMonitorEvent_Tag {
1445 * A monitor event containing an HTLCUpdate.
1447 LDKMonitorEvent_HTLCEvent,
1449 * A monitor event that the Channel's commitment transaction was broadcasted.
1451 LDKMonitorEvent_CommitmentTxBroadcasted,
1453 * Must be last for serialization purposes
1455 LDKMonitorEvent_Sentinel,
1456 } LDKMonitorEvent_Tag;
1458 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
1459 LDKMonitorEvent_Tag tag;
1462 struct LDKHTLCUpdate htlc_event;
1465 struct LDKOutPoint commitment_tx_broadcasted;
1471 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
1472 * This corresponds to std::vector in C++
1474 typedef struct LDKCVec_MonitorEventZ {
1476 * The elements in the array.
1477 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1479 struct LDKMonitorEvent *data;
1481 * The number of elements pointed to by `data`.
1484 } LDKCVec_MonitorEventZ;
1489 * Information about a spendable output to a P2WSH script. See
1490 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
1492 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
1494 * A pointer to the opaque Rust object.
1495 * Nearly everywhere, inner must be non-null, however in places where
1496 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1498 LDKnativeDelayedPaymentOutputDescriptor *inner;
1500 * Indicates that this is the only struct which contains the same pointer.
1501 * Rust functions which take ownership of an object provided via an argument require
1502 * this to be true and invalidate the object pointed to by inner.
1505 } LDKDelayedPaymentOutputDescriptor;
1510 * Information about a spendable output to our \"payment key\". See
1511 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
1513 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
1515 * A pointer to the opaque Rust object.
1516 * Nearly everywhere, inner must be non-null, however in places where
1517 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1519 LDKnativeStaticPaymentOutputDescriptor *inner;
1521 * Indicates that this is the only struct which contains the same pointer.
1522 * Rust functions which take ownership of an object provided via an argument require
1523 * this to be true and invalidate the object pointed to by inner.
1526 } LDKStaticPaymentOutputDescriptor;
1529 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
1530 * claim at any point in the future) an event is generated which you must track and be able to
1531 * spend on-chain. The information needed to do this is provided in this enum, including the
1532 * outpoint describing which txid and output index is available, the full output which exists at
1533 * that txid/index, and any keys or other information required to sign.
1535 typedef enum LDKSpendableOutputDescriptor_Tag {
1537 * An output to a script which was provided via KeysInterface directly, either from
1538 * `get_destination_script()` or `get_shutdown_pubkey()`, thus you should already know how to
1539 * spend it. No secret keys are provided as rust-lightning was never given any key.
1540 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
1541 * on-chain using the payment preimage or after it has timed out.
1543 LDKSpendableOutputDescriptor_StaticOutput,
1545 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
1547 * The witness in the spending input should be:
1548 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
1550 * Note that the nSequence field in the spending input must be set to to_self_delay
1551 * (which means the transaction is not broadcastable until at least to_self_delay
1552 * blocks after the outpoint confirms).
1554 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
1555 * it is an output from an old state which we broadcast (which should never happen).
1557 * To derive the delayed_payment key which is used to sign for this input, you must pass the
1558 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
1559 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
1560 * chan_utils::derive_private_key. The public key can be generated without the secret key
1561 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
1564 * To derive the revocation_pubkey provided here (which is used in the witness
1565 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
1566 * call to Sign::ready_channel) and the provided per_commitment point
1567 * to chan_utils::derive_public_revocation_key.
1569 * The witness script which is hashed and included in the output script_pubkey may be
1570 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
1571 * (derived as above), and the to_self_delay contained here to
1572 * chan_utils::get_revokeable_redeemscript.
1574 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
1576 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
1577 * corresponds to the public key in Sign::pubkeys().payment_point).
1578 * The witness in the spending input, is, thus, simply:
1579 * <BIP 143 signature> <payment key>
1581 * These are generally the result of our counterparty having broadcast the current state,
1582 * allowing us to claim the non-HTLC-encumbered outputs immediately.
1584 LDKSpendableOutputDescriptor_StaticPaymentOutput,
1586 * Must be last for serialization purposes
1588 LDKSpendableOutputDescriptor_Sentinel,
1589 } LDKSpendableOutputDescriptor_Tag;
1591 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
1593 * The outpoint which is spendable
1595 struct LDKOutPoint outpoint;
1597 * The output which is referenced by the given outpoint.
1599 struct LDKTxOut output;
1600 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
1602 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
1603 LDKSpendableOutputDescriptor_Tag tag;
1605 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
1607 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
1610 struct LDKStaticPaymentOutputDescriptor static_payment_output;
1613 } LDKSpendableOutputDescriptor;
1616 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
1617 * This corresponds to std::vector in C++
1619 typedef struct LDKCVec_SpendableOutputDescriptorZ {
1621 * The elements in the array.
1622 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1624 struct LDKSpendableOutputDescriptor *data;
1626 * The number of elements pointed to by `data`.
1629 } LDKCVec_SpendableOutputDescriptorZ;
1632 * An Event which you should probably take some action in response to.
1634 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
1635 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
1636 * written as it makes no sense to respond to it after reconnecting to peers).
1638 typedef enum LDKEvent_Tag {
1640 * Used to indicate that the client should generate a funding transaction with the given
1641 * parameters and then call ChannelManager::funding_transaction_generated.
1642 * Generated in ChannelManager message handling.
1643 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
1644 * counterparty can steal your funds!
1646 LDKEvent_FundingGenerationReady,
1648 * Indicates we've received money! Just gotta dig out that payment preimage and feed it to
1649 * ChannelManager::claim_funds to get it....
1650 * Note that if the preimage is not known or the amount paid is incorrect, you should call
1651 * ChannelManager::fail_htlc_backwards to free up resources for this HTLC and avoid
1652 * network congestion.
1653 * The amount paid should be considered 'incorrect' when it is less than or more than twice
1654 * the amount expected.
1655 * If you fail to call either ChannelManager::claim_funds or
1656 * ChannelManager::fail_htlc_backwards within the HTLC's timeout, the HTLC will be
1657 * automatically failed.
1659 LDKEvent_PaymentReceived,
1661 * Indicates an outbound payment we made succeeded (ie it made it all the way to its target
1662 * and we got back the payment preimage for it).
1663 * Note that duplicative PaymentSent Events may be generated - it is your responsibility to
1664 * deduplicate them by payment_preimage (which MUST be unique)!
1666 LDKEvent_PaymentSent,
1668 * Indicates an outbound payment we made failed. Probably some intermediary node dropped
1669 * something. You may wish to retry with a different route.
1670 * Note that duplicative PaymentFailed Events may be generated - it is your responsibility to
1671 * deduplicate them by payment_hash (which MUST be unique)!
1673 LDKEvent_PaymentFailed,
1675 * Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
1676 * time in the future.
1678 LDKEvent_PendingHTLCsForwardable,
1680 * Used to indicate that an output was generated on-chain which you should know how to spend.
1681 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
1682 * counterparty spending them due to some kind of timeout. Thus, you need to store them
1683 * somewhere and spend them when you create on-chain transactions.
1685 LDKEvent_SpendableOutputs,
1687 * Must be last for serialization purposes
1692 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
1694 * The random channel_id we picked which you'll need to pass into
1695 * ChannelManager::funding_transaction_generated.
1697 struct LDKThirtyTwoBytes temporary_channel_id;
1699 * The value, in satoshis, that the output should have.
1701 uint64_t channel_value_satoshis;
1703 * The script which should be used in the transaction output.
1705 struct LDKCVec_u8Z output_script;
1707 * The value passed in to ChannelManager::create_channel
1709 uint64_t user_channel_id;
1710 } LDKEvent_LDKFundingGenerationReady_Body;
1712 typedef struct LDKEvent_LDKPaymentReceived_Body {
1714 * The hash for which the preimage should be handed to the ChannelManager.
1716 struct LDKThirtyTwoBytes payment_hash;
1718 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
1719 * number of deanonymization attacks during the routing process.
1720 * As nodes upgrade, the invoices you provide should likely migrate to setting the
1721 * payment_secret feature to required, at which point you should fail_backwards any HTLCs
1722 * which have a None here.
1723 * Until then, however, values of None should be ignored, and only incorrect Some values
1724 * should result in an HTLC fail_backwards.
1725 * Note that, in any case, this value must be passed as-is to any fail or claim calls as
1726 * the HTLC index includes this value.
1728 struct LDKThirtyTwoBytes payment_secret;
1730 * The value, in thousandths of a satoshi, that this payment is for. Note that you must
1731 * compare this to the expected value before accepting the payment (as otherwise you are
1732 * providing proof-of-payment for less than the value you expected!).
1735 } LDKEvent_LDKPaymentReceived_Body;
1737 typedef struct LDKEvent_LDKPaymentSent_Body {
1739 * The preimage to the hash given to ChannelManager::send_payment.
1740 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
1743 struct LDKThirtyTwoBytes payment_preimage;
1744 } LDKEvent_LDKPaymentSent_Body;
1746 typedef struct LDKEvent_LDKPaymentFailed_Body {
1748 * The hash which was given to ChannelManager::send_payment.
1750 struct LDKThirtyTwoBytes payment_hash;
1752 * Indicates the payment was rejected for some reason by the recipient. This implies that
1753 * the payment has failed, not just the route in question. If this is not set, you may
1754 * retry the payment via a different route.
1756 bool rejected_by_dest;
1757 } LDKEvent_LDKPaymentFailed_Body;
1759 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
1761 * The minimum amount of time that should be waited prior to calling
1762 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
1763 * you should wait a random amount of time in roughly the range (now + time_forwardable,
1764 * now + 5*time_forwardable).
1766 uint64_t time_forwardable;
1767 } LDKEvent_LDKPendingHTLCsForwardable_Body;
1769 typedef struct LDKEvent_LDKSpendableOutputs_Body {
1771 * The outputs which you should store as spendable by you.
1773 struct LDKCVec_SpendableOutputDescriptorZ outputs;
1774 } LDKEvent_LDKSpendableOutputs_Body;
1776 typedef struct MUST_USE_STRUCT LDKEvent {
1779 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
1780 LDKEvent_LDKPaymentReceived_Body payment_received;
1781 LDKEvent_LDKPaymentSent_Body payment_sent;
1782 LDKEvent_LDKPaymentFailed_Body payment_failed;
1783 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
1784 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
1789 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
1790 * This corresponds to std::vector in C++
1792 typedef struct LDKCVec_EventZ {
1794 * The elements in the array.
1795 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1797 struct LDKEvent *data;
1799 * The number of elements pointed to by `data`.
1805 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
1806 * This corresponds to std::vector in C++
1808 typedef struct LDKCVec_TransactionZ {
1810 * The elements in the array.
1811 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1813 struct LDKTransaction *data;
1815 * The number of elements pointed to by `data`.
1818 } LDKCVec_TransactionZ;
1821 * A tuple of 2 elements. See the individual fields for the types contained.
1823 typedef struct LDKC2Tuple_usizeTransactionZ {
1825 * The element at position 0
1829 * The element at position 1
1831 struct LDKTransaction b;
1832 } LDKC2Tuple_usizeTransactionZ;
1835 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
1836 * This corresponds to std::vector in C++
1838 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
1840 * The elements in the array.
1841 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1843 struct LDKC2Tuple_usizeTransactionZ *data;
1845 * The number of elements pointed to by `data`.
1848 } LDKCVec_C2Tuple_usizeTransactionZZ;
1851 * A tuple of 2 elements. See the individual fields for the types contained.
1853 typedef struct LDKC2Tuple_u32TxOutZ {
1855 * The element at position 0
1859 * The element at position 1
1862 } LDKC2Tuple_u32TxOutZ;
1865 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
1866 * This corresponds to std::vector in C++
1868 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
1870 * The elements in the array.
1871 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1873 struct LDKC2Tuple_u32TxOutZ *data;
1875 * The number of elements pointed to by `data`.
1878 } LDKCVec_C2Tuple_u32TxOutZZ;
1881 * A tuple of 2 elements. See the individual fields for the types contained.
1883 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
1885 * The element at position 0
1887 struct LDKThirtyTwoBytes a;
1889 * The element at position 1
1891 struct LDKCVec_C2Tuple_u32TxOutZZ b;
1892 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
1895 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
1896 * This corresponds to std::vector in C++
1898 typedef struct LDKCVec_TransactionOutputsZ {
1900 * The elements in the array.
1901 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1903 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
1905 * The number of elements pointed to by `data`.
1908 } LDKCVec_TransactionOutputsZ;
1911 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
1912 * This corresponds to std::vector in C++
1914 typedef struct LDKCVec_TxidZ {
1916 * The elements in the array.
1917 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1919 struct LDKThirtyTwoBytes *data;
1921 * The number of elements pointed to by `data`.
1927 * The contents of CResult_NoneChannelMonitorUpdateErrZ
1929 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
1931 * Note that this value is always NULL, as there are no contents in the OK variant
1935 * A pointer to the contents in the error state.
1936 * Reading from this pointer when `result_ok` is set is undefined.
1938 enum LDKChannelMonitorUpdateErr *err;
1939 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
1942 * A CResult_NoneChannelMonitorUpdateErrZ represents the result of a fallible operation,
1943 * containing a () on success and a crate::lightning::chain::channelmonitor::ChannelMonitorUpdateErr on failure.
1944 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1946 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
1948 * The contents of this CResult_NoneChannelMonitorUpdateErrZ, accessible via either
1949 * `err` or `result` depending on the state of `result_ok`.
1951 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
1953 * Whether this CResult_NoneChannelMonitorUpdateErrZ represents a success state.
1956 } LDKCResult_NoneChannelMonitorUpdateErrZ;
1959 * A tuple of 2 elements. See the individual fields for the types contained.
1961 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
1963 * The element at position 0
1965 struct LDKSignature a;
1967 * The element at position 1
1969 struct LDKCVec_SignatureZ b;
1970 } LDKC2Tuple_SignatureCVec_SignatureZZ;
1973 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
1975 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
1977 * A pointer to the contents in the success state.
1978 * Reading from this pointer when `result_ok` is not set is undefined.
1980 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
1982 * Note that this value is always NULL, as there are no contents in the Err variant
1985 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
1988 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
1989 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
1990 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1992 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
1994 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
1995 * `err` or `result` depending on the state of `result_ok`.
1997 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
1999 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
2002 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
2005 * The contents of CResult_SignatureNoneZ
2007 typedef union LDKCResult_SignatureNoneZPtr {
2009 * A pointer to the contents in the success state.
2010 * Reading from this pointer when `result_ok` is not set is undefined.
2012 struct LDKSignature *result;
2014 * Note that this value is always NULL, as there are no contents in the Err variant
2017 } LDKCResult_SignatureNoneZPtr;
2020 * A CResult_SignatureNoneZ represents the result of a fallible operation,
2021 * containing a crate::c_types::Signature on success and a () on failure.
2022 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2024 typedef struct LDKCResult_SignatureNoneZ {
2026 * The contents of this CResult_SignatureNoneZ, accessible via either
2027 * `err` or `result` depending on the state of `result_ok`.
2029 union LDKCResult_SignatureNoneZPtr contents;
2031 * Whether this CResult_SignatureNoneZ represents a success state.
2034 } LDKCResult_SignatureNoneZ;
2039 * The unsigned part of a channel_announcement
2041 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
2043 * A pointer to the opaque Rust object.
2044 * Nearly everywhere, inner must be non-null, however in places where
2045 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2047 LDKnativeUnsignedChannelAnnouncement *inner;
2049 * Indicates that this is the only struct which contains the same pointer.
2050 * Rust functions which take ownership of an object provided via an argument require
2051 * this to be true and invalidate the object pointed to by inner.
2054 } LDKUnsignedChannelAnnouncement;
2057 * A trait to sign lightning channel transactions as described in BOLT 3.
2059 * Signing services could be implemented on a hardware wallet. In this case,
2060 * the current Sign would be a front-end on top of a communication
2061 * channel connected to your secure device and lightning key material wouldn't
2062 * reside on a hot server. Nevertheless, a this deployment would still need
2063 * to trust the ChannelManager to avoid loss of funds as this latest component
2064 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
2066 * A more secure iteration would be to use hashlock (or payment points) to pair
2067 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
2068 * at the price of more state and computation on the hardware wallet side. In the future,
2069 * we are looking forward to design such interface.
2071 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
2072 * to act, as liveness and breach reply correctness are always going to be hard requirements
2073 * of LN security model, orthogonal of key management issues.
2075 typedef struct LDKBaseSign {
2077 * An opaque pointer which is passed to your function implementations as an argument.
2078 * This has no meaning in the LDK, and can be NULL or any other value.
2082 * Gets the per-commitment point for a specific commitment number
2084 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
2086 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
2088 * Gets the commitment secret for a specific commitment number as part of the revocation process
2090 * An external signer implementation should error here if the commitment was already signed
2091 * and should refuse to sign it in the future.
2093 * May be called more than once for the same index.
2095 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
2097 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
2099 * Gets the holder's channel public keys and basepoints
2101 struct LDKChannelPublicKeys pubkeys;
2103 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
2104 * Note that this takes a pointer to this object, not the this_ptr like other methods do
2105 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
2107 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
2109 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
2110 * some SpendableOutputDescriptor types. This should be sufficient to identify this
2111 * Sign object uniquely and lookup or re-derive its keys.
2113 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
2115 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
2117 * Note that if signing fails or is rejected, the channel will be force-closed.
2119 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx);
2121 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
2122 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
2123 * latest commitment_tx when we initiate a force-close.
2124 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
2125 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
2127 * This may be called multiple times for the same transaction.
2129 * An external signer implementation should check that the commitment has not been revoked.
2131 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
2133 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
2135 * Create a signature for the given input in a transaction spending an HTLC or commitment
2136 * transaction output when our counterparty broadcasts an old state.
2138 * A justice transaction may claim multiples outputs at the same time if timelocks are
2139 * similar, but only a signature for the input at index `input` should be signed for here.
2140 * It may be called multiples time for same output(s) if a fee-bump is needed with regards
2141 * to an upcoming timelock expiration.
2143 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2145 * per_commitment_key is revocation secret which was provided by our counterparty when they
2146 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2147 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
2150 * htlc holds HTLC elements (hash, timelock) if the output being spent is a HTLC output, thus
2151 * changing the format of the witness script (which is committed to in the BIP 143
2154 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);
2156 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
2157 * transaction, either offered or received.
2159 * Such a transaction may claim multiples offered outputs at same time if we know the
2160 * preimage for each when we create it, but only the input at index `input` should be
2161 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
2162 * needed with regards to an upcoming timelock expiration.
2164 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
2167 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2169 * Per_commitment_point is the dynamic point corresponding to the channel state
2170 * detected onchain. It has been generated by our counterparty and is used to derive
2171 * channel state keys, which are then included in the witness script and committed to in the
2172 * BIP 143 signature.
2174 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);
2176 * Create a signature for a (proposed) closing transaction.
2178 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
2179 * chosen to forgo their output as dust.
2181 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, struct LDKTransaction closing_tx);
2183 * Signs a channel announcement message with our funding key, proving it comes from one
2184 * of the channel participants.
2186 * Note that if this fails or is rejected, the channel will not be publicly announced and
2187 * our counterparty may (though likely will not) close the channel on us for violating the
2190 struct LDKCResult_SignatureNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
2192 * Set the counterparty static channel data, including basepoints,
2193 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
2194 * This is done as soon as the funding outpoint is known. Since these are static channel data,
2195 * they MUST NOT be allowed to change to different values once set.
2197 * channel_parameters.is_populated() MUST be true.
2199 * We bind holder_selected_contest_delay late here for API convenience.
2201 * Will be called before any signatures are applied.
2203 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
2205 * Frees any resources associated with this object given its this_arg pointer.
2206 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2208 void (*free)(void *this_arg);
2212 * A cloneable signer.
2214 * Although we require signers to be cloneable, it may be useful for developers to be able to use
2215 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
2216 * which implies Sized, into this derived trait.
2218 typedef struct LDKSign {
2220 * An opaque pointer which is passed to your function implementations as an argument.
2221 * This has no meaning in the LDK, and can be NULL or any other value.
2225 * Implementation of BaseSign for this object.
2227 struct LDKBaseSign BaseSign;
2229 * Creates a copy of the BaseSign, for a copy of this Sign.
2230 * Because BaseSign doesn't natively support copying itself, you have to provide a full copy implementation here.
2232 struct LDKBaseSign (*BaseSign_clone)(const struct LDKBaseSign *NONNULL_PTR orig_BaseSign);
2234 * Serialize the object into a byte array
2236 struct LDKCVec_u8Z (*write)(const void *this_arg);
2238 * Creates a copy of the object pointed to by this_arg, for a copy of this Sign.
2239 * Note that the ultimate copy of the Sign will have all function pointers the same as the original.
2240 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new Sign.
2242 void *(*clone)(const void *this_arg);
2244 * Frees any resources associated with this object given its this_arg pointer.
2245 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2247 void (*free)(void *this_arg);
2253 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
2254 * on-chain transactions to ensure no loss of funds occurs.
2256 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
2257 * information and are actively monitoring the chain.
2259 * Pending Events or updated HTLCs which have not yet been read out by
2260 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
2261 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
2262 * gotten are fully handled before re-serializing the new state.
2264 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
2265 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
2266 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
2267 * returned block hash and the the current chain and then reconnecting blocks to get to the
2268 * best chain) upon deserializing the object!
2270 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
2272 * A pointer to the opaque Rust object.
2273 * Nearly everywhere, inner must be non-null, however in places where
2274 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2276 LDKnativeChannelMonitor *inner;
2278 * Indicates that this is the only struct which contains the same pointer.
2279 * Rust functions which take ownership of an object provided via an argument require
2280 * this to be true and invalidate the object pointed to by inner.
2283 } LDKChannelMonitor;
2286 * A tuple of 2 elements. See the individual fields for the types contained.
2288 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
2290 * The element at position 0
2292 struct LDKThirtyTwoBytes a;
2294 * The element at position 1
2296 struct LDKChannelMonitor b;
2297 } LDKC2Tuple_BlockHashChannelMonitorZ;
2300 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
2302 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
2304 * A pointer to the contents in the success state.
2305 * Reading from this pointer when `result_ok` is not set is undefined.
2307 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
2309 * A pointer to the contents in the error state.
2310 * Reading from this pointer when `result_ok` is set is undefined.
2312 struct LDKDecodeError *err;
2313 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
2316 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
2317 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
2318 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2320 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
2322 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
2323 * `err` or `result` depending on the state of `result_ok`.
2325 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
2327 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
2330 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
2337 typedef struct MUST_USE_STRUCT LDKRouteHop {
2339 * A pointer to the opaque Rust object.
2340 * Nearly everywhere, inner must be non-null, however in places where
2341 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2343 LDKnativeRouteHop *inner;
2345 * Indicates that this is the only struct which contains the same pointer.
2346 * Rust functions which take ownership of an object provided via an argument require
2347 * this to be true and invalidate the object pointed to by inner.
2353 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
2354 * This corresponds to std::vector in C++
2356 typedef struct LDKCVec_RouteHopZ {
2358 * The elements in the array.
2359 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2361 struct LDKRouteHop *data;
2363 * The number of elements pointed to by `data`.
2366 } LDKCVec_RouteHopZ;
2369 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
2370 * This corresponds to std::vector in C++
2372 typedef struct LDKCVec_CVec_RouteHopZZ {
2374 * The elements in the array.
2375 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2377 struct LDKCVec_RouteHopZ *data;
2379 * The number of elements pointed to by `data`.
2382 } LDKCVec_CVec_RouteHopZZ;
2387 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
2388 * it can take multiple paths. Each path is composed of one or more hops through the network.
2390 typedef struct MUST_USE_STRUCT LDKRoute {
2392 * A pointer to the opaque Rust object.
2393 * Nearly everywhere, inner must be non-null, however in places where
2394 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2396 LDKnativeRoute *inner;
2398 * Indicates that this is the only struct which contains the same pointer.
2399 * Rust functions which take ownership of an object provided via an argument require
2400 * this to be true and invalidate the object pointed to by inner.
2406 * The contents of CResult_RouteDecodeErrorZ
2408 typedef union LDKCResult_RouteDecodeErrorZPtr {
2410 * A pointer to the contents in the success state.
2411 * Reading from this pointer when `result_ok` is not set is undefined.
2413 struct LDKRoute *result;
2415 * A pointer to the contents in the error state.
2416 * Reading from this pointer when `result_ok` is set is undefined.
2418 struct LDKDecodeError *err;
2419 } LDKCResult_RouteDecodeErrorZPtr;
2422 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
2423 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
2424 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2426 typedef struct LDKCResult_RouteDecodeErrorZ {
2428 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
2429 * `err` or `result` depending on the state of `result_ok`.
2431 union LDKCResult_RouteDecodeErrorZPtr contents;
2433 * Whether this CResult_RouteDecodeErrorZ represents a success state.
2436 } LDKCResult_RouteDecodeErrorZ;
2439 * An enum which can either contain a u64 or not
2441 typedef enum LDKCOption_u64Z_Tag {
2443 * When we're in this state, this COption_u64Z contains a u64
2445 LDKCOption_u64Z_Some,
2447 * When we're in this state, this COption_u64Z contains nothing
2449 LDKCOption_u64Z_None,
2451 * Must be last for serialization purposes
2453 LDKCOption_u64Z_Sentinel,
2454 } LDKCOption_u64Z_Tag;
2456 typedef struct LDKCOption_u64Z {
2457 LDKCOption_u64Z_Tag tag;
2468 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
2470 typedef struct MUST_USE_STRUCT LDKChannelDetails {
2472 * A pointer to the opaque Rust object.
2473 * Nearly everywhere, inner must be non-null, however in places where
2474 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2476 LDKnativeChannelDetails *inner;
2478 * Indicates that this is the only struct which contains the same pointer.
2479 * Rust functions which take ownership of an object provided via an argument require
2480 * this to be true and invalidate the object pointed to by inner.
2483 } LDKChannelDetails;
2486 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
2487 * This corresponds to std::vector in C++
2489 typedef struct LDKCVec_ChannelDetailsZ {
2491 * The elements in the array.
2492 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2494 struct LDKChannelDetails *data;
2496 * The number of elements pointed to by `data`.
2499 } LDKCVec_ChannelDetailsZ;
2504 * A channel descriptor which provides a last-hop route to get_route
2506 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
2508 * A pointer to the opaque Rust object.
2509 * Nearly everywhere, inner must be non-null, however in places where
2510 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2512 LDKnativeRouteHintHop *inner;
2514 * Indicates that this is the only struct which contains the same pointer.
2515 * Rust functions which take ownership of an object provided via an argument require
2516 * this to be true and invalidate the object pointed to by inner.
2522 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
2523 * This corresponds to std::vector in C++
2525 typedef struct LDKCVec_RouteHintHopZ {
2527 * The elements in the array.
2528 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2530 struct LDKRouteHintHop *data;
2532 * The number of elements pointed to by `data`.
2535 } LDKCVec_RouteHintHopZ;
2540 * An Err type for failure to process messages.
2542 typedef struct MUST_USE_STRUCT LDKLightningError {
2544 * A pointer to the opaque Rust object.
2545 * Nearly everywhere, inner must be non-null, however in places where
2546 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2548 LDKnativeLightningError *inner;
2550 * Indicates that this is the only struct which contains the same pointer.
2551 * Rust functions which take ownership of an object provided via an argument require
2552 * this to be true and invalidate the object pointed to by inner.
2555 } LDKLightningError;
2558 * The contents of CResult_RouteLightningErrorZ
2560 typedef union LDKCResult_RouteLightningErrorZPtr {
2562 * A pointer to the contents in the success state.
2563 * Reading from this pointer when `result_ok` is not set is undefined.
2565 struct LDKRoute *result;
2567 * A pointer to the contents in the error state.
2568 * Reading from this pointer when `result_ok` is set is undefined.
2570 struct LDKLightningError *err;
2571 } LDKCResult_RouteLightningErrorZPtr;
2574 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
2575 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
2576 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2578 typedef struct LDKCResult_RouteLightningErrorZ {
2580 * The contents of this CResult_RouteLightningErrorZ, accessible via either
2581 * `err` or `result` depending on the state of `result_ok`.
2583 union LDKCResult_RouteLightningErrorZPtr contents;
2585 * Whether this CResult_RouteLightningErrorZ represents a success state.
2588 } LDKCResult_RouteLightningErrorZ;
2593 * An accept_channel message to be sent or received from a peer
2595 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
2597 * A pointer to the opaque Rust object.
2598 * Nearly everywhere, inner must be non-null, however in places where
2599 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2601 LDKnativeAcceptChannel *inner;
2603 * Indicates that this is the only struct which contains the same pointer.
2604 * Rust functions which take ownership of an object provided via an argument require
2605 * this to be true and invalidate the object pointed to by inner.
2613 * An open_channel message to be sent or received from a peer
2615 typedef struct MUST_USE_STRUCT LDKOpenChannel {
2617 * A pointer to the opaque Rust object.
2618 * Nearly everywhere, inner must be non-null, however in places where
2619 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2621 LDKnativeOpenChannel *inner;
2623 * Indicates that this is the only struct which contains the same pointer.
2624 * Rust functions which take ownership of an object provided via an argument require
2625 * this to be true and invalidate the object pointed to by inner.
2633 * A funding_created message to be sent or received from a peer
2635 typedef struct MUST_USE_STRUCT LDKFundingCreated {
2637 * A pointer to the opaque Rust object.
2638 * Nearly everywhere, inner must be non-null, however in places where
2639 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2641 LDKnativeFundingCreated *inner;
2643 * Indicates that this is the only struct which contains the same pointer.
2644 * Rust functions which take ownership of an object provided via an argument require
2645 * this to be true and invalidate the object pointed to by inner.
2648 } LDKFundingCreated;
2653 * A funding_signed message to be sent or received from a peer
2655 typedef struct MUST_USE_STRUCT LDKFundingSigned {
2657 * A pointer to the opaque Rust object.
2658 * Nearly everywhere, inner must be non-null, however in places where
2659 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2661 LDKnativeFundingSigned *inner;
2663 * Indicates that this is the only struct which contains the same pointer.
2664 * Rust functions which take ownership of an object provided via an argument require
2665 * this to be true and invalidate the object pointed to by inner.
2673 * A funding_locked message to be sent or received from a peer
2675 typedef struct MUST_USE_STRUCT LDKFundingLocked {
2677 * A pointer to the opaque Rust object.
2678 * Nearly everywhere, inner must be non-null, however in places where
2679 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2681 LDKnativeFundingLocked *inner;
2683 * Indicates that this is the only struct which contains the same pointer.
2684 * Rust functions which take ownership of an object provided via an argument require
2685 * this to be true and invalidate the object pointed to by inner.
2693 * An announcement_signatures message to be sent or received from a peer
2695 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
2697 * A pointer to the opaque Rust object.
2698 * Nearly everywhere, inner must be non-null, however in places where
2699 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2701 LDKnativeAnnouncementSignatures *inner;
2703 * Indicates that this is the only struct which contains the same pointer.
2704 * Rust functions which take ownership of an object provided via an argument require
2705 * this to be true and invalidate the object pointed to by inner.
2708 } LDKAnnouncementSignatures;
2713 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
2714 * transaction updates if they were pending.
2716 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
2718 * A pointer to the opaque Rust object.
2719 * Nearly everywhere, inner must be non-null, however in places where
2720 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2722 LDKnativeCommitmentUpdate *inner;
2724 * Indicates that this is the only struct which contains the same pointer.
2725 * Rust functions which take ownership of an object provided via an argument require
2726 * this to be true and invalidate the object pointed to by inner.
2729 } LDKCommitmentUpdate;
2734 * A revoke_and_ack message to be sent or received from a peer
2736 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
2738 * A pointer to the opaque Rust object.
2739 * Nearly everywhere, inner must be non-null, however in places where
2740 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2742 LDKnativeRevokeAndACK *inner;
2744 * Indicates that this is the only struct which contains the same pointer.
2745 * Rust functions which take ownership of an object provided via an argument require
2746 * this to be true and invalidate the object pointed to by inner.
2754 * A closing_signed message to be sent or received from a peer
2756 typedef struct MUST_USE_STRUCT LDKClosingSigned {
2758 * A pointer to the opaque Rust object.
2759 * Nearly everywhere, inner must be non-null, however in places where
2760 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2762 LDKnativeClosingSigned *inner;
2764 * Indicates that this is the only struct which contains the same pointer.
2765 * Rust functions which take ownership of an object provided via an argument require
2766 * this to be true and invalidate the object pointed to by inner.
2774 * A shutdown message to be sent or received from a peer
2776 typedef struct MUST_USE_STRUCT LDKShutdown {
2778 * A pointer to the opaque Rust object.
2779 * Nearly everywhere, inner must be non-null, however in places where
2780 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2782 LDKnativeShutdown *inner;
2784 * Indicates that this is the only struct which contains the same pointer.
2785 * Rust functions which take ownership of an object provided via an argument require
2786 * this to be true and invalidate the object pointed to by inner.
2794 * A channel_reestablish message to be sent or received from a peer
2796 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
2798 * A pointer to the opaque Rust object.
2799 * Nearly everywhere, inner must be non-null, however in places where
2800 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2802 LDKnativeChannelReestablish *inner;
2804 * Indicates that this is the only struct which contains the same pointer.
2805 * Rust functions which take ownership of an object provided via an argument require
2806 * this to be true and invalidate the object pointed to by inner.
2809 } LDKChannelReestablish;
2814 * A channel_announcement message to be sent or received from a peer
2816 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
2818 * A pointer to the opaque Rust object.
2819 * Nearly everywhere, inner must be non-null, however in places where
2820 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2822 LDKnativeChannelAnnouncement *inner;
2824 * Indicates that this is the only struct which contains the same pointer.
2825 * Rust functions which take ownership of an object provided via an argument require
2826 * this to be true and invalidate the object pointed to by inner.
2829 } LDKChannelAnnouncement;
2834 * A channel_update message to be sent or received from a peer
2836 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
2838 * A pointer to the opaque Rust object.
2839 * Nearly everywhere, inner must be non-null, however in places where
2840 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2842 LDKnativeChannelUpdate *inner;
2844 * Indicates that this is the only struct which contains the same pointer.
2845 * Rust functions which take ownership of an object provided via an argument require
2846 * this to be true and invalidate the object pointed to by inner.
2854 * A node_announcement message to be sent or received from a peer
2856 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
2858 * A pointer to the opaque Rust object.
2859 * Nearly everywhere, inner must be non-null, however in places where
2860 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2862 LDKnativeNodeAnnouncement *inner;
2864 * Indicates that this is the only struct which contains the same pointer.
2865 * Rust functions which take ownership of an object provided via an argument require
2866 * this to be true and invalidate the object pointed to by inner.
2869 } LDKNodeAnnouncement;
2874 * An error message to be sent or received from a peer
2876 typedef struct MUST_USE_STRUCT LDKErrorMessage {
2878 * A pointer to the opaque Rust object.
2879 * Nearly everywhere, inner must be non-null, however in places where
2880 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2882 LDKnativeErrorMessage *inner;
2884 * Indicates that this is the only struct which contains the same pointer.
2885 * Rust functions which take ownership of an object provided via an argument require
2886 * this to be true and invalidate the object pointed to by inner.
2892 * Used to put an error message in a LightningError
2894 typedef enum LDKErrorAction_Tag {
2896 * The peer took some action which made us think they were useless. Disconnect them.
2898 LDKErrorAction_DisconnectPeer,
2900 * The peer did something harmless that we weren't able to process, just log and ignore
2902 LDKErrorAction_IgnoreError,
2904 * The peer did something incorrect. Tell them.
2906 LDKErrorAction_SendErrorMessage,
2908 * Must be last for serialization purposes
2910 LDKErrorAction_Sentinel,
2911 } LDKErrorAction_Tag;
2913 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
2915 * An error message which we should make an effort to send before we disconnect.
2917 struct LDKErrorMessage msg;
2918 } LDKErrorAction_LDKDisconnectPeer_Body;
2920 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
2922 * The message to send.
2924 struct LDKErrorMessage msg;
2925 } LDKErrorAction_LDKSendErrorMessage_Body;
2927 typedef struct MUST_USE_STRUCT LDKErrorAction {
2928 LDKErrorAction_Tag tag;
2930 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
2931 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
2936 * The information we received from a peer along the route of a payment we originated. This is
2937 * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
2938 * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
2940 typedef enum LDKHTLCFailChannelUpdate_Tag {
2942 * We received an error which included a full ChannelUpdate message.
2944 LDKHTLCFailChannelUpdate_ChannelUpdateMessage,
2946 * We received an error which indicated only that a channel has been closed
2948 LDKHTLCFailChannelUpdate_ChannelClosed,
2950 * We received an error which indicated only that a node has failed
2952 LDKHTLCFailChannelUpdate_NodeFailure,
2954 * Must be last for serialization purposes
2956 LDKHTLCFailChannelUpdate_Sentinel,
2957 } LDKHTLCFailChannelUpdate_Tag;
2959 typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body {
2961 * The unwrapped message we received
2963 struct LDKChannelUpdate msg;
2964 } LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
2966 typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
2968 * The short_channel_id which has now closed.
2970 uint64_t short_channel_id;
2972 * when this true, this channel should be permanently removed from the
2973 * consideration. Otherwise, this channel can be restored as new channel_update is received
2976 } LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
2978 typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
2980 * The node_id that has failed.
2982 struct LDKPublicKey node_id;
2984 * when this true, node should be permanently removed from the
2985 * consideration. Otherwise, the channels connected to this node can be
2986 * restored as new channel_update is received
2989 } LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
2991 typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate {
2992 LDKHTLCFailChannelUpdate_Tag tag;
2994 LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message;
2995 LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed;
2996 LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure;
2998 } LDKHTLCFailChannelUpdate;
3003 * A query_channel_range message is used to query a peer for channel
3004 * UTXOs in a range of blocks. The recipient of a query makes a best
3005 * effort to reply to the query using one or more reply_channel_range
3008 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
3010 * A pointer to the opaque Rust object.
3011 * Nearly everywhere, inner must be non-null, however in places where
3012 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3014 LDKnativeQueryChannelRange *inner;
3016 * Indicates that this is the only struct which contains the same pointer.
3017 * Rust functions which take ownership of an object provided via an argument require
3018 * this to be true and invalidate the object pointed to by inner.
3021 } LDKQueryChannelRange;
3026 * A query_short_channel_ids message is used to query a peer for
3027 * routing gossip messages related to one or more short_channel_ids.
3028 * The query recipient will reply with the latest, if available,
3029 * channel_announcement, channel_update and node_announcement messages
3030 * it maintains for the requested short_channel_ids followed by a
3031 * reply_short_channel_ids_end message. The short_channel_ids sent in
3032 * this query are encoded. We only support encoding_type=0 uncompressed
3033 * serialization and do not support encoding_type=1 zlib serialization.
3035 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
3037 * A pointer to the opaque Rust object.
3038 * Nearly everywhere, inner must be non-null, however in places where
3039 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3041 LDKnativeQueryShortChannelIds *inner;
3043 * Indicates that this is the only struct which contains the same pointer.
3044 * Rust functions which take ownership of an object provided via an argument require
3045 * this to be true and invalidate the object pointed to by inner.
3048 } LDKQueryShortChannelIds;
3053 * A reply_channel_range message is a reply to a query_channel_range
3054 * message. Multiple reply_channel_range messages can be sent in reply
3055 * to a single query_channel_range message. The query recipient makes a
3056 * best effort to respond based on their local network view which may
3057 * not be a perfect view of the network. The short_channel_ids in the
3058 * reply are encoded. We only support encoding_type=0 uncompressed
3059 * serialization and do not support encoding_type=1 zlib serialization.
3061 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
3063 * A pointer to the opaque Rust object.
3064 * Nearly everywhere, inner must be non-null, however in places where
3065 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3067 LDKnativeReplyChannelRange *inner;
3069 * Indicates that this is the only struct which contains the same pointer.
3070 * Rust functions which take ownership of an object provided via an argument require
3071 * this to be true and invalidate the object pointed to by inner.
3074 } LDKReplyChannelRange;
3077 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
3078 * broadcast to most peers).
3079 * These events are handled by PeerManager::process_events if you are using a PeerManager.
3081 typedef enum LDKMessageSendEvent_Tag {
3083 * Used to indicate that we've accepted a channel open and should send the accept_channel
3084 * message provided to the given peer.
3086 LDKMessageSendEvent_SendAcceptChannel,
3088 * Used to indicate that we've initiated a channel open and should send the open_channel
3089 * message provided to the given peer.
3091 LDKMessageSendEvent_SendOpenChannel,
3093 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
3095 LDKMessageSendEvent_SendFundingCreated,
3097 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
3099 LDKMessageSendEvent_SendFundingSigned,
3101 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
3103 LDKMessageSendEvent_SendFundingLocked,
3105 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
3107 LDKMessageSendEvent_SendAnnouncementSignatures,
3109 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
3110 * message should be sent to the peer with the given node_id.
3112 LDKMessageSendEvent_UpdateHTLCs,
3114 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
3116 LDKMessageSendEvent_SendRevokeAndACK,
3118 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
3120 LDKMessageSendEvent_SendClosingSigned,
3122 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
3124 LDKMessageSendEvent_SendShutdown,
3126 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
3128 LDKMessageSendEvent_SendChannelReestablish,
3130 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
3131 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
3133 * Note that after doing so, you very likely (unless you did so very recently) want to call
3134 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
3135 * This ensures that any nodes which see our channel_announcement also have a relevant
3136 * node_announcement, including relevant feature flags which may be important for routing
3139 LDKMessageSendEvent_BroadcastChannelAnnouncement,
3141 * Used to indicate that a node_announcement should be broadcast to all peers.
3143 LDKMessageSendEvent_BroadcastNodeAnnouncement,
3145 * Used to indicate that a channel_update should be broadcast to all peers.
3147 LDKMessageSendEvent_BroadcastChannelUpdate,
3149 * Broadcast an error downstream to be handled
3151 LDKMessageSendEvent_HandleError,
3153 * When a payment fails we may receive updates back from the hop where it failed. In such
3154 * cases this event is generated so that we can inform the network graph of this information.
3156 LDKMessageSendEvent_PaymentFailureNetworkUpdate,
3158 * Query a peer for channels with funding transaction UTXOs in a block range.
3160 LDKMessageSendEvent_SendChannelRangeQuery,
3162 * Request routing gossip messages from a peer for a list of channels identified by
3163 * their short_channel_ids.
3165 LDKMessageSendEvent_SendShortIdsQuery,
3167 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
3168 * emitted during processing of the query.
3170 LDKMessageSendEvent_SendReplyChannelRange,
3172 * Must be last for serialization purposes
3174 LDKMessageSendEvent_Sentinel,
3175 } LDKMessageSendEvent_Tag;
3177 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
3179 * The node_id of the node which should receive this message
3181 struct LDKPublicKey node_id;
3183 * The message which should be sent.
3185 struct LDKAcceptChannel msg;
3186 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
3188 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
3190 * The node_id of the node which should receive this message
3192 struct LDKPublicKey node_id;
3194 * The message which should be sent.
3196 struct LDKOpenChannel msg;
3197 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
3199 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
3201 * The node_id of the node which should receive this message
3203 struct LDKPublicKey node_id;
3205 * The message which should be sent.
3207 struct LDKFundingCreated msg;
3208 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
3210 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
3212 * The node_id of the node which should receive this message
3214 struct LDKPublicKey node_id;
3216 * The message which should be sent.
3218 struct LDKFundingSigned msg;
3219 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
3221 typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
3223 * The node_id of the node which should receive these message(s)
3225 struct LDKPublicKey node_id;
3227 * The funding_locked message which should be sent.
3229 struct LDKFundingLocked msg;
3230 } LDKMessageSendEvent_LDKSendFundingLocked_Body;
3232 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
3234 * The node_id of the node which should receive these message(s)
3236 struct LDKPublicKey node_id;
3238 * The announcement_signatures message which should be sent.
3240 struct LDKAnnouncementSignatures msg;
3241 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
3243 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
3245 * The node_id of the node which should receive these message(s)
3247 struct LDKPublicKey node_id;
3249 * The update messages which should be sent. ALL messages in the struct should be sent!
3251 struct LDKCommitmentUpdate updates;
3252 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
3254 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
3256 * The node_id of the node which should receive this message
3258 struct LDKPublicKey node_id;
3260 * The message which should be sent.
3262 struct LDKRevokeAndACK msg;
3263 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
3265 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
3267 * The node_id of the node which should receive this message
3269 struct LDKPublicKey node_id;
3271 * The message which should be sent.
3273 struct LDKClosingSigned msg;
3274 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
3276 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
3278 * The node_id of the node which should receive this message
3280 struct LDKPublicKey node_id;
3282 * The message which should be sent.
3284 struct LDKShutdown msg;
3285 } LDKMessageSendEvent_LDKSendShutdown_Body;
3287 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
3289 * The node_id of the node which should receive this message
3291 struct LDKPublicKey node_id;
3293 * The message which should be sent.
3295 struct LDKChannelReestablish msg;
3296 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
3298 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
3300 * The channel_announcement which should be sent.
3302 struct LDKChannelAnnouncement msg;
3304 * The followup channel_update which should be sent.
3306 struct LDKChannelUpdate update_msg;
3307 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
3309 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
3311 * The node_announcement which should be sent.
3313 struct LDKNodeAnnouncement msg;
3314 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
3316 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
3318 * The channel_update which should be sent.
3320 struct LDKChannelUpdate msg;
3321 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
3323 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
3325 * The node_id of the node which should receive this message
3327 struct LDKPublicKey node_id;
3329 * The action which should be taken.
3331 struct LDKErrorAction action;
3332 } LDKMessageSendEvent_LDKHandleError_Body;
3334 typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
3336 * The channel/node update which should be sent to NetGraphMsgHandler
3338 struct LDKHTLCFailChannelUpdate update;
3339 } LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
3341 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
3343 * The node_id of this message recipient
3345 struct LDKPublicKey node_id;
3347 * The query_channel_range which should be sent.
3349 struct LDKQueryChannelRange msg;
3350 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
3352 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
3354 * The node_id of this message recipient
3356 struct LDKPublicKey node_id;
3358 * The query_short_channel_ids which should be sent.
3360 struct LDKQueryShortChannelIds msg;
3361 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
3363 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
3365 * The node_id of this message recipient
3367 struct LDKPublicKey node_id;
3369 * The reply_channel_range which should be sent.
3371 struct LDKReplyChannelRange msg;
3372 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
3374 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
3375 LDKMessageSendEvent_Tag tag;
3377 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
3378 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
3379 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
3380 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
3381 LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
3382 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
3383 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
3384 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
3385 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
3386 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
3387 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
3388 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
3389 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
3390 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
3391 LDKMessageSendEvent_LDKHandleError_Body handle_error;
3392 LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update;
3393 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
3394 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
3395 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
3397 } LDKMessageSendEvent;
3400 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
3401 * This corresponds to std::vector in C++
3403 typedef struct LDKCVec_MessageSendEventZ {
3405 * The elements in the array.
3406 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3408 struct LDKMessageSendEvent *data;
3410 * The number of elements pointed to by `data`.
3413 } LDKCVec_MessageSendEventZ;
3416 * The contents of CResult_boolLightningErrorZ
3418 typedef union LDKCResult_boolLightningErrorZPtr {
3420 * A pointer to the contents in the success state.
3421 * Reading from this pointer when `result_ok` is not set is undefined.
3425 * A pointer to the contents in the error state.
3426 * Reading from this pointer when `result_ok` is set is undefined.
3428 struct LDKLightningError *err;
3429 } LDKCResult_boolLightningErrorZPtr;
3432 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
3433 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
3434 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3436 typedef struct LDKCResult_boolLightningErrorZ {
3438 * The contents of this CResult_boolLightningErrorZ, accessible via either
3439 * `err` or `result` depending on the state of `result_ok`.
3441 union LDKCResult_boolLightningErrorZPtr contents;
3443 * Whether this CResult_boolLightningErrorZ represents a success state.
3446 } LDKCResult_boolLightningErrorZ;
3449 * A tuple of 3 elements. See the individual fields for the types contained.
3451 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
3453 * The element at position 0
3455 struct LDKChannelAnnouncement a;
3457 * The element at position 1
3459 struct LDKChannelUpdate b;
3461 * The element at position 2
3463 struct LDKChannelUpdate c;
3464 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
3467 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
3468 * This corresponds to std::vector in C++
3470 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
3472 * The elements in the array.
3473 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3475 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
3477 * The number of elements pointed to by `data`.
3480 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
3483 * A dynamically-allocated array of crate::lightning::ln::msgs::NodeAnnouncements of arbitrary size.
3484 * This corresponds to std::vector in C++
3486 typedef struct LDKCVec_NodeAnnouncementZ {
3488 * The elements in the array.
3489 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3491 struct LDKNodeAnnouncement *data;
3493 * The number of elements pointed to by `data`.
3496 } LDKCVec_NodeAnnouncementZ;
3499 * The contents of CResult_NoneLightningErrorZ
3501 typedef union LDKCResult_NoneLightningErrorZPtr {
3503 * Note that this value is always NULL, as there are no contents in the OK variant
3507 * A pointer to the contents in the error state.
3508 * Reading from this pointer when `result_ok` is set is undefined.
3510 struct LDKLightningError *err;
3511 } LDKCResult_NoneLightningErrorZPtr;
3514 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
3515 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
3516 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3518 typedef struct LDKCResult_NoneLightningErrorZ {
3520 * The contents of this CResult_NoneLightningErrorZ, accessible via either
3521 * `err` or `result` depending on the state of `result_ok`.
3523 union LDKCResult_NoneLightningErrorZPtr contents;
3525 * Whether this CResult_NoneLightningErrorZ represents a success state.
3528 } LDKCResult_NoneLightningErrorZ;
3531 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
3532 * This corresponds to std::vector in C++
3534 typedef struct LDKCVec_PublicKeyZ {
3536 * The elements in the array.
3537 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3539 struct LDKPublicKey *data;
3541 * The number of elements pointed to by `data`.
3544 } LDKCVec_PublicKeyZ;
3549 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
3550 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
3553 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
3555 * A pointer to the opaque Rust object.
3556 * Nearly everywhere, inner must be non-null, however in places where
3557 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3559 LDKnativePeerHandleError *inner;
3561 * Indicates that this is the only struct which contains the same pointer.
3562 * Rust functions which take ownership of an object provided via an argument require
3563 * this to be true and invalidate the object pointed to by inner.
3566 } LDKPeerHandleError;
3569 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
3571 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
3573 * A pointer to the contents in the success state.
3574 * Reading from this pointer when `result_ok` is not set is undefined.
3576 struct LDKCVec_u8Z *result;
3578 * A pointer to the contents in the error state.
3579 * Reading from this pointer when `result_ok` is set is undefined.
3581 struct LDKPeerHandleError *err;
3582 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
3585 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
3586 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
3587 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3589 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
3591 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
3592 * `err` or `result` depending on the state of `result_ok`.
3594 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
3596 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
3599 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
3602 * The contents of CResult_NonePeerHandleErrorZ
3604 typedef union LDKCResult_NonePeerHandleErrorZPtr {
3606 * Note that this value is always NULL, as there are no contents in the OK variant
3610 * A pointer to the contents in the error state.
3611 * Reading from this pointer when `result_ok` is set is undefined.
3613 struct LDKPeerHandleError *err;
3614 } LDKCResult_NonePeerHandleErrorZPtr;
3617 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
3618 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
3619 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3621 typedef struct LDKCResult_NonePeerHandleErrorZ {
3623 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
3624 * `err` or `result` depending on the state of `result_ok`.
3626 union LDKCResult_NonePeerHandleErrorZPtr contents;
3628 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
3631 } LDKCResult_NonePeerHandleErrorZ;
3634 * The contents of CResult_boolPeerHandleErrorZ
3636 typedef union LDKCResult_boolPeerHandleErrorZPtr {
3638 * A pointer to the contents in the success state.
3639 * Reading from this pointer when `result_ok` is not set is undefined.
3643 * A pointer to the contents in the error state.
3644 * Reading from this pointer when `result_ok` is set is undefined.
3646 struct LDKPeerHandleError *err;
3647 } LDKCResult_boolPeerHandleErrorZPtr;
3650 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
3651 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
3652 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3654 typedef struct LDKCResult_boolPeerHandleErrorZ {
3656 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
3657 * `err` or `result` depending on the state of `result_ok`.
3659 union LDKCResult_boolPeerHandleErrorZPtr contents;
3661 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
3664 } LDKCResult_boolPeerHandleErrorZ;
3667 * The contents of CResult_TxOutAccessErrorZ
3669 typedef union LDKCResult_TxOutAccessErrorZPtr {
3671 * A pointer to the contents in the success state.
3672 * Reading from this pointer when `result_ok` is not set is undefined.
3674 struct LDKTxOut *result;
3676 * A pointer to the contents in the error state.
3677 * Reading from this pointer when `result_ok` is set is undefined.
3679 enum LDKAccessError *err;
3680 } LDKCResult_TxOutAccessErrorZPtr;
3683 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
3684 * containing a crate::c_types::TxOut on success and a crate::lightning::chain::AccessError on failure.
3685 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3687 typedef struct LDKCResult_TxOutAccessErrorZ {
3689 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
3690 * `err` or `result` depending on the state of `result_ok`.
3692 union LDKCResult_TxOutAccessErrorZPtr contents;
3694 * Whether this CResult_TxOutAccessErrorZ represents a success state.
3697 } LDKCResult_TxOutAccessErrorZ;
3700 * An enum which can either contain a crate::c_types::derived::C2Tuple_usizeTransactionZ or not
3702 typedef enum LDKCOption_C2Tuple_usizeTransactionZZ_Tag {
3704 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains a crate::c_types::derived::C2Tuple_usizeTransactionZ
3706 LDKCOption_C2Tuple_usizeTransactionZZ_Some,
3708 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains nothing
3710 LDKCOption_C2Tuple_usizeTransactionZZ_None,
3712 * Must be last for serialization purposes
3714 LDKCOption_C2Tuple_usizeTransactionZZ_Sentinel,
3715 } LDKCOption_C2Tuple_usizeTransactionZZ_Tag;
3717 typedef struct LDKCOption_C2Tuple_usizeTransactionZZ {
3718 LDKCOption_C2Tuple_usizeTransactionZZ_Tag tag;
3721 struct LDKC2Tuple_usizeTransactionZ some;
3724 } LDKCOption_C2Tuple_usizeTransactionZZ;
3729 * Details about one direction of a channel. Received
3730 * within a channel update.
3732 typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
3734 * A pointer to the opaque Rust object.
3735 * Nearly everywhere, inner must be non-null, however in places where
3736 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3738 LDKnativeDirectionalChannelInfo *inner;
3740 * Indicates that this is the only struct which contains the same pointer.
3741 * Rust functions which take ownership of an object provided via an argument require
3742 * this to be true and invalidate the object pointed to by inner.
3745 } LDKDirectionalChannelInfo;
3748 * The contents of CResult_DirectionalChannelInfoDecodeErrorZ
3750 typedef union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr {
3752 * A pointer to the contents in the success state.
3753 * Reading from this pointer when `result_ok` is not set is undefined.
3755 struct LDKDirectionalChannelInfo *result;
3757 * A pointer to the contents in the error state.
3758 * Reading from this pointer when `result_ok` is set is undefined.
3760 struct LDKDecodeError *err;
3761 } LDKCResult_DirectionalChannelInfoDecodeErrorZPtr;
3764 * A CResult_DirectionalChannelInfoDecodeErrorZ represents the result of a fallible operation,
3765 * containing a crate::lightning::routing::network_graph::DirectionalChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
3766 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3768 typedef struct LDKCResult_DirectionalChannelInfoDecodeErrorZ {
3770 * The contents of this CResult_DirectionalChannelInfoDecodeErrorZ, accessible via either
3771 * `err` or `result` depending on the state of `result_ok`.
3773 union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr contents;
3775 * Whether this CResult_DirectionalChannelInfoDecodeErrorZ represents a success state.
3778 } LDKCResult_DirectionalChannelInfoDecodeErrorZ;
3783 * Details about a channel (both directions).
3784 * Received within a channel announcement.
3786 typedef struct MUST_USE_STRUCT LDKChannelInfo {
3788 * A pointer to the opaque Rust object.
3789 * Nearly everywhere, inner must be non-null, however in places where
3790 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3792 LDKnativeChannelInfo *inner;
3794 * Indicates that this is the only struct which contains the same pointer.
3795 * Rust functions which take ownership of an object provided via an argument require
3796 * this to be true and invalidate the object pointed to by inner.
3802 * The contents of CResult_ChannelInfoDecodeErrorZ
3804 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
3806 * A pointer to the contents in the success state.
3807 * Reading from this pointer when `result_ok` is not set is undefined.
3809 struct LDKChannelInfo *result;
3811 * A pointer to the contents in the error state.
3812 * Reading from this pointer when `result_ok` is set is undefined.
3814 struct LDKDecodeError *err;
3815 } LDKCResult_ChannelInfoDecodeErrorZPtr;
3818 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
3819 * containing a crate::lightning::routing::network_graph::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
3820 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3822 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
3824 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
3825 * `err` or `result` depending on the state of `result_ok`.
3827 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
3829 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
3832 } LDKCResult_ChannelInfoDecodeErrorZ;
3837 * Fees for routing via a given channel or a node
3839 typedef struct MUST_USE_STRUCT LDKRoutingFees {
3841 * A pointer to the opaque Rust object.
3842 * Nearly everywhere, inner must be non-null, however in places where
3843 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3845 LDKnativeRoutingFees *inner;
3847 * Indicates that this is the only struct which contains the same pointer.
3848 * Rust functions which take ownership of an object provided via an argument require
3849 * this to be true and invalidate the object pointed to by inner.
3855 * The contents of CResult_RoutingFeesDecodeErrorZ
3857 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
3859 * A pointer to the contents in the success state.
3860 * Reading from this pointer when `result_ok` is not set is undefined.
3862 struct LDKRoutingFees *result;
3864 * A pointer to the contents in the error state.
3865 * Reading from this pointer when `result_ok` is set is undefined.
3867 struct LDKDecodeError *err;
3868 } LDKCResult_RoutingFeesDecodeErrorZPtr;
3871 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
3872 * containing a crate::lightning::routing::network_graph::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
3873 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3875 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
3877 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
3878 * `err` or `result` depending on the state of `result_ok`.
3880 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
3882 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
3885 } LDKCResult_RoutingFeesDecodeErrorZ;
3888 * A 4-byte byte array.
3890 typedef struct LDKFourBytes {
3898 * A 16-byte byte array.
3900 typedef struct LDKSixteenBytes {
3908 * A 10-byte byte array.
3910 typedef struct LDKTenBytes {
3918 * An address which can be used to connect to a remote peer
3920 typedef enum LDKNetAddress_Tag {
3922 * An IPv4 address/port on which the peer is listening.
3926 * An IPv6 address/port on which the peer is listening.
3930 * An old-style Tor onion address/port on which the peer is listening.
3932 LDKNetAddress_OnionV2,
3934 * A new-style Tor onion address/port on which the peer is listening.
3935 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
3936 * wrap as base32 and append \".onion\".
3938 LDKNetAddress_OnionV3,
3940 * Must be last for serialization purposes
3942 LDKNetAddress_Sentinel,
3943 } LDKNetAddress_Tag;
3945 typedef struct LDKNetAddress_LDKIPv4_Body {
3947 * The 4-byte IPv4 address
3949 struct LDKFourBytes addr;
3951 * The port on which the node is listening
3954 } LDKNetAddress_LDKIPv4_Body;
3956 typedef struct LDKNetAddress_LDKIPv6_Body {
3958 * The 16-byte IPv6 address
3960 struct LDKSixteenBytes addr;
3962 * The port on which the node is listening
3965 } LDKNetAddress_LDKIPv6_Body;
3967 typedef struct LDKNetAddress_LDKOnionV2_Body {
3969 * The bytes (usually encoded in base32 with \".onion\" appended)
3971 struct LDKTenBytes addr;
3973 * The port on which the node is listening
3976 } LDKNetAddress_LDKOnionV2_Body;
3978 typedef struct LDKNetAddress_LDKOnionV3_Body {
3980 * The ed25519 long-term public key of the peer
3982 struct LDKThirtyTwoBytes ed25519_pubkey;
3984 * The checksum of the pubkey and version, as included in the onion address
3988 * The version byte, as defined by the Tor Onion v3 spec.
3992 * The port on which the node is listening
3995 } LDKNetAddress_LDKOnionV3_Body;
3997 typedef struct MUST_USE_STRUCT LDKNetAddress {
3998 LDKNetAddress_Tag tag;
4000 LDKNetAddress_LDKIPv4_Body i_pv4;
4001 LDKNetAddress_LDKIPv6_Body i_pv6;
4002 LDKNetAddress_LDKOnionV2_Body onion_v2;
4003 LDKNetAddress_LDKOnionV3_Body onion_v3;
4008 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
4009 * This corresponds to std::vector in C++
4011 typedef struct LDKCVec_NetAddressZ {
4013 * The elements in the array.
4014 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4016 struct LDKNetAddress *data;
4018 * The number of elements pointed to by `data`.
4021 } LDKCVec_NetAddressZ;
4026 * Information received in the latest node_announcement from this node.
4028 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
4030 * A pointer to the opaque Rust object.
4031 * Nearly everywhere, inner must be non-null, however in places where
4032 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4034 LDKnativeNodeAnnouncementInfo *inner;
4036 * Indicates that this is the only struct which contains the same pointer.
4037 * Rust functions which take ownership of an object provided via an argument require
4038 * this to be true and invalidate the object pointed to by inner.
4041 } LDKNodeAnnouncementInfo;
4044 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
4046 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
4048 * A pointer to the contents in the success state.
4049 * Reading from this pointer when `result_ok` is not set is undefined.
4051 struct LDKNodeAnnouncementInfo *result;
4053 * A pointer to the contents in the error state.
4054 * Reading from this pointer when `result_ok` is set is undefined.
4056 struct LDKDecodeError *err;
4057 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
4060 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
4061 * containing a crate::lightning::routing::network_graph::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4062 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4064 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
4066 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
4067 * `err` or `result` depending on the state of `result_ok`.
4069 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
4071 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
4074 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
4077 * A dynamically-allocated array of u64s of arbitrary size.
4078 * This corresponds to std::vector in C++
4080 typedef struct LDKCVec_u64Z {
4082 * The elements in the array.
4083 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4087 * The number of elements pointed to by `data`.
4095 * Details about a node in the network, known from the network announcement.
4097 typedef struct MUST_USE_STRUCT LDKNodeInfo {
4099 * A pointer to the opaque Rust object.
4100 * Nearly everywhere, inner must be non-null, however in places where
4101 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4103 LDKnativeNodeInfo *inner;
4105 * Indicates that this is the only struct which contains the same pointer.
4106 * Rust functions which take ownership of an object provided via an argument require
4107 * this to be true and invalidate the object pointed to by inner.
4113 * The contents of CResult_NodeInfoDecodeErrorZ
4115 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
4117 * A pointer to the contents in the success state.
4118 * Reading from this pointer when `result_ok` is not set is undefined.
4120 struct LDKNodeInfo *result;
4122 * A pointer to the contents in the error state.
4123 * Reading from this pointer when `result_ok` is set is undefined.
4125 struct LDKDecodeError *err;
4126 } LDKCResult_NodeInfoDecodeErrorZPtr;
4129 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
4130 * containing a crate::lightning::routing::network_graph::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4131 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4133 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
4135 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
4136 * `err` or `result` depending on the state of `result_ok`.
4138 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
4140 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
4143 } LDKCResult_NodeInfoDecodeErrorZ;
4148 * Represents the network as nodes and channels between them
4150 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
4152 * A pointer to the opaque Rust object.
4153 * Nearly everywhere, inner must be non-null, however in places where
4154 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4156 LDKnativeNetworkGraph *inner;
4158 * Indicates that this is the only struct which contains the same pointer.
4159 * Rust functions which take ownership of an object provided via an argument require
4160 * this to be true and invalidate the object pointed to by inner.
4166 * The contents of CResult_NetworkGraphDecodeErrorZ
4168 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
4170 * A pointer to the contents in the success state.
4171 * Reading from this pointer when `result_ok` is not set is undefined.
4173 struct LDKNetworkGraph *result;
4175 * A pointer to the contents in the error state.
4176 * Reading from this pointer when `result_ok` is set is undefined.
4178 struct LDKDecodeError *err;
4179 } LDKCResult_NetworkGraphDecodeErrorZPtr;
4182 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
4183 * containing a crate::lightning::routing::network_graph::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
4184 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4186 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
4188 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
4189 * `err` or `result` depending on the state of `result_ok`.
4191 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
4193 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
4196 } LDKCResult_NetworkGraphDecodeErrorZ;
4201 * Features used within an `init` message.
4203 typedef struct MUST_USE_STRUCT LDKInitFeatures {
4205 * A pointer to the opaque Rust object.
4206 * Nearly everywhere, inner must be non-null, however in places where
4207 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4209 LDKnativeInitFeatures *inner;
4211 * Indicates that this is the only struct which contains the same pointer.
4212 * Rust functions which take ownership of an object provided via an argument require
4213 * this to be true and invalidate the object pointed to by inner.
4219 * The contents of CResult_InitFeaturesDecodeErrorZ
4221 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
4223 * A pointer to the contents in the success state.
4224 * Reading from this pointer when `result_ok` is not set is undefined.
4226 struct LDKInitFeatures *result;
4228 * A pointer to the contents in the error state.
4229 * Reading from this pointer when `result_ok` is set is undefined.
4231 struct LDKDecodeError *err;
4232 } LDKCResult_InitFeaturesDecodeErrorZPtr;
4235 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
4236 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4237 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4239 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
4241 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
4242 * `err` or `result` depending on the state of `result_ok`.
4244 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
4246 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
4249 } LDKCResult_InitFeaturesDecodeErrorZ;
4254 * Features used within a `node_announcement` message.
4256 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
4258 * A pointer to the opaque Rust object.
4259 * Nearly everywhere, inner must be non-null, however in places where
4260 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4262 LDKnativeNodeFeatures *inner;
4264 * Indicates that this is the only struct which contains the same pointer.
4265 * Rust functions which take ownership of an object provided via an argument require
4266 * this to be true and invalidate the object pointed to by inner.
4272 * The contents of CResult_NodeFeaturesDecodeErrorZ
4274 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
4276 * A pointer to the contents in the success state.
4277 * Reading from this pointer when `result_ok` is not set is undefined.
4279 struct LDKNodeFeatures *result;
4281 * A pointer to the contents in the error state.
4282 * Reading from this pointer when `result_ok` is set is undefined.
4284 struct LDKDecodeError *err;
4285 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
4288 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
4289 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4290 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4292 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
4294 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
4295 * `err` or `result` depending on the state of `result_ok`.
4297 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
4299 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
4302 } LDKCResult_NodeFeaturesDecodeErrorZ;
4307 * Features used within a `channel_announcement` message.
4309 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
4311 * A pointer to the opaque Rust object.
4312 * Nearly everywhere, inner must be non-null, however in places where
4313 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4315 LDKnativeChannelFeatures *inner;
4317 * Indicates that this is the only struct which contains the same pointer.
4318 * Rust functions which take ownership of an object provided via an argument require
4319 * this to be true and invalidate the object pointed to by inner.
4322 } LDKChannelFeatures;
4325 * The contents of CResult_ChannelFeaturesDecodeErrorZ
4327 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
4329 * A pointer to the contents in the success state.
4330 * Reading from this pointer when `result_ok` is not set is undefined.
4332 struct LDKChannelFeatures *result;
4334 * A pointer to the contents in the error state.
4335 * Reading from this pointer when `result_ok` is set is undefined.
4337 struct LDKDecodeError *err;
4338 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
4341 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
4342 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4343 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4345 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
4347 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
4348 * `err` or `result` depending on the state of `result_ok`.
4350 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
4352 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
4355 } LDKCResult_ChannelFeaturesDecodeErrorZ;
4360 * Features used within an invoice.
4362 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
4364 * A pointer to the opaque Rust object.
4365 * Nearly everywhere, inner must be non-null, however in places where
4366 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4368 LDKnativeInvoiceFeatures *inner;
4370 * Indicates that this is the only struct which contains the same pointer.
4371 * Rust functions which take ownership of an object provided via an argument require
4372 * this to be true and invalidate the object pointed to by inner.
4375 } LDKInvoiceFeatures;
4378 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
4380 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
4382 * A pointer to the contents in the success state.
4383 * Reading from this pointer when `result_ok` is not set is undefined.
4385 struct LDKInvoiceFeatures *result;
4387 * A pointer to the contents in the error state.
4388 * Reading from this pointer when `result_ok` is set is undefined.
4390 struct LDKDecodeError *err;
4391 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
4394 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
4395 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4396 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4398 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
4400 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
4401 * `err` or `result` depending on the state of `result_ok`.
4403 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
4405 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
4408 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
4411 * The contents of CResult_NetAddressu8Z
4413 typedef union LDKCResult_NetAddressu8ZPtr {
4415 * A pointer to the contents in the success state.
4416 * Reading from this pointer when `result_ok` is not set is undefined.
4418 struct LDKNetAddress *result;
4420 * A pointer to the contents in the error state.
4421 * Reading from this pointer when `result_ok` is set is undefined.
4424 } LDKCResult_NetAddressu8ZPtr;
4427 * A CResult_NetAddressu8Z represents the result of a fallible operation,
4428 * containing a crate::lightning::ln::msgs::NetAddress on success and a u8 on failure.
4429 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4431 typedef struct LDKCResult_NetAddressu8Z {
4433 * The contents of this CResult_NetAddressu8Z, accessible via either
4434 * `err` or `result` depending on the state of `result_ok`.
4436 union LDKCResult_NetAddressu8ZPtr contents;
4438 * Whether this CResult_NetAddressu8Z represents a success state.
4441 } LDKCResult_NetAddressu8Z;
4444 * The contents of CResult_CResult_NetAddressu8ZDecodeErrorZ
4446 typedef union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr {
4448 * A pointer to the contents in the success state.
4449 * Reading from this pointer when `result_ok` is not set is undefined.
4451 struct LDKCResult_NetAddressu8Z *result;
4453 * A pointer to the contents in the error state.
4454 * Reading from this pointer when `result_ok` is set is undefined.
4456 struct LDKDecodeError *err;
4457 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr;
4460 * A CResult_CResult_NetAddressu8ZDecodeErrorZ represents the result of a fallible operation,
4461 * containing a crate::c_types::derived::CResult_NetAddressu8Z on success and a crate::lightning::ln::msgs::DecodeError on failure.
4462 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4464 typedef struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ {
4466 * The contents of this CResult_CResult_NetAddressu8ZDecodeErrorZ, accessible via either
4467 * `err` or `result` depending on the state of `result_ok`.
4469 union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr contents;
4471 * Whether this CResult_CResult_NetAddressu8ZDecodeErrorZ represents a success state.
4474 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZ;
4479 * An update_add_htlc message to be sent or received from a peer
4481 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
4483 * A pointer to the opaque Rust object.
4484 * Nearly everywhere, inner must be non-null, however in places where
4485 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4487 LDKnativeUpdateAddHTLC *inner;
4489 * Indicates that this is the only struct which contains the same pointer.
4490 * Rust functions which take ownership of an object provided via an argument require
4491 * this to be true and invalidate the object pointed to by inner.
4497 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
4498 * This corresponds to std::vector in C++
4500 typedef struct LDKCVec_UpdateAddHTLCZ {
4502 * The elements in the array.
4503 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4505 struct LDKUpdateAddHTLC *data;
4507 * The number of elements pointed to by `data`.
4510 } LDKCVec_UpdateAddHTLCZ;
4515 * An update_fulfill_htlc message to be sent or received from a peer
4517 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
4519 * A pointer to the opaque Rust object.
4520 * Nearly everywhere, inner must be non-null, however in places where
4521 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4523 LDKnativeUpdateFulfillHTLC *inner;
4525 * Indicates that this is the only struct which contains the same pointer.
4526 * Rust functions which take ownership of an object provided via an argument require
4527 * this to be true and invalidate the object pointed to by inner.
4530 } LDKUpdateFulfillHTLC;
4533 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
4534 * This corresponds to std::vector in C++
4536 typedef struct LDKCVec_UpdateFulfillHTLCZ {
4538 * The elements in the array.
4539 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4541 struct LDKUpdateFulfillHTLC *data;
4543 * The number of elements pointed to by `data`.
4546 } LDKCVec_UpdateFulfillHTLCZ;
4551 * An update_fail_htlc message to be sent or received from a peer
4553 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
4555 * A pointer to the opaque Rust object.
4556 * Nearly everywhere, inner must be non-null, however in places where
4557 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4559 LDKnativeUpdateFailHTLC *inner;
4561 * Indicates that this is the only struct which contains the same pointer.
4562 * Rust functions which take ownership of an object provided via an argument require
4563 * this to be true and invalidate the object pointed to by inner.
4566 } LDKUpdateFailHTLC;
4569 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
4570 * This corresponds to std::vector in C++
4572 typedef struct LDKCVec_UpdateFailHTLCZ {
4574 * The elements in the array.
4575 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4577 struct LDKUpdateFailHTLC *data;
4579 * The number of elements pointed to by `data`.
4582 } LDKCVec_UpdateFailHTLCZ;
4587 * An update_fail_malformed_htlc message to be sent or received from a peer
4589 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
4591 * A pointer to the opaque Rust object.
4592 * Nearly everywhere, inner must be non-null, however in places where
4593 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4595 LDKnativeUpdateFailMalformedHTLC *inner;
4597 * Indicates that this is the only struct which contains the same pointer.
4598 * Rust functions which take ownership of an object provided via an argument require
4599 * this to be true and invalidate the object pointed to by inner.
4602 } LDKUpdateFailMalformedHTLC;
4605 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
4606 * This corresponds to std::vector in C++
4608 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
4610 * The elements in the array.
4611 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4613 struct LDKUpdateFailMalformedHTLC *data;
4615 * The number of elements pointed to by `data`.
4618 } LDKCVec_UpdateFailMalformedHTLCZ;
4621 * The contents of CResult_AcceptChannelDecodeErrorZ
4623 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
4625 * A pointer to the contents in the success state.
4626 * Reading from this pointer when `result_ok` is not set is undefined.
4628 struct LDKAcceptChannel *result;
4630 * A pointer to the contents in the error state.
4631 * Reading from this pointer when `result_ok` is set is undefined.
4633 struct LDKDecodeError *err;
4634 } LDKCResult_AcceptChannelDecodeErrorZPtr;
4637 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
4638 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
4639 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4641 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
4643 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
4644 * `err` or `result` depending on the state of `result_ok`.
4646 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
4648 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
4651 } LDKCResult_AcceptChannelDecodeErrorZ;
4654 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
4656 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
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 LDKAnnouncementSignatures *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_AnnouncementSignaturesDecodeErrorZPtr;
4670 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
4671 * containing a crate::lightning::ln::msgs::AnnouncementSignatures 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_AnnouncementSignaturesDecodeErrorZ {
4676 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
4677 * `err` or `result` depending on the state of `result_ok`.
4679 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
4681 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
4684 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
4687 * The contents of CResult_ChannelReestablishDecodeErrorZ
4689 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
4691 * A pointer to the contents in the success state.
4692 * Reading from this pointer when `result_ok` is not set is undefined.
4694 struct LDKChannelReestablish *result;
4696 * A pointer to the contents in the error state.
4697 * Reading from this pointer when `result_ok` is set is undefined.
4699 struct LDKDecodeError *err;
4700 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
4703 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
4704 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
4705 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4707 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
4709 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
4710 * `err` or `result` depending on the state of `result_ok`.
4712 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
4714 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
4717 } LDKCResult_ChannelReestablishDecodeErrorZ;
4720 * The contents of CResult_ClosingSignedDecodeErrorZ
4722 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
4724 * A pointer to the contents in the success state.
4725 * Reading from this pointer when `result_ok` is not set is undefined.
4727 struct LDKClosingSigned *result;
4729 * A pointer to the contents in the error state.
4730 * Reading from this pointer when `result_ok` is set is undefined.
4732 struct LDKDecodeError *err;
4733 } LDKCResult_ClosingSignedDecodeErrorZPtr;
4736 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
4737 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
4738 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4740 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
4742 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
4743 * `err` or `result` depending on the state of `result_ok`.
4745 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
4747 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
4750 } LDKCResult_ClosingSignedDecodeErrorZ;
4755 * A commitment_signed message to be sent or received from a peer
4757 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
4759 * A pointer to the opaque Rust object.
4760 * Nearly everywhere, inner must be non-null, however in places where
4761 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4763 LDKnativeCommitmentSigned *inner;
4765 * Indicates that this is the only struct which contains the same pointer.
4766 * Rust functions which take ownership of an object provided via an argument require
4767 * this to be true and invalidate the object pointed to by inner.
4770 } LDKCommitmentSigned;
4773 * The contents of CResult_CommitmentSignedDecodeErrorZ
4775 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
4777 * A pointer to the contents in the success state.
4778 * Reading from this pointer when `result_ok` is not set is undefined.
4780 struct LDKCommitmentSigned *result;
4782 * A pointer to the contents in the error state.
4783 * Reading from this pointer when `result_ok` is set is undefined.
4785 struct LDKDecodeError *err;
4786 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
4789 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
4790 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
4791 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4793 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
4795 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
4796 * `err` or `result` depending on the state of `result_ok`.
4798 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
4800 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
4803 } LDKCResult_CommitmentSignedDecodeErrorZ;
4806 * The contents of CResult_FundingCreatedDecodeErrorZ
4808 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
4810 * A pointer to the contents in the success state.
4811 * Reading from this pointer when `result_ok` is not set is undefined.
4813 struct LDKFundingCreated *result;
4815 * A pointer to the contents in the error state.
4816 * Reading from this pointer when `result_ok` is set is undefined.
4818 struct LDKDecodeError *err;
4819 } LDKCResult_FundingCreatedDecodeErrorZPtr;
4822 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
4823 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
4824 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4826 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
4828 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
4829 * `err` or `result` depending on the state of `result_ok`.
4831 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
4833 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
4836 } LDKCResult_FundingCreatedDecodeErrorZ;
4839 * The contents of CResult_FundingSignedDecodeErrorZ
4841 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
4843 * A pointer to the contents in the success state.
4844 * Reading from this pointer when `result_ok` is not set is undefined.
4846 struct LDKFundingSigned *result;
4848 * A pointer to the contents in the error state.
4849 * Reading from this pointer when `result_ok` is set is undefined.
4851 struct LDKDecodeError *err;
4852 } LDKCResult_FundingSignedDecodeErrorZPtr;
4855 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
4856 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
4857 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4859 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
4861 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
4862 * `err` or `result` depending on the state of `result_ok`.
4864 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
4866 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
4869 } LDKCResult_FundingSignedDecodeErrorZ;
4872 * The contents of CResult_FundingLockedDecodeErrorZ
4874 typedef union LDKCResult_FundingLockedDecodeErrorZPtr {
4876 * A pointer to the contents in the success state.
4877 * Reading from this pointer when `result_ok` is not set is undefined.
4879 struct LDKFundingLocked *result;
4881 * A pointer to the contents in the error state.
4882 * Reading from this pointer when `result_ok` is set is undefined.
4884 struct LDKDecodeError *err;
4885 } LDKCResult_FundingLockedDecodeErrorZPtr;
4888 * A CResult_FundingLockedDecodeErrorZ represents the result of a fallible operation,
4889 * containing a crate::lightning::ln::msgs::FundingLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
4890 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4892 typedef struct LDKCResult_FundingLockedDecodeErrorZ {
4894 * The contents of this CResult_FundingLockedDecodeErrorZ, accessible via either
4895 * `err` or `result` depending on the state of `result_ok`.
4897 union LDKCResult_FundingLockedDecodeErrorZPtr contents;
4899 * Whether this CResult_FundingLockedDecodeErrorZ represents a success state.
4902 } LDKCResult_FundingLockedDecodeErrorZ;
4907 * An init message to be sent or received from a peer
4909 typedef struct MUST_USE_STRUCT LDKInit {
4911 * A pointer to the opaque Rust object.
4912 * Nearly everywhere, inner must be non-null, however in places where
4913 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4915 LDKnativeInit *inner;
4917 * Indicates that this is the only struct which contains the same pointer.
4918 * Rust functions which take ownership of an object provided via an argument require
4919 * this to be true and invalidate the object pointed to by inner.
4925 * The contents of CResult_InitDecodeErrorZ
4927 typedef union LDKCResult_InitDecodeErrorZPtr {
4929 * A pointer to the contents in the success state.
4930 * Reading from this pointer when `result_ok` is not set is undefined.
4932 struct LDKInit *result;
4934 * A pointer to the contents in the error state.
4935 * Reading from this pointer when `result_ok` is set is undefined.
4937 struct LDKDecodeError *err;
4938 } LDKCResult_InitDecodeErrorZPtr;
4941 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
4942 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
4943 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4945 typedef struct LDKCResult_InitDecodeErrorZ {
4947 * The contents of this CResult_InitDecodeErrorZ, accessible via either
4948 * `err` or `result` depending on the state of `result_ok`.
4950 union LDKCResult_InitDecodeErrorZPtr contents;
4952 * Whether this CResult_InitDecodeErrorZ represents a success state.
4955 } LDKCResult_InitDecodeErrorZ;
4958 * The contents of CResult_OpenChannelDecodeErrorZ
4960 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
4962 * A pointer to the contents in the success state.
4963 * Reading from this pointer when `result_ok` is not set is undefined.
4965 struct LDKOpenChannel *result;
4967 * A pointer to the contents in the error state.
4968 * Reading from this pointer when `result_ok` is set is undefined.
4970 struct LDKDecodeError *err;
4971 } LDKCResult_OpenChannelDecodeErrorZPtr;
4974 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
4975 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
4976 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4978 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
4980 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
4981 * `err` or `result` depending on the state of `result_ok`.
4983 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
4985 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
4988 } LDKCResult_OpenChannelDecodeErrorZ;
4991 * The contents of CResult_RevokeAndACKDecodeErrorZ
4993 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
4995 * A pointer to the contents in the success state.
4996 * Reading from this pointer when `result_ok` is not set is undefined.
4998 struct LDKRevokeAndACK *result;
5000 * A pointer to the contents in the error state.
5001 * Reading from this pointer when `result_ok` is set is undefined.
5003 struct LDKDecodeError *err;
5004 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
5007 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
5008 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
5009 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5011 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
5013 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
5014 * `err` or `result` depending on the state of `result_ok`.
5016 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
5018 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
5021 } LDKCResult_RevokeAndACKDecodeErrorZ;
5024 * The contents of CResult_ShutdownDecodeErrorZ
5026 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
5028 * A pointer to the contents in the success state.
5029 * Reading from this pointer when `result_ok` is not set is undefined.
5031 struct LDKShutdown *result;
5033 * A pointer to the contents in the error state.
5034 * Reading from this pointer when `result_ok` is set is undefined.
5036 struct LDKDecodeError *err;
5037 } LDKCResult_ShutdownDecodeErrorZPtr;
5040 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
5041 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
5042 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5044 typedef struct LDKCResult_ShutdownDecodeErrorZ {
5046 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
5047 * `err` or `result` depending on the state of `result_ok`.
5049 union LDKCResult_ShutdownDecodeErrorZPtr contents;
5051 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
5054 } LDKCResult_ShutdownDecodeErrorZ;
5057 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
5059 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
5061 * A pointer to the contents in the success state.
5062 * Reading from this pointer when `result_ok` is not set is undefined.
5064 struct LDKUpdateFailHTLC *result;
5066 * A pointer to the contents in the error state.
5067 * Reading from this pointer when `result_ok` is set is undefined.
5069 struct LDKDecodeError *err;
5070 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
5073 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
5074 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5075 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5077 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
5079 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
5080 * `err` or `result` depending on the state of `result_ok`.
5082 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
5084 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
5087 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
5090 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
5092 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5094 * A pointer to the contents in the success state.
5095 * Reading from this pointer when `result_ok` is not set is undefined.
5097 struct LDKUpdateFailMalformedHTLC *result;
5099 * A pointer to the contents in the error state.
5100 * Reading from this pointer when `result_ok` is set is undefined.
5102 struct LDKDecodeError *err;
5103 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
5106 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
5107 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5108 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5110 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
5112 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
5113 * `err` or `result` depending on the state of `result_ok`.
5115 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
5117 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
5120 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
5125 * An update_fee message to be sent or received from a peer
5127 typedef struct MUST_USE_STRUCT LDKUpdateFee {
5129 * A pointer to the opaque Rust object.
5130 * Nearly everywhere, inner must be non-null, however in places where
5131 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5133 LDKnativeUpdateFee *inner;
5135 * Indicates that this is the only struct which contains the same pointer.
5136 * Rust functions which take ownership of an object provided via an argument require
5137 * this to be true and invalidate the object pointed to by inner.
5143 * The contents of CResult_UpdateFeeDecodeErrorZ
5145 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
5147 * A pointer to the contents in the success state.
5148 * Reading from this pointer when `result_ok` is not set is undefined.
5150 struct LDKUpdateFee *result;
5152 * A pointer to the contents in the error state.
5153 * Reading from this pointer when `result_ok` is set is undefined.
5155 struct LDKDecodeError *err;
5156 } LDKCResult_UpdateFeeDecodeErrorZPtr;
5159 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
5160 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
5161 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5163 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
5165 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
5166 * `err` or `result` depending on the state of `result_ok`.
5168 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
5170 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
5173 } LDKCResult_UpdateFeeDecodeErrorZ;
5176 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
5178 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
5180 * A pointer to the contents in the success state.
5181 * Reading from this pointer when `result_ok` is not set is undefined.
5183 struct LDKUpdateFulfillHTLC *result;
5185 * A pointer to the contents in the error state.
5186 * Reading from this pointer when `result_ok` is set is undefined.
5188 struct LDKDecodeError *err;
5189 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
5192 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
5193 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5194 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5196 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
5198 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
5199 * `err` or `result` depending on the state of `result_ok`.
5201 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
5203 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
5206 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
5209 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
5211 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
5213 * A pointer to the contents in the success state.
5214 * Reading from this pointer when `result_ok` is not set is undefined.
5216 struct LDKUpdateAddHTLC *result;
5218 * A pointer to the contents in the error state.
5219 * Reading from this pointer when `result_ok` is set is undefined.
5221 struct LDKDecodeError *err;
5222 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
5225 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
5226 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5227 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5229 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
5231 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
5232 * `err` or `result` depending on the state of `result_ok`.
5234 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
5236 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
5239 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
5244 * A ping message to be sent or received from a peer
5246 typedef struct MUST_USE_STRUCT LDKPing {
5248 * A pointer to the opaque Rust object.
5249 * Nearly everywhere, inner must be non-null, however in places where
5250 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5252 LDKnativePing *inner;
5254 * Indicates that this is the only struct which contains the same pointer.
5255 * Rust functions which take ownership of an object provided via an argument require
5256 * this to be true and invalidate the object pointed to by inner.
5262 * The contents of CResult_PingDecodeErrorZ
5264 typedef union LDKCResult_PingDecodeErrorZPtr {
5266 * A pointer to the contents in the success state.
5267 * Reading from this pointer when `result_ok` is not set is undefined.
5269 struct LDKPing *result;
5271 * A pointer to the contents in the error state.
5272 * Reading from this pointer when `result_ok` is set is undefined.
5274 struct LDKDecodeError *err;
5275 } LDKCResult_PingDecodeErrorZPtr;
5278 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
5279 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
5280 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5282 typedef struct LDKCResult_PingDecodeErrorZ {
5284 * The contents of this CResult_PingDecodeErrorZ, accessible via either
5285 * `err` or `result` depending on the state of `result_ok`.
5287 union LDKCResult_PingDecodeErrorZPtr contents;
5289 * Whether this CResult_PingDecodeErrorZ represents a success state.
5292 } LDKCResult_PingDecodeErrorZ;
5297 * A pong message to be sent or received from a peer
5299 typedef struct MUST_USE_STRUCT LDKPong {
5301 * A pointer to the opaque Rust object.
5302 * Nearly everywhere, inner must be non-null, however in places where
5303 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5305 LDKnativePong *inner;
5307 * Indicates that this is the only struct which contains the same pointer.
5308 * Rust functions which take ownership of an object provided via an argument require
5309 * this to be true and invalidate the object pointed to by inner.
5315 * The contents of CResult_PongDecodeErrorZ
5317 typedef union LDKCResult_PongDecodeErrorZPtr {
5319 * A pointer to the contents in the success state.
5320 * Reading from this pointer when `result_ok` is not set is undefined.
5322 struct LDKPong *result;
5324 * A pointer to the contents in the error state.
5325 * Reading from this pointer when `result_ok` is set is undefined.
5327 struct LDKDecodeError *err;
5328 } LDKCResult_PongDecodeErrorZPtr;
5331 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
5332 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
5333 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5335 typedef struct LDKCResult_PongDecodeErrorZ {
5337 * The contents of this CResult_PongDecodeErrorZ, accessible via either
5338 * `err` or `result` depending on the state of `result_ok`.
5340 union LDKCResult_PongDecodeErrorZPtr contents;
5342 * Whether this CResult_PongDecodeErrorZ represents a success state.
5345 } LDKCResult_PongDecodeErrorZ;
5348 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
5350 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
5352 * A pointer to the contents in the success state.
5353 * Reading from this pointer when `result_ok` is not set is undefined.
5355 struct LDKUnsignedChannelAnnouncement *result;
5357 * A pointer to the contents in the error state.
5358 * Reading from this pointer when `result_ok` is set is undefined.
5360 struct LDKDecodeError *err;
5361 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
5364 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
5365 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
5366 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5368 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
5370 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
5371 * `err` or `result` depending on the state of `result_ok`.
5373 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
5375 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
5378 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
5381 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
5383 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
5385 * A pointer to the contents in the success state.
5386 * Reading from this pointer when `result_ok` is not set is undefined.
5388 struct LDKChannelAnnouncement *result;
5390 * A pointer to the contents in the error state.
5391 * Reading from this pointer when `result_ok` is set is undefined.
5393 struct LDKDecodeError *err;
5394 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
5397 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
5398 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
5399 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5401 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
5403 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
5404 * `err` or `result` depending on the state of `result_ok`.
5406 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
5408 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
5411 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
5416 * The unsigned part of a channel_update
5418 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
5420 * A pointer to the opaque Rust object.
5421 * Nearly everywhere, inner must be non-null, however in places where
5422 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5424 LDKnativeUnsignedChannelUpdate *inner;
5426 * Indicates that this is the only struct which contains the same pointer.
5427 * Rust functions which take ownership of an object provided via an argument require
5428 * this to be true and invalidate the object pointed to by inner.
5431 } LDKUnsignedChannelUpdate;
5434 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
5436 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
5438 * A pointer to the contents in the success state.
5439 * Reading from this pointer when `result_ok` is not set is undefined.
5441 struct LDKUnsignedChannelUpdate *result;
5443 * A pointer to the contents in the error state.
5444 * Reading from this pointer when `result_ok` is set is undefined.
5446 struct LDKDecodeError *err;
5447 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
5450 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
5451 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
5452 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5454 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
5456 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
5457 * `err` or `result` depending on the state of `result_ok`.
5459 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
5461 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
5464 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
5467 * The contents of CResult_ChannelUpdateDecodeErrorZ
5469 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
5471 * A pointer to the contents in the success state.
5472 * Reading from this pointer when `result_ok` is not set is undefined.
5474 struct LDKChannelUpdate *result;
5476 * A pointer to the contents in the error state.
5477 * Reading from this pointer when `result_ok` is set is undefined.
5479 struct LDKDecodeError *err;
5480 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
5483 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
5484 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
5485 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5487 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
5489 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
5490 * `err` or `result` depending on the state of `result_ok`.
5492 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
5494 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
5497 } LDKCResult_ChannelUpdateDecodeErrorZ;
5500 * The contents of CResult_ErrorMessageDecodeErrorZ
5502 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
5504 * A pointer to the contents in the success state.
5505 * Reading from this pointer when `result_ok` is not set is undefined.
5507 struct LDKErrorMessage *result;
5509 * A pointer to the contents in the error state.
5510 * Reading from this pointer when `result_ok` is set is undefined.
5512 struct LDKDecodeError *err;
5513 } LDKCResult_ErrorMessageDecodeErrorZPtr;
5516 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
5517 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
5518 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5520 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
5522 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
5523 * `err` or `result` depending on the state of `result_ok`.
5525 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
5527 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
5530 } LDKCResult_ErrorMessageDecodeErrorZ;
5535 * The unsigned part of a node_announcement
5537 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
5539 * A pointer to the opaque Rust object.
5540 * Nearly everywhere, inner must be non-null, however in places where
5541 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5543 LDKnativeUnsignedNodeAnnouncement *inner;
5545 * Indicates that this is the only struct which contains the same pointer.
5546 * Rust functions which take ownership of an object provided via an argument require
5547 * this to be true and invalidate the object pointed to by inner.
5550 } LDKUnsignedNodeAnnouncement;
5553 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
5555 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
5557 * A pointer to the contents in the success state.
5558 * Reading from this pointer when `result_ok` is not set is undefined.
5560 struct LDKUnsignedNodeAnnouncement *result;
5562 * A pointer to the contents in the error state.
5563 * Reading from this pointer when `result_ok` is set is undefined.
5565 struct LDKDecodeError *err;
5566 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
5569 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
5570 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
5571 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5573 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
5575 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
5576 * `err` or `result` depending on the state of `result_ok`.
5578 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
5580 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
5583 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
5586 * The contents of CResult_NodeAnnouncementDecodeErrorZ
5588 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
5590 * A pointer to the contents in the success state.
5591 * Reading from this pointer when `result_ok` is not set is undefined.
5593 struct LDKNodeAnnouncement *result;
5595 * A pointer to the contents in the error state.
5596 * Reading from this pointer when `result_ok` is set is undefined.
5598 struct LDKDecodeError *err;
5599 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
5602 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
5603 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
5604 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5606 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
5608 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
5609 * `err` or `result` depending on the state of `result_ok`.
5611 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
5613 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
5616 } LDKCResult_NodeAnnouncementDecodeErrorZ;
5619 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
5621 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
5623 * A pointer to the contents in the success state.
5624 * Reading from this pointer when `result_ok` is not set is undefined.
5626 struct LDKQueryShortChannelIds *result;
5628 * A pointer to the contents in the error state.
5629 * Reading from this pointer when `result_ok` is set is undefined.
5631 struct LDKDecodeError *err;
5632 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
5635 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
5636 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
5637 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5639 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
5641 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
5642 * `err` or `result` depending on the state of `result_ok`.
5644 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
5646 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
5649 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
5654 * A reply_short_channel_ids_end message is sent as a reply to a
5655 * query_short_channel_ids message. The query recipient makes a best
5656 * effort to respond based on their local network view which may not be
5657 * a perfect view of the network.
5659 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
5661 * A pointer to the opaque Rust object.
5662 * Nearly everywhere, inner must be non-null, however in places where
5663 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5665 LDKnativeReplyShortChannelIdsEnd *inner;
5667 * Indicates that this is the only struct which contains the same pointer.
5668 * Rust functions which take ownership of an object provided via an argument require
5669 * this to be true and invalidate the object pointed to by inner.
5672 } LDKReplyShortChannelIdsEnd;
5675 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
5677 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
5679 * A pointer to the contents in the success state.
5680 * Reading from this pointer when `result_ok` is not set is undefined.
5682 struct LDKReplyShortChannelIdsEnd *result;
5684 * A pointer to the contents in the error state.
5685 * Reading from this pointer when `result_ok` is set is undefined.
5687 struct LDKDecodeError *err;
5688 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
5691 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
5692 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
5693 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5695 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
5697 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
5698 * `err` or `result` depending on the state of `result_ok`.
5700 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
5702 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
5705 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
5708 * The contents of CResult_QueryChannelRangeDecodeErrorZ
5710 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
5712 * A pointer to the contents in the success state.
5713 * Reading from this pointer when `result_ok` is not set is undefined.
5715 struct LDKQueryChannelRange *result;
5717 * A pointer to the contents in the error state.
5718 * Reading from this pointer when `result_ok` is set is undefined.
5720 struct LDKDecodeError *err;
5721 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
5724 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
5725 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
5726 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5728 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
5730 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
5731 * `err` or `result` depending on the state of `result_ok`.
5733 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
5735 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
5738 } LDKCResult_QueryChannelRangeDecodeErrorZ;
5741 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
5743 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
5745 * A pointer to the contents in the success state.
5746 * Reading from this pointer when `result_ok` is not set is undefined.
5748 struct LDKReplyChannelRange *result;
5750 * A pointer to the contents in the error state.
5751 * Reading from this pointer when `result_ok` is set is undefined.
5753 struct LDKDecodeError *err;
5754 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
5757 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
5758 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
5759 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5761 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
5763 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
5764 * `err` or `result` depending on the state of `result_ok`.
5766 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
5768 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
5771 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
5776 * A gossip_timestamp_filter message is used by a node to request
5777 * gossip relay for messages in the requested time range when the
5778 * gossip_queries feature has been negotiated.
5780 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
5782 * A pointer to the opaque Rust object.
5783 * Nearly everywhere, inner must be non-null, however in places where
5784 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5786 LDKnativeGossipTimestampFilter *inner;
5788 * Indicates that this is the only struct which contains the same pointer.
5789 * Rust functions which take ownership of an object provided via an argument require
5790 * this to be true and invalidate the object pointed to by inner.
5793 } LDKGossipTimestampFilter;
5796 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
5798 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
5800 * A pointer to the contents in the success state.
5801 * Reading from this pointer when `result_ok` is not set is undefined.
5803 struct LDKGossipTimestampFilter *result;
5805 * A pointer to the contents in the error state.
5806 * Reading from this pointer when `result_ok` is set is undefined.
5808 struct LDKDecodeError *err;
5809 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
5812 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
5813 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
5814 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5816 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
5818 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
5819 * `err` or `result` depending on the state of `result_ok`.
5821 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
5823 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
5826 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
5829 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
5831 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
5833 * A pointer to the contents in the success state.
5834 * Reading from this pointer when `result_ok` is not set is undefined.
5836 struct LDKSpendableOutputDescriptor *result;
5838 * A pointer to the contents in the error state.
5839 * Reading from this pointer when `result_ok` is set is undefined.
5841 struct LDKDecodeError *err;
5842 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
5845 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
5846 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
5847 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5849 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
5851 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
5852 * `err` or `result` depending on the state of `result_ok`.
5854 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
5856 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
5859 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
5862 * The contents of CResult_SignDecodeErrorZ
5864 typedef union LDKCResult_SignDecodeErrorZPtr {
5866 * A pointer to the contents in the success state.
5867 * Reading from this pointer when `result_ok` is not set is undefined.
5869 struct LDKSign *result;
5871 * A pointer to the contents in the error state.
5872 * Reading from this pointer when `result_ok` is set is undefined.
5874 struct LDKDecodeError *err;
5875 } LDKCResult_SignDecodeErrorZPtr;
5878 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
5879 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
5880 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5882 typedef struct LDKCResult_SignDecodeErrorZ {
5884 * The contents of this CResult_SignDecodeErrorZ, accessible via either
5885 * `err` or `result` depending on the state of `result_ok`.
5887 union LDKCResult_SignDecodeErrorZPtr contents;
5889 * Whether this CResult_SignDecodeErrorZ represents a success state.
5892 } LDKCResult_SignDecodeErrorZ;
5895 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
5896 * This corresponds to std::vector in C++
5898 typedef struct LDKCVec_CVec_u8ZZ {
5900 * The elements in the array.
5901 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5903 struct LDKCVec_u8Z *data;
5905 * The number of elements pointed to by `data`.
5908 } LDKCVec_CVec_u8ZZ;
5911 * The contents of CResult_CVec_CVec_u8ZZNoneZ
5913 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
5915 * A pointer to the contents in the success state.
5916 * Reading from this pointer when `result_ok` is not set is undefined.
5918 struct LDKCVec_CVec_u8ZZ *result;
5920 * Note that this value is always NULL, as there are no contents in the Err variant
5923 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
5926 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
5927 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
5928 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5930 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
5932 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
5933 * `err` or `result` depending on the state of `result_ok`.
5935 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
5937 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
5940 } LDKCResult_CVec_CVec_u8ZZNoneZ;
5945 * A simple implementation of Sign that just keeps the private keys in memory.
5947 * This implementation performs no policy checks and is insufficient by itself as
5948 * a secure external signer.
5950 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
5952 * A pointer to the opaque Rust object.
5953 * Nearly everywhere, inner must be non-null, however in places where
5954 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5956 LDKnativeInMemorySigner *inner;
5958 * Indicates that this is the only struct which contains the same pointer.
5959 * Rust functions which take ownership of an object provided via an argument require
5960 * this to be true and invalidate the object pointed to by inner.
5963 } LDKInMemorySigner;
5966 * The contents of CResult_InMemorySignerDecodeErrorZ
5968 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
5970 * A pointer to the contents in the success state.
5971 * Reading from this pointer when `result_ok` is not set is undefined.
5973 struct LDKInMemorySigner *result;
5975 * A pointer to the contents in the error state.
5976 * Reading from this pointer when `result_ok` is set is undefined.
5978 struct LDKDecodeError *err;
5979 } LDKCResult_InMemorySignerDecodeErrorZPtr;
5982 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
5983 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
5984 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5986 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
5988 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
5989 * `err` or `result` depending on the state of `result_ok`.
5991 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
5993 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
5996 } LDKCResult_InMemorySignerDecodeErrorZ;
5999 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
6000 * This corresponds to std::vector in C++
6002 typedef struct LDKCVec_TxOutZ {
6004 * The elements in the array.
6005 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6007 struct LDKTxOut *data;
6009 * The number of elements pointed to by `data`.
6015 * The contents of CResult_TransactionNoneZ
6017 typedef union LDKCResult_TransactionNoneZPtr {
6019 * A pointer to the contents in the success state.
6020 * Reading from this pointer when `result_ok` is not set is undefined.
6022 struct LDKTransaction *result;
6024 * Note that this value is always NULL, as there are no contents in the Err variant
6027 } LDKCResult_TransactionNoneZPtr;
6030 * A CResult_TransactionNoneZ represents the result of a fallible operation,
6031 * containing a crate::c_types::Transaction on success and a () on failure.
6032 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6034 typedef struct LDKCResult_TransactionNoneZ {
6036 * The contents of this CResult_TransactionNoneZ, accessible via either
6037 * `err` or `result` depending on the state of `result_ok`.
6039 union LDKCResult_TransactionNoneZPtr contents;
6041 * Whether this CResult_TransactionNoneZ represents a success state.
6044 } LDKCResult_TransactionNoneZ;
6047 * The contents of CResult_NoneErrorZ
6049 typedef union LDKCResult_NoneErrorZPtr {
6051 * Note that this value is always NULL, as there are no contents in the OK variant
6055 * A pointer to the contents in the error state.
6056 * Reading from this pointer when `result_ok` is set is undefined.
6058 enum LDKIOError *err;
6059 } LDKCResult_NoneErrorZPtr;
6062 * A CResult_NoneErrorZ represents the result of a fallible operation,
6063 * containing a () on success and a crate::c_types::IOError on failure.
6064 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6066 typedef struct LDKCResult_NoneErrorZ {
6068 * The contents of this CResult_NoneErrorZ, accessible via either
6069 * `err` or `result` depending on the state of `result_ok`.
6071 union LDKCResult_NoneErrorZPtr contents;
6073 * Whether this CResult_NoneErrorZ represents a success state.
6076 } LDKCResult_NoneErrorZ;
6079 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
6080 * This corresponds to std::vector in C++
6082 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
6084 * The elements in the array.
6085 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6087 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
6089 * The number of elements pointed to by `data`.
6092 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
6095 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
6097 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
6099 * A pointer to the contents in the success state.
6100 * Reading from this pointer when `result_ok` is not set is undefined.
6102 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
6104 * A pointer to the contents in the error state.
6105 * Reading from this pointer when `result_ok` is set is undefined.
6107 enum LDKIOError *err;
6108 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
6111 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
6112 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
6113 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6115 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
6117 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
6118 * `err` or `result` depending on the state of `result_ok`.
6120 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
6122 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
6125 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
6128 * A Rust str object, ie a reference to a UTF8-valid string.
6129 * This is *not* null-terminated so cannot be used directly as a C string!
6131 typedef struct LDKStr {
6133 * A pointer to the string's bytes, in UTF8 encoding
6135 const uint8_t *chars;
6137 * The number of bytes (not characters!) pointed to by `chars`
6143 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
6146 typedef enum LDKAPIError_Tag {
6148 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
6149 * are documented, but generally indicates some precondition of a function was violated.
6151 LDKAPIError_APIMisuseError,
6153 * Due to a high feerate, we were unable to complete the request.
6154 * For example, this may be returned if the feerate implies we cannot open a channel at the
6155 * requested value, but opening a larger channel would succeed.
6157 LDKAPIError_FeeRateTooHigh,
6159 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
6160 * too-many-hops, etc).
6162 LDKAPIError_RouteError,
6164 * We were unable to complete the request as the Channel required to do so is unable to
6165 * complete the request (or was not found). This can take many forms, including disconnected
6166 * peer, channel at capacity, channel shutting down, etc.
6168 LDKAPIError_ChannelUnavailable,
6170 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
6171 * attempted action to fail.
6173 LDKAPIError_MonitorUpdateFailed,
6175 * Must be last for serialization purposes
6177 LDKAPIError_Sentinel,
6180 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
6182 * A human-readable error message
6184 struct LDKCVec_u8Z err;
6185 } LDKAPIError_LDKAPIMisuseError_Body;
6187 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
6189 * A human-readable error message
6191 struct LDKCVec_u8Z err;
6193 * The feerate which was too high.
6196 } LDKAPIError_LDKFeeRateTooHigh_Body;
6198 typedef struct LDKAPIError_LDKRouteError_Body {
6200 * A human-readable error message
6203 } LDKAPIError_LDKRouteError_Body;
6205 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
6207 * A human-readable error message
6209 struct LDKCVec_u8Z err;
6210 } LDKAPIError_LDKChannelUnavailable_Body;
6212 typedef struct MUST_USE_STRUCT LDKAPIError {
6213 LDKAPIError_Tag tag;
6215 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
6216 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
6217 LDKAPIError_LDKRouteError_Body route_error;
6218 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
6223 * The contents of CResult_NoneAPIErrorZ
6225 typedef union LDKCResult_NoneAPIErrorZPtr {
6227 * Note that this value is always NULL, as there are no contents in the OK variant
6231 * A pointer to the contents in the error state.
6232 * Reading from this pointer when `result_ok` is set is undefined.
6234 struct LDKAPIError *err;
6235 } LDKCResult_NoneAPIErrorZPtr;
6238 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
6239 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
6240 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6242 typedef struct LDKCResult_NoneAPIErrorZ {
6244 * The contents of this CResult_NoneAPIErrorZ, accessible via either
6245 * `err` or `result` depending on the state of `result_ok`.
6247 union LDKCResult_NoneAPIErrorZPtr contents;
6249 * Whether this CResult_NoneAPIErrorZ represents a success state.
6252 } LDKCResult_NoneAPIErrorZ;
6255 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
6256 * This corresponds to std::vector in C++
6258 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
6260 * The elements in the array.
6261 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6263 struct LDKCResult_NoneAPIErrorZ *data;
6265 * The number of elements pointed to by `data`.
6268 } LDKCVec_CResult_NoneAPIErrorZZ;
6271 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
6272 * This corresponds to std::vector in C++
6274 typedef struct LDKCVec_APIErrorZ {
6276 * The elements in the array.
6277 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6279 struct LDKAPIError *data;
6281 * The number of elements pointed to by `data`.
6284 } LDKCVec_APIErrorZ;
6287 * If a payment fails to send, it can be in one of several states. This enum is returned as the
6288 * Err() type describing which state the payment is in, see the description of individual enum
6291 typedef enum LDKPaymentSendFailure_Tag {
6293 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
6294 * send the payment at all. No channel state has been changed or messages sent to peers, and
6295 * once you've changed the parameter at error, you can freely retry the payment in full.
6297 LDKPaymentSendFailure_ParameterError,
6299 * A parameter in a single path which was passed to send_payment was invalid, preventing us
6300 * from attempting to send the payment at all. No channel state has been changed or messages
6301 * sent to peers, and once you've changed the parameter at error, you can freely retry the
6304 * The results here are ordered the same as the paths in the route object which was passed to
6307 LDKPaymentSendFailure_PathParameterError,
6309 * All paths which were attempted failed to send, with no channel state change taking place.
6310 * You can freely retry the payment in full (though you probably want to do so over different
6311 * paths than the ones selected).
6313 LDKPaymentSendFailure_AllFailedRetrySafe,
6315 * Some paths which were attempted failed to send, though possibly not all. At least some
6316 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
6317 * in over-/re-payment.
6319 * The results here are ordered the same as the paths in the route object which was passed to
6320 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
6321 * retried (though there is currently no API with which to do so).
6323 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
6324 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
6325 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
6326 * with the latest update_id.
6328 LDKPaymentSendFailure_PartialFailure,
6330 * Must be last for serialization purposes
6332 LDKPaymentSendFailure_Sentinel,
6333 } LDKPaymentSendFailure_Tag;
6335 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
6336 LDKPaymentSendFailure_Tag tag;
6339 struct LDKAPIError parameter_error;
6342 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
6345 struct LDKCVec_APIErrorZ all_failed_retry_safe;
6348 struct LDKCVec_CResult_NoneAPIErrorZZ partial_failure;
6351 } LDKPaymentSendFailure;
6354 * The contents of CResult_NonePaymentSendFailureZ
6356 typedef union LDKCResult_NonePaymentSendFailureZPtr {
6358 * Note that this value is always NULL, as there are no contents in the OK variant
6362 * A pointer to the contents in the error state.
6363 * Reading from this pointer when `result_ok` is set is undefined.
6365 struct LDKPaymentSendFailure *err;
6366 } LDKCResult_NonePaymentSendFailureZPtr;
6369 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
6370 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
6371 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6373 typedef struct LDKCResult_NonePaymentSendFailureZ {
6375 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
6376 * `err` or `result` depending on the state of `result_ok`.
6378 union LDKCResult_NonePaymentSendFailureZPtr contents;
6380 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
6383 } LDKCResult_NonePaymentSendFailureZ;
6386 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
6387 * This corresponds to std::vector in C++
6389 typedef struct LDKCVec_ChannelMonitorZ {
6391 * The elements in the array.
6392 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6394 struct LDKChannelMonitor *data;
6396 * The number of elements pointed to by `data`.
6399 } LDKCVec_ChannelMonitorZ;
6402 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
6403 * blocks are connected and disconnected.
6405 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
6406 * responsible for maintaining a set of monitors such that they can be updated accordingly as
6407 * channel state changes and HTLCs are resolved. See method documentation for specific
6410 * Implementations **must** ensure that updates are successfully applied and persisted upon method
6411 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
6412 * without taking any further action such as persisting the current state.
6414 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
6415 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
6416 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
6417 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
6418 * multiple instances.
6420 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
6421 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
6422 * [`PermanentFailure`]: channelmonitor::ChannelMonitorUpdateErr::PermanentFailure
6424 typedef struct LDKWatch {
6426 * An opaque pointer which is passed to your function implementations as an argument.
6427 * This has no meaning in the LDK, and can be NULL or any other value.
6431 * Watches a channel identified by `funding_txo` using `monitor`.
6433 * Implementations are responsible for watching the chain for the funding transaction along
6434 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
6435 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
6437 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
6438 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
6439 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
6441 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
6443 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
6445 * Implementations must call [`update_monitor`] with the given update. See
6446 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
6448 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
6449 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
6451 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
6453 * Returns any monitor events since the last call. Subsequent calls must only return new
6456 struct LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
6458 * Frees any resources associated with this object given its this_arg pointer.
6459 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6461 void (*free)(void *this_arg);
6465 * An interface to send a transaction to the Bitcoin network.
6467 typedef struct LDKBroadcasterInterface {
6469 * An opaque pointer which is passed to your function implementations as an argument.
6470 * This has no meaning in the LDK, and can be NULL or any other value.
6474 * Sends a transaction out to (hopefully) be mined.
6476 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
6478 * Frees any resources associated with this object given its this_arg pointer.
6479 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6481 void (*free)(void *this_arg);
6482 } LDKBroadcasterInterface;
6485 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
6486 * own the memory pointed to by data.
6488 typedef struct LDKu8slice {
6490 * A pointer to the byte buffer
6492 const uint8_t *data;
6494 * The number of bytes pointed to by `data`.
6500 * A trait to describe an object which can get user secrets and key material.
6502 typedef struct LDKKeysInterface {
6504 * An opaque pointer which is passed to your function implementations as an argument.
6505 * This has no meaning in the LDK, and can be NULL or any other value.
6509 * Get node secret key (aka node_id or network_key).
6511 * This method must return the same value each time it is called.
6513 struct LDKSecretKey (*get_node_secret)(const void *this_arg);
6515 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
6517 * This method should return a different value each time it is called, to avoid linking
6518 * on-chain funds across channels as controlled to the same user.
6520 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
6522 * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing
6525 * This method should return a different value each time it is called, to avoid linking
6526 * on-chain funds across channels as controlled to the same user.
6528 struct LDKPublicKey (*get_shutdown_pubkey)(const void *this_arg);
6530 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
6531 * restarted with some stale data!
6533 * This method must return a different value each time it is called.
6535 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
6537 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
6538 * onion packets and for temporary channel IDs. There is no requirement that these be
6539 * persisted anywhere, though they must be unique across restarts.
6541 * This method must return a different value each time it is called.
6543 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
6545 * Reads a `Signer` for this `KeysInterface` from the given input stream.
6546 * This is only called during deserialization of other objects which contain
6547 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
6548 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
6549 * contain no versioning scheme. You may wish to include your own version prefix and ensure
6550 * you've read all of the provided bytes to ensure no corruption occurred.
6552 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
6554 * Frees any resources associated with this object given its this_arg pointer.
6555 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6557 void (*free)(void *this_arg);
6561 * A trait which should be implemented to provide feerate information on a number of time
6564 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
6565 * called from inside the library in response to chain events, P2P events, or timer events).
6567 typedef struct LDKFeeEstimator {
6569 * An opaque pointer which is passed to your function implementations as an argument.
6570 * This has no meaning in the LDK, and can be NULL or any other value.
6574 * Gets estimated satoshis of fee required per 1000 Weight-Units.
6576 * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
6577 * don't put us below 1 satoshi-per-byte).
6579 * This translates to:
6580 * * satoshis-per-byte * 250
6581 * * ceil(satoshis-per-kbyte / 4)
6583 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
6585 * Frees any resources associated with this object given its this_arg pointer.
6586 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6588 void (*free)(void *this_arg);
6592 * A trait encapsulating the operations required of a logger
6594 typedef struct LDKLogger {
6596 * An opaque pointer which is passed to your function implementations as an argument.
6597 * This has no meaning in the LDK, and can be NULL or any other value.
6603 void (*log)(const void *this_arg, const char *record);
6605 * Frees any resources associated with this object given its this_arg pointer.
6606 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6608 void (*free)(void *this_arg);
6614 * Manager which keeps track of a number of channels and sends messages to the appropriate
6615 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
6617 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
6618 * to individual Channels.
6620 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
6621 * all peers during write/read (though does not modify this instance, only the instance being
6622 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
6623 * called funding_transaction_generated for outbound channels).
6625 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
6626 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
6627 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
6628 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
6629 * the serialization process). If the deserialized version is out-of-date compared to the
6630 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
6631 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
6633 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
6634 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
6635 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
6636 * block_connected() to step towards your best block) upon deserialization before using the
6639 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
6640 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
6641 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
6642 * offline for a full minute. In order to track this, you must call
6643 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
6645 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
6646 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
6647 * essentially you should default to using a SimpleRefChannelManager, and use a
6648 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
6649 * you're using lightning-net-tokio.
6651 typedef struct MUST_USE_STRUCT LDKChannelManager {
6653 * A pointer to the opaque Rust object.
6654 * Nearly everywhere, inner must be non-null, however in places where
6655 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6657 LDKnativeChannelManager *inner;
6659 * Indicates that this is the only struct which contains the same pointer.
6660 * Rust functions which take ownership of an object provided via an argument require
6661 * this to be true and invalidate the object pointed to by inner.
6664 } LDKChannelManager;
6667 * A tuple of 2 elements. See the individual fields for the types contained.
6669 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
6671 * The element at position 0
6673 struct LDKThirtyTwoBytes a;
6675 * The element at position 1
6677 struct LDKChannelManager b;
6678 } LDKC2Tuple_BlockHashChannelManagerZ;
6681 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
6683 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
6685 * A pointer to the contents in the success state.
6686 * Reading from this pointer when `result_ok` is not set is undefined.
6688 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
6690 * A pointer to the contents in the error state.
6691 * Reading from this pointer when `result_ok` is set is undefined.
6693 struct LDKDecodeError *err;
6694 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
6697 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
6698 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
6699 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6701 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
6703 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
6704 * `err` or `result` depending on the state of `result_ok`.
6706 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
6708 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
6711 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
6714 * A trait indicating an object may generate message send events
6716 typedef struct LDKMessageSendEventsProvider {
6718 * An opaque pointer which is passed to your function implementations as an argument.
6719 * This has no meaning in the LDK, and can be NULL or any other value.
6723 * Gets the list of pending events which were generated by previous actions, clearing the list
6726 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
6728 * Frees any resources associated with this object given its this_arg pointer.
6729 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6731 void (*free)(void *this_arg);
6732 } LDKMessageSendEventsProvider;
6735 * A trait indicating an object may generate events
6737 typedef struct LDKEventsProvider {
6739 * An opaque pointer which is passed to your function implementations as an argument.
6740 * This has no meaning in the LDK, and can be NULL or any other value.
6744 * Gets the list of pending events which were generated by previous actions, clearing the list
6747 struct LDKCVec_EventZ (*get_and_clear_pending_events)(const void *this_arg);
6749 * Frees any resources associated with this object given its this_arg pointer.
6750 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6752 void (*free)(void *this_arg);
6753 } LDKEventsProvider;
6758 * Configuration we set when applicable.
6760 * Default::default() provides sane defaults.
6762 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
6764 * A pointer to the opaque Rust object.
6765 * Nearly everywhere, inner must be non-null, however in places where
6766 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6768 LDKnativeChannelHandshakeConfig *inner;
6770 * Indicates that this is the only struct which contains the same pointer.
6771 * Rust functions which take ownership of an object provided via an argument require
6772 * this to be true and invalidate the object pointed to by inner.
6775 } LDKChannelHandshakeConfig;
6780 * Optional channel limits which are applied during channel creation.
6782 * These limits are only applied to our counterparty's limits, not our own.
6784 * Use 0/<type>::max_value() as appropriate to skip checking.
6786 * Provides sane defaults for most configurations.
6788 * Most additional limits are disabled except those with which specify a default in individual
6789 * field documentation. Note that this may result in barely-usable channels, but since they
6790 * are applied mostly only to incoming channels that's not much of a problem.
6792 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
6794 * A pointer to the opaque Rust object.
6795 * Nearly everywhere, inner must be non-null, however in places where
6796 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6798 LDKnativeChannelHandshakeLimits *inner;
6800 * Indicates that this is the only struct which contains the same pointer.
6801 * Rust functions which take ownership of an object provided via an argument require
6802 * this to be true and invalidate the object pointed to by inner.
6805 } LDKChannelHandshakeLimits;
6810 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
6812 * Default::default() provides sane defaults for most configurations
6813 * (but currently with 0 relay fees!)
6815 typedef struct MUST_USE_STRUCT LDKUserConfig {
6817 * A pointer to the opaque Rust object.
6818 * Nearly everywhere, inner must be non-null, however in places where
6819 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6821 LDKnativeUserConfig *inner;
6823 * Indicates that this is the only struct which contains the same pointer.
6824 * Rust functions which take ownership of an object provided via an argument require
6825 * this to be true and invalidate the object pointed to by inner.
6831 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
6834 typedef struct LDKAccess {
6836 * An opaque pointer which is passed to your function implementations as an argument.
6837 * This has no meaning in the LDK, and can be NULL or any other value.
6841 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
6842 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
6845 * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
6847 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
6849 * Frees any resources associated with this object given its this_arg pointer.
6850 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6852 void (*free)(void *this_arg);
6856 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
6859 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
6860 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
6861 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
6864 typedef struct LDKListen {
6866 * An opaque pointer which is passed to your function implementations as an argument.
6867 * This has no meaning in the LDK, and can be NULL or any other value.
6871 * Notifies the listener that a block was added at the given height.
6873 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
6875 * Notifies the listener that a block was removed at the given height.
6877 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
6879 * Frees any resources associated with this object given its this_arg pointer.
6880 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6882 void (*free)(void *this_arg);
6886 * The `Confirm` trait is used to notify when transactions have been confirmed on chain or
6887 * unconfirmed during a chain reorganization.
6889 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
6890 * [`Listen`]. For instance, an Electrum client may implement [`Filter`] by subscribing to activity
6891 * related to registered transactions and outputs. Upon notification, it would pass along the
6892 * matching transactions using this interface.
6896 * The intended use is as follows:
6897 * - Call [`transactions_confirmed`] to process any on-chain activity of interest.
6898 * - Call [`transaction_unconfirmed`] to process any transaction returned by [`get_relevant_txids`]
6899 * that has been reorganized out of the chain.
6900 * - Call [`best_block_updated`] whenever a new chain tip becomes available.
6904 * Clients must call these methods in chain order. Specifically:
6905 * - Transactions confirmed in a block must be given before transactions confirmed in a later
6907 * - Dependent transactions within the same block must be given in topological order, possibly in
6909 * - Unconfirmed transactions must be given after the original confirmations and before any
6912 * See individual method documentation for further details.
6914 * [`transactions_confirmed`]: Self::transactions_confirmed
6915 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
6916 * [`best_block_updated`]: Self::best_block_updated
6917 * [`get_relevant_txids`]: Self::get_relevant_txids
6919 typedef struct LDKConfirm {
6921 * An opaque pointer which is passed to your function implementations as an argument.
6922 * This has no meaning in the LDK, and can be NULL or any other value.
6926 * Processes transactions confirmed in a block with a given header and height.
6928 * Should be called for any transactions registered by [`Filter::register_tx`] or any
6929 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
6930 * appearing in the same block do not need to be included in the same call; instead, multiple
6931 * calls with additional transactions may be made so long as they are made in [chain order].
6933 * May be called before or after [`best_block_updated`] for the corresponding block. However,
6934 * in the event of a chain reorganization, it must not be called with a `header` that is no
6935 * longer in the chain as of the last call to [`best_block_updated`].
6937 * [chain order]: Self#order
6938 * [`best_block_updated`]: Self::best_block_updated
6940 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
6942 * Processes a transaction that is no longer confirmed as result of a chain reorganization.
6944 * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
6945 * reorganized out of the best chain. Once called, the given transaction should not be returned
6946 * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`].
6948 * [`get_relevant_txids`]: Self::get_relevant_txids
6949 * [`transactions_confirmed`]: Self::transactions_confirmed
6951 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
6953 * Processes an update to the best header connected at the given height.
6955 * Should be called when a new header is available but may be skipped for intermediary blocks
6956 * if they become available at the same time.
6958 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
6960 * Returns transactions that should be monitored for reorganization out of the chain.
6962 * Should include any transactions passed to [`transactions_confirmed`] that have insufficient
6963 * confirmations to be safe from a chain reorganization. Should not include any transactions
6964 * passed to [`transaction_unconfirmed`] unless later reconfirmed.
6966 * May be called to determine the subset of transactions that must still be monitored for
6967 * reorganization. Will be idempotent between calls but may change as a result of calls to the
6968 * other interface methods. Thus, this is useful to determine which transactions may need to be
6969 * given to [`transaction_unconfirmed`].
6971 * [`transactions_confirmed`]: Self::transactions_confirmed
6972 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
6974 struct LDKCVec_TxidZ (*get_relevant_txids)(const void *this_arg);
6976 * Frees any resources associated with this object given its this_arg pointer.
6977 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6979 void (*free)(void *this_arg);
6985 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
6987 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
6988 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
6989 * the return value of [`Filter::register_output`].
6991 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
6992 * may have been spent there. See [`Filter::register_output`] for details.
6994 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
6995 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
6997 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
6999 * A pointer to the opaque Rust object.
7000 * Nearly everywhere, inner must be non-null, however in places where
7001 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7003 LDKnativeWatchedOutput *inner;
7005 * Indicates that this is the only struct which contains the same pointer.
7006 * Rust functions which take ownership of an object provided via an argument require
7007 * this to be true and invalidate the object pointed to by inner.
7013 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
7016 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
7017 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
7018 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
7019 * receiving full blocks from a chain source, any further filtering is unnecessary.
7021 * After an output has been registered, subsequent block retrievals from the chain source must not
7022 * exclude any transactions matching the new criteria nor any in-block descendants of such
7025 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
7026 * should not block on I/O. Implementations should instead queue the newly monitored data to be
7027 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
7028 * invocation that has called the `Filter` must return [`TemporaryFailure`].
7030 * [`TemporaryFailure`]: channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure
7031 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
7032 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
7034 typedef struct LDKFilter {
7036 * An opaque pointer which is passed to your function implementations as an argument.
7037 * This has no meaning in the LDK, and can be NULL or any other value.
7041 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
7042 * a spending condition.
7044 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
7046 * Registers interest in spends of a transaction output.
7048 * Optionally, when `output.block_hash` is set, should return any transaction spending the
7049 * output that is found in the corresponding block along with its index.
7051 * This return value is useful for Electrum clients in order to supply in-block descendant
7052 * transactions which otherwise were not included. This is not necessary for other clients if
7053 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
7056 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
7058 * Frees any resources associated with this object given its this_arg pointer.
7059 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7061 void (*free)(void *this_arg);
7065 * `Persist` defines behavior for persisting channel monitors: this could mean
7066 * writing once to disk, and/or uploading to one or more backup services.
7068 * Note that for every new monitor, you **must** persist the new `ChannelMonitor`
7069 * to disk/backups. And, on every update, you **must** persist either the
7070 * `ChannelMonitorUpdate` or the updated monitor itself. Otherwise, there is risk
7071 * of situations such as revoking a transaction, then crashing before this
7072 * revocation can be persisted, then unintentionally broadcasting a revoked
7073 * transaction and losing money. This is a risk because previous channel states
7074 * are toxic, so it's important that whatever channel state is persisted is
7077 typedef struct LDKPersist {
7079 * An opaque pointer which is passed to your function implementations as an argument.
7080 * This has no meaning in the LDK, and can be NULL or any other value.
7084 * Persist a new channel's data. The data can be stored any way you want, but
7085 * the identifier provided by Rust-Lightning is the channel's outpoint (and
7086 * it is up to you to maintain a correct mapping between the outpoint and the
7087 * stored channel data). Note that you **must** persist every new monitor to
7088 * disk. See the `Persist` trait documentation for more details.
7090 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
7091 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
7093 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data);
7095 * Update one channel's data. The provided `ChannelMonitor` has already
7096 * applied the given update.
7098 * Note that on every update, you **must** persist either the
7099 * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See
7100 * the `Persist` trait documentation for more details.
7102 * If an implementer chooses to persist the updates only, they need to make
7103 * sure that all the updates are applied to the `ChannelMonitors` *before*
7104 * the set of channel monitors is given to the `ChannelManager`
7105 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
7106 * applying a monitor update to a monitor. If full `ChannelMonitors` are
7107 * persisted, then there is no need to persist individual updates.
7109 * Note that there could be a performance tradeoff between persisting complete
7110 * channel monitors on every update vs. persisting only updates and applying
7111 * them in batches. The size of each monitor grows `O(number of state updates)`
7112 * whereas updates are small and `O(1)`.
7114 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
7115 * [`ChannelMonitorUpdate::write`] for writing out an update, and
7116 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
7118 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);
7120 * Frees any resources associated with this object given its this_arg pointer.
7121 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7123 void (*free)(void *this_arg);
7129 * An implementation of [`chain::Watch`] for monitoring channels.
7131 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
7132 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
7133 * or used independently to monitor channels remotely. See the [module-level documentation] for
7136 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
7137 * [module-level documentation]: crate::chain::chainmonitor
7139 typedef struct MUST_USE_STRUCT LDKChainMonitor {
7141 * A pointer to the opaque Rust object.
7142 * Nearly everywhere, inner must be non-null, however in places where
7143 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7145 LDKnativeChainMonitor *inner;
7147 * Indicates that this is the only struct which contains the same pointer.
7148 * Rust functions which take ownership of an object provided via an argument require
7149 * this to be true and invalidate the object pointed to by inner.
7157 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
7158 * and derives keys from that.
7160 * Your node_id is seed/0'
7161 * ChannelMonitor closes may use seed/1'
7162 * Cooperative closes may use seed/2'
7163 * The two close keys may be needed to claim on-chain funds!
7165 typedef struct MUST_USE_STRUCT LDKKeysManager {
7167 * A pointer to the opaque Rust object.
7168 * Nearly everywhere, inner must be non-null, however in places where
7169 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7171 LDKnativeKeysManager *inner;
7173 * Indicates that this is the only struct which contains the same pointer.
7174 * Rust functions which take ownership of an object provided via an argument require
7175 * this to be true and invalidate the object pointed to by inner.
7183 * Chain-related parameters used to construct a new `ChannelManager`.
7185 * Typically, the block-specific parameters are derived from the best block hash for the network,
7186 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
7187 * are not needed when deserializing a previously constructed `ChannelManager`.
7189 typedef struct MUST_USE_STRUCT LDKChainParameters {
7191 * A pointer to the opaque Rust object.
7192 * Nearly everywhere, inner must be non-null, however in places where
7193 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7195 LDKnativeChainParameters *inner;
7197 * Indicates that this is the only struct which contains the same pointer.
7198 * Rust functions which take ownership of an object provided via an argument require
7199 * this to be true and invalidate the object pointed to by inner.
7202 } LDKChainParameters;
7207 * The best known block as identified by its hash and height.
7209 typedef struct MUST_USE_STRUCT LDKBestBlock {
7211 * A pointer to the opaque Rust object.
7212 * Nearly everywhere, inner must be non-null, however in places where
7213 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7215 LDKnativeBestBlock *inner;
7217 * Indicates that this is the only struct which contains the same pointer.
7218 * Rust functions which take ownership of an object provided via an argument require
7219 * this to be true and invalidate the object pointed to by inner.
7225 * A 3-byte byte array.
7227 typedef struct LDKThreeBytes {
7235 * A trait to describe an object which can receive channel messages.
7237 * Messages MAY be called in parallel when they originate from different their_node_ids, however
7238 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
7240 typedef struct LDKChannelMessageHandler {
7242 * An opaque pointer which is passed to your function implementations as an argument.
7243 * This has no meaning in the LDK, and can be NULL or any other value.
7247 * Handle an incoming open_channel message from the given peer.
7249 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
7251 * Handle an incoming accept_channel message from the given peer.
7253 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
7255 * Handle an incoming funding_created message from the given peer.
7257 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
7259 * Handle an incoming funding_signed message from the given peer.
7261 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
7263 * Handle an incoming funding_locked message from the given peer.
7265 void (*handle_funding_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg);
7267 * Handle an incoming shutdown message from the given peer.
7269 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);
7271 * Handle an incoming closing_signed message from the given peer.
7273 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
7275 * Handle an incoming update_add_htlc message from the given peer.
7277 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
7279 * Handle an incoming update_fulfill_htlc message from the given peer.
7281 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
7283 * Handle an incoming update_fail_htlc message from the given peer.
7285 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
7287 * Handle an incoming update_fail_malformed_htlc message from the given peer.
7289 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
7291 * Handle an incoming commitment_signed message from the given peer.
7293 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
7295 * Handle an incoming revoke_and_ack message from the given peer.
7297 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
7299 * Handle an incoming update_fee message from the given peer.
7301 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
7303 * Handle an incoming announcement_signatures message from the given peer.
7305 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
7307 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
7308 * is believed to be possible in the future (eg they're sending us messages we don't
7309 * understand or indicate they require unknown feature bits), no_connection_possible is set
7310 * and any outstanding channels should be failed.
7312 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
7314 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
7316 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
7318 * Handle an incoming channel_reestablish message from the given peer.
7320 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
7322 * Handle an incoming channel update from the given peer.
7324 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
7326 * Handle an incoming error message from the given peer.
7328 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
7330 * Implementation of MessageSendEventsProvider for this object.
7332 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
7334 * Frees any resources associated with this object given its this_arg pointer.
7335 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7337 void (*free)(void *this_arg);
7338 } LDKChannelMessageHandler;
7343 * Arguments for the creation of a ChannelManager that are not deserialized.
7345 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
7347 * 1) Deserialize all stored ChannelMonitors.
7348 * 2) Deserialize the ChannelManager by filling in this struct and calling:
7349 * <(BlockHash, ChannelManager)>::read(reader, args)
7350 * This may result in closing some Channels if the ChannelMonitor is newer than the stored
7351 * ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted.
7352 * 3) If you are not fetching full blocks, register all relevant ChannelMonitor outpoints the same
7353 * way you would handle a `chain::Filter` call using ChannelMonitor::get_outputs_to_watch() and
7354 * ChannelMonitor::get_funding_txo().
7355 * 4) Reconnect blocks on your ChannelMonitors.
7356 * 5) Disconnect/connect blocks on the ChannelManager.
7357 * 6) Move the ChannelMonitors into your local chain::Watch.
7359 * Note that the ordering of #4-6 is not of importance, however all three must occur before you
7360 * call any other methods on the newly-deserialized ChannelManager.
7362 * Note that because some channels may be closed during deserialization, it is critical that you
7363 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
7364 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
7365 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
7366 * not force-close the same channels but consider them live), you may end up revoking a state for
7367 * which you've already broadcasted the transaction.
7369 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
7371 * A pointer to the opaque Rust object.
7372 * Nearly everywhere, inner must be non-null, however in places where
7373 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7375 LDKnativeChannelManagerReadArgs *inner;
7377 * Indicates that this is the only struct which contains the same pointer.
7378 * Rust functions which take ownership of an object provided via an argument require
7379 * this to be true and invalidate the object pointed to by inner.
7382 } LDKChannelManagerReadArgs;
7387 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
7388 * This is used to convince the recipient that the channel is at a certain commitment
7389 * number even if they lost that data due to a local failure. Of course, the peer may lie
7390 * and even later commitments may have been revoked.
7392 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
7394 * A pointer to the opaque Rust object.
7395 * Nearly everywhere, inner must be non-null, however in places where
7396 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7398 LDKnativeDataLossProtect *inner;
7400 * Indicates that this is the only struct which contains the same pointer.
7401 * Rust functions which take ownership of an object provided via an argument require
7402 * this to be true and invalidate the object pointed to by inner.
7405 } LDKDataLossProtect;
7408 * A trait to describe an object which can receive routing messages.
7410 * # Implementor DoS Warnings
7412 * For `gossip_queries` messages there are potential DoS vectors when handling
7413 * inbound queries. Implementors using an on-disk network graph should be aware of
7414 * repeated disk I/O for queries accessing different parts of the network graph.
7416 typedef struct LDKRoutingMessageHandler {
7418 * An opaque pointer which is passed to your function implementations as an argument.
7419 * This has no meaning in the LDK, and can be NULL or any other value.
7423 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
7424 * false or returning an Err otherwise.
7426 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
7428 * Handle a channel_announcement message, returning true if it should be forwarded on, false
7429 * or returning an Err otherwise.
7431 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
7433 * Handle an incoming channel_update message, returning true if it should be forwarded on,
7434 * false or returning an Err otherwise.
7436 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
7438 * Handle some updates to the route graph that we learned due to an outbound failed payment.
7440 void (*handle_htlc_fail_channel_update)(const void *this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update);
7442 * Gets a subset of the channel announcements and updates required to dump our routing table
7443 * to a remote node, starting at the short_channel_id indicated by starting_point and
7444 * including the batch_amount entries immediately higher in numerical value than starting_point.
7446 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
7448 * Gets a subset of the node announcements required to dump our routing table to a remote node,
7449 * starting at the node *after* the provided publickey and including batch_amount entries
7450 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
7451 * If None is provided for starting_point, we start at the first node.
7453 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
7455 * Called when a connection is established with a peer. This can be used to
7456 * perform routing table synchronization using a strategy defined by the
7459 void (*sync_routing_table)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
7461 * Handles the reply of a query we initiated to learn about channels
7462 * for a given range of blocks. We can expect to receive one or more
7463 * replies to a single query.
7465 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
7467 * Handles the reply of a query we initiated asking for routing gossip
7468 * messages for a list of channels. We should receive this message when
7469 * a node has completed its best effort to send us the pertaining routing
7472 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
7474 * Handles when a peer asks us to send a list of short_channel_ids
7475 * for the requested range of blocks.
7477 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
7479 * Handles when a peer asks us to send routing gossip messages for a
7480 * list of short_channel_ids.
7482 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
7484 * Implementation of MessageSendEventsProvider for this object.
7486 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
7488 * Frees any resources associated with this object given its this_arg pointer.
7489 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7491 void (*free)(void *this_arg);
7492 } LDKRoutingMessageHandler;
7497 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
7498 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
7500 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
7502 * A pointer to the opaque Rust object.
7503 * Nearly everywhere, inner must be non-null, however in places where
7504 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7506 LDKnativeIgnoringMessageHandler *inner;
7508 * Indicates that this is the only struct which contains the same pointer.
7509 * Rust functions which take ownership of an object provided via an argument require
7510 * this to be true and invalidate the object pointed to by inner.
7513 } LDKIgnoringMessageHandler;
7518 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
7519 * You can provide one of these as the route_handler in a MessageHandler.
7521 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
7523 * A pointer to the opaque Rust object.
7524 * Nearly everywhere, inner must be non-null, however in places where
7525 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7527 LDKnativeErroringMessageHandler *inner;
7529 * Indicates that this is the only struct which contains the same pointer.
7530 * Rust functions which take ownership of an object provided via an argument require
7531 * this to be true and invalidate the object pointed to by inner.
7534 } LDKErroringMessageHandler;
7539 * Provides references to trait impls which handle different types of messages.
7541 typedef struct MUST_USE_STRUCT LDKMessageHandler {
7543 * A pointer to the opaque Rust object.
7544 * Nearly everywhere, inner must be non-null, however in places where
7545 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7547 LDKnativeMessageHandler *inner;
7549 * Indicates that this is the only struct which contains the same pointer.
7550 * Rust functions which take ownership of an object provided via an argument require
7551 * this to be true and invalidate the object pointed to by inner.
7554 } LDKMessageHandler;
7557 * Provides an object which can be used to send data to and which uniquely identifies a connection
7558 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
7559 * implement Hash to meet the PeerManager API.
7561 * For efficiency, Clone should be relatively cheap for this type.
7563 * You probably want to just extend an int and put a file descriptor in a struct and implement
7564 * send_data. Note that if you are using a higher-level net library that may call close() itself,
7565 * be careful to ensure you don't have races whereby you might register a new connection with an
7566 * fd which is the same as a previous one which has yet to be removed via
7567 * PeerManager::socket_disconnected().
7569 typedef struct LDKSocketDescriptor {
7571 * An opaque pointer which is passed to your function implementations as an argument.
7572 * This has no meaning in the LDK, and can be NULL or any other value.
7576 * Attempts to send some data from the given slice to the peer.
7578 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
7579 * Note that in the disconnected case, socket_disconnected must still fire and further write
7580 * attempts may occur until that time.
7582 * If the returned size is smaller than data.len(), a write_available event must
7583 * trigger the next time more data can be written. Additionally, until the a send_data event
7584 * completes fully, no further read_events should trigger on the same peer!
7586 * If a read_event on this descriptor had previously returned true (indicating that read
7587 * events should be paused to prevent DoS in the send buffer), resume_read may be set
7588 * indicating that read events on this descriptor should resume. A resume_read of false does
7589 * *not* imply that further read events should be paused.
7591 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
7593 * Disconnect the socket pointed to by this SocketDescriptor. Once this function returns, no
7594 * more calls to write_buffer_space_avail, read_event or socket_disconnected may be made with
7595 * this descriptor. No socket_disconnected call should be generated as a result of this call,
7596 * though races may occur whereby disconnect_socket is called after a call to
7597 * socket_disconnected but prior to socket_disconnected returning.
7599 void (*disconnect_socket)(void *this_arg);
7601 * Checks if two objects are equal given this object's this_arg pointer and another object.
7603 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
7605 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
7606 * This is used, for example, for inclusion of this object in a hash map.
7608 uint64_t (*hash)(const void *this_arg);
7610 * Creates a copy of the object pointed to by this_arg, for a copy of this SocketDescriptor.
7611 * Note that the ultimate copy of the SocketDescriptor will have all function pointers the same as the original.
7612 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new SocketDescriptor.
7614 void *(*clone)(const void *this_arg);
7616 * Frees any resources associated with this object given its this_arg pointer.
7617 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7619 void (*free)(void *this_arg);
7620 } LDKSocketDescriptor;
7625 * A PeerManager manages a set of peers, described by their SocketDescriptor and marshalls socket
7626 * events into messages which it passes on to its MessageHandlers.
7628 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
7629 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
7630 * essentially you should default to using a SimpleRefPeerManager, and use a
7631 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
7632 * you're using lightning-net-tokio.
7634 typedef struct MUST_USE_STRUCT LDKPeerManager {
7636 * A pointer to the opaque Rust object.
7637 * Nearly everywhere, inner must be non-null, however in places where
7638 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7640 LDKnativePeerManager *inner;
7642 * Indicates that this is the only struct which contains the same pointer.
7643 * Rust functions which take ownership of an object provided via an argument require
7644 * this to be true and invalidate the object pointed to by inner.
7652 * Static channel fields used to build transactions given per-commitment fields, organized by
7653 * broadcaster/countersignatory.
7655 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
7656 * as_holder_broadcastable and as_counterparty_broadcastable functions.
7658 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
7660 * A pointer to the opaque Rust object.
7661 * Nearly everywhere, inner must be non-null, however in places where
7662 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7664 LDKnativeDirectedChannelTransactionParameters *inner;
7666 * Indicates that this is the only struct which contains the same pointer.
7667 * Rust functions which take ownership of an object provided via an argument require
7668 * this to be true and invalidate the object pointed to by inner.
7671 } LDKDirectedChannelTransactionParameters;
7676 * A simple newtype for RwLockReadGuard<'a, NetworkGraph>.
7677 * This exists only to make accessing a RwLock<NetworkGraph> possible from
7678 * the C bindings, as it can be done directly in Rust code.
7680 typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
7682 * A pointer to the opaque Rust object.
7683 * Nearly everywhere, inner must be non-null, however in places where
7684 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7686 LDKnativeLockedNetworkGraph *inner;
7688 * Indicates that this is the only struct which contains the same pointer.
7689 * Rust functions which take ownership of an object provided via an argument require
7690 * this to be true and invalidate the object pointed to by inner.
7693 } LDKLockedNetworkGraph;
7698 * Receives and validates network updates from peers,
7699 * stores authentic and relevant data as a network graph.
7700 * This network graph is then used for routing payments.
7701 * Provides interface to help with initial routing sync by
7702 * serving historical announcements.
7704 typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
7706 * A pointer to the opaque Rust object.
7707 * Nearly everywhere, inner must be non-null, however in places where
7708 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7710 LDKnativeNetGraphMsgHandler *inner;
7712 * Indicates that this is the only struct which contains the same pointer.
7713 * Rust functions which take ownership of an object provided via an argument require
7714 * this to be true and invalidate the object pointed to by inner.
7717 } LDKNetGraphMsgHandler;
7722 * FilesystemPersister persists channel data on disk, where each channel's
7723 * data is stored in a file named after its funding outpoint.
7725 * Warning: this module does the best it can with calls to persist data, but it
7726 * can only guarantee that the data is passed to the drive. It is up to the
7727 * drive manufacturers to do the actual persistence properly, which they often
7728 * don't (especially on consumer-grade hardware). Therefore, it is up to the
7729 * user to validate their entire storage stack, to ensure the writes are
7731 * Corollary: especially when dealing with larger amounts of money, it is best
7732 * practice to have multiple channel data backups and not rely only on one
7733 * FilesystemPersister.
7735 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
7737 * A pointer to the opaque Rust object.
7738 * Nearly everywhere, inner must be non-null, however in places where
7739 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7741 LDKnativeFilesystemPersister *inner;
7743 * Indicates that this is the only struct which contains the same pointer.
7744 * Rust functions which take ownership of an object provided via an argument require
7745 * this to be true and invalidate the object pointed to by inner.
7748 } LDKFilesystemPersister;
7750 extern const uintptr_t MAX_BUF_SIZE;
7752 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
7754 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
7756 extern const uint16_t BREAKDOWN_TIMEOUT;
7758 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
7760 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
7763 * Frees the data buffer, if data_is_owned is set and datalen > 0.
7765 void Transaction_free(struct LDKTransaction _res);
7768 * Frees the data pointed to by script_pubkey.
7770 void TxOut_free(struct LDKTxOut _res);
7773 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
7775 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
7778 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
7780 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
7783 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
7785 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
7788 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
7790 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
7793 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
7794 * but with all dynamically-allocated buffers duplicated in new buffers.
7796 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
7799 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
7801 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
7804 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
7806 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
7809 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
7811 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
7814 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
7815 * but with all dynamically-allocated buffers duplicated in new buffers.
7817 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
7820 * Creates a new CResult_SecretKeyErrorZ in the success state.
7822 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
7825 * Creates a new CResult_SecretKeyErrorZ in the error state.
7827 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
7830 * Frees any resources used by the CResult_SecretKeyErrorZ.
7832 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
7835 * Creates a new CResult_PublicKeyErrorZ in the success state.
7837 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
7840 * Creates a new CResult_PublicKeyErrorZ in the error state.
7842 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
7845 * Frees any resources used by the CResult_PublicKeyErrorZ.
7847 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
7850 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
7852 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
7855 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
7857 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
7860 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
7862 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
7865 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
7866 * but with all dynamically-allocated buffers duplicated in new buffers.
7868 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
7871 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
7873 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
7876 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
7878 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
7881 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
7883 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
7886 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
7887 * but with all dynamically-allocated buffers duplicated in new buffers.
7889 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
7892 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
7894 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
7897 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
7899 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
7902 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
7904 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
7907 * Constructs a new COption_u32Z containing a u32
7909 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
7912 * Constructs a new COption_u32Z containing nothing
7914 struct LDKCOption_u32Z COption_u32Z_none(void);
7917 * Frees any resources associated with the u32, if we are in the Some state
7919 void COption_u32Z_free(struct LDKCOption_u32Z _res);
7922 * Creates a new COption_u32Z which has the same data as `orig`
7923 * but with all dynamically-allocated buffers duplicated in new buffers.
7925 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
7928 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
7930 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
7933 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
7935 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
7938 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
7940 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
7943 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
7944 * but with all dynamically-allocated buffers duplicated in new buffers.
7946 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
7949 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
7951 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
7954 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
7956 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
7959 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
7961 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
7964 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
7965 * but with all dynamically-allocated buffers duplicated in new buffers.
7967 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
7970 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
7972 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
7975 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
7977 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
7980 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
7982 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
7985 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
7986 * but with all dynamically-allocated buffers duplicated in new buffers.
7988 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
7991 * Frees the buffer pointed to by `data` if `datalen` is non-0.
7993 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
7996 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
7998 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
8001 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
8003 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
8006 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
8008 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
8011 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
8012 * but with all dynamically-allocated buffers duplicated in new buffers.
8014 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
8017 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
8019 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
8022 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
8024 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
8027 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
8029 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
8032 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
8033 * but with all dynamically-allocated buffers duplicated in new buffers.
8035 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
8038 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
8040 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
8043 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
8045 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
8048 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
8050 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
8053 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
8054 * but with all dynamically-allocated buffers duplicated in new buffers.
8056 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
8059 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
8061 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
8064 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
8066 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
8069 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
8071 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
8074 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
8076 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
8079 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
8081 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
8084 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
8086 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
8089 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
8090 * but with all dynamically-allocated buffers duplicated in new buffers.
8092 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
8095 * Creates a new CResult_StringErrorZ in the success state.
8097 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKCVec_u8Z o);
8100 * Creates a new CResult_StringErrorZ in the error state.
8102 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
8105 * Frees any resources used by the CResult_StringErrorZ.
8107 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
8110 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
8112 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
8115 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
8117 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
8120 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
8122 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
8125 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
8126 * but with all dynamically-allocated buffers duplicated in new buffers.
8128 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
8131 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
8133 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
8136 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
8138 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
8141 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
8143 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
8146 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
8147 * but with all dynamically-allocated buffers duplicated in new buffers.
8149 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
8152 * Creates a new CResult_NoneMonitorUpdateErrorZ in the success state.
8154 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
8157 * Creates a new CResult_NoneMonitorUpdateErrorZ in the error state.
8159 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e);
8162 * Frees any resources used by the CResult_NoneMonitorUpdateErrorZ.
8164 void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res);
8167 * Creates a new CResult_NoneMonitorUpdateErrorZ which has the same data as `orig`
8168 * but with all dynamically-allocated buffers duplicated in new buffers.
8170 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig);
8173 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
8175 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
8178 * Frees any resources used by the C2Tuple_OutPointScriptZ.
8180 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
8183 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
8185 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
8188 * Frees any resources used by the C2Tuple_u32ScriptZ.
8190 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
8193 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8195 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
8198 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
8200 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
8203 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
8205 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
8208 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8210 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
8213 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8215 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
8218 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8220 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
8223 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8225 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
8228 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
8230 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
8233 * Frees any resources used by the C2Tuple_usizeTransactionZ.
8235 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
8238 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8240 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
8243 * Creates a new tuple which has the same data as `orig`
8244 * but with all dynamically-allocated buffers duplicated in new buffers.
8246 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
8249 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
8251 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
8254 * Frees any resources used by the C2Tuple_u32TxOutZ.
8256 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
8259 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8261 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
8264 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
8266 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
8269 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
8271 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
8274 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8276 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
8279 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8281 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
8284 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
8286 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
8289 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
8291 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
8294 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
8296 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
8299 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
8300 * but with all dynamically-allocated buffers duplicated in new buffers.
8302 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
8305 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
8307 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
8310 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
8312 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
8315 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
8317 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
8320 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
8322 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
8325 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
8327 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
8330 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8332 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
8335 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8337 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
8340 * Creates a new CResult_RouteDecodeErrorZ in the success state.
8342 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
8345 * Creates a new CResult_RouteDecodeErrorZ in the error state.
8347 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
8350 * Frees any resources used by the CResult_RouteDecodeErrorZ.
8352 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
8355 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
8356 * but with all dynamically-allocated buffers duplicated in new buffers.
8358 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
8361 * Constructs a new COption_u64Z containing a u64
8363 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
8366 * Constructs a new COption_u64Z containing nothing
8368 struct LDKCOption_u64Z COption_u64Z_none(void);
8371 * Frees any resources associated with the u64, if we are in the Some state
8373 void COption_u64Z_free(struct LDKCOption_u64Z _res);
8376 * Creates a new COption_u64Z which has the same data as `orig`
8377 * but with all dynamically-allocated buffers duplicated in new buffers.
8379 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
8382 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8384 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
8387 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8389 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
8392 * Creates a new CResult_RouteLightningErrorZ in the success state.
8394 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
8397 * Creates a new CResult_RouteLightningErrorZ in the error state.
8399 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
8402 * Frees any resources used by the CResult_RouteLightningErrorZ.
8404 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
8407 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
8408 * but with all dynamically-allocated buffers duplicated in new buffers.
8410 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
8413 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8415 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
8418 * Creates a new CResult_boolLightningErrorZ in the success state.
8420 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
8423 * Creates a new CResult_boolLightningErrorZ in the error state.
8425 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
8428 * Frees any resources used by the CResult_boolLightningErrorZ.
8430 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
8433 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
8434 * but with all dynamically-allocated buffers duplicated in new buffers.
8436 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
8439 * Creates a new tuple which has the same data as `orig`
8440 * but with all dynamically-allocated buffers duplicated in new buffers.
8442 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
8445 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
8447 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
8450 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
8452 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
8455 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8457 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
8460 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8462 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
8465 * Creates a new CResult_NoneLightningErrorZ in the success state.
8467 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
8470 * Creates a new CResult_NoneLightningErrorZ in the error state.
8472 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
8475 * Frees any resources used by the CResult_NoneLightningErrorZ.
8477 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
8480 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
8481 * but with all dynamically-allocated buffers duplicated in new buffers.
8483 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
8486 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8488 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
8491 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8493 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
8496 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
8498 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
8501 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
8503 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
8506 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
8508 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
8511 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
8512 * but with all dynamically-allocated buffers duplicated in new buffers.
8514 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
8517 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
8519 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
8522 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
8524 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
8527 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
8529 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
8532 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
8533 * but with all dynamically-allocated buffers duplicated in new buffers.
8535 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
8538 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
8540 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
8543 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
8545 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
8548 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
8550 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
8553 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
8554 * but with all dynamically-allocated buffers duplicated in new buffers.
8556 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
8559 * Creates a new CResult_TxOutAccessErrorZ in the success state.
8561 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
8564 * Creates a new CResult_TxOutAccessErrorZ in the error state.
8566 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
8569 * Frees any resources used by the CResult_TxOutAccessErrorZ.
8571 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
8574 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
8575 * but with all dynamically-allocated buffers duplicated in new buffers.
8577 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
8580 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ
8582 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
8585 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing
8587 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
8590 * Frees any resources associated with the crate::c_types::derived::C2Tuple_usizeTransactionZ, if we are in the Some state
8592 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
8595 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8597 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
8600 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the success state.
8602 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o);
8605 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the error state.
8607 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
8610 * Frees any resources used by the CResult_DirectionalChannelInfoDecodeErrorZ.
8612 void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res);
8615 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ which has the same data as `orig`
8616 * but with all dynamically-allocated buffers duplicated in new buffers.
8618 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig);
8621 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
8623 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
8626 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
8628 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
8631 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
8633 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
8636 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
8637 * but with all dynamically-allocated buffers duplicated in new buffers.
8639 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
8642 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
8644 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
8647 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
8649 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
8652 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
8654 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
8657 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
8658 * but with all dynamically-allocated buffers duplicated in new buffers.
8660 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
8663 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8665 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
8668 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
8670 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
8673 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
8675 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
8678 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
8680 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
8683 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
8684 * but with all dynamically-allocated buffers duplicated in new buffers.
8686 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
8689 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8691 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
8694 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
8696 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
8699 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
8701 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
8704 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
8706 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
8709 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
8710 * but with all dynamically-allocated buffers duplicated in new buffers.
8712 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
8715 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
8717 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
8720 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
8722 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
8725 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
8727 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
8730 * Creates a new CResult_NetworkGraphDecodeErrorZ which has the same data as `orig`
8731 * but with all dynamically-allocated buffers duplicated in new buffers.
8733 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
8736 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
8738 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
8741 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
8743 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
8746 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
8748 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
8751 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
8753 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
8756 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
8758 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
8761 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
8763 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
8766 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
8768 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
8771 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
8773 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
8776 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
8778 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
8781 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
8783 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
8786 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
8788 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
8791 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
8793 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
8796 * Creates a new CResult_NetAddressu8Z in the success state.
8798 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
8801 * Creates a new CResult_NetAddressu8Z in the error state.
8803 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
8806 * Frees any resources used by the CResult_NetAddressu8Z.
8808 void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
8811 * Creates a new CResult_NetAddressu8Z which has the same data as `orig`
8812 * but with all dynamically-allocated buffers duplicated in new buffers.
8814 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
8817 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the success state.
8819 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
8822 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the error state.
8824 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
8827 * Frees any resources used by the CResult_CResult_NetAddressu8ZDecodeErrorZ.
8829 void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
8832 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ which has the same data as `orig`
8833 * but with all dynamically-allocated buffers duplicated in new buffers.
8835 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
8838 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8840 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
8843 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8845 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
8848 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8850 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
8853 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8855 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
8858 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
8860 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
8863 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
8865 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
8868 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
8870 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
8873 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
8874 * but with all dynamically-allocated buffers duplicated in new buffers.
8876 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
8879 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
8881 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
8884 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
8886 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
8889 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
8891 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
8894 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
8895 * but with all dynamically-allocated buffers duplicated in new buffers.
8897 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
8900 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
8902 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
8905 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
8907 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
8910 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
8912 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
8915 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
8916 * but with all dynamically-allocated buffers duplicated in new buffers.
8918 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
8921 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
8923 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
8926 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
8928 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
8931 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
8933 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
8936 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
8937 * but with all dynamically-allocated buffers duplicated in new buffers.
8939 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
8942 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
8944 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
8947 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
8949 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
8952 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
8954 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
8957 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
8958 * but with all dynamically-allocated buffers duplicated in new buffers.
8960 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
8963 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
8965 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
8968 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
8970 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
8973 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
8975 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
8978 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
8979 * but with all dynamically-allocated buffers duplicated in new buffers.
8981 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
8984 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
8986 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
8989 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
8991 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
8994 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
8996 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
8999 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
9000 * but with all dynamically-allocated buffers duplicated in new buffers.
9002 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
9005 * Creates a new CResult_FundingLockedDecodeErrorZ in the success state.
9007 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o);
9010 * Creates a new CResult_FundingLockedDecodeErrorZ in the error state.
9012 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e);
9015 * Frees any resources used by the CResult_FundingLockedDecodeErrorZ.
9017 void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res);
9020 * Creates a new CResult_FundingLockedDecodeErrorZ which has the same data as `orig`
9021 * but with all dynamically-allocated buffers duplicated in new buffers.
9023 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig);
9026 * Creates a new CResult_InitDecodeErrorZ in the success state.
9028 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
9031 * Creates a new CResult_InitDecodeErrorZ in the error state.
9033 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
9036 * Frees any resources used by the CResult_InitDecodeErrorZ.
9038 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
9041 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
9042 * but with all dynamically-allocated buffers duplicated in new buffers.
9044 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
9047 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
9049 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
9052 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
9054 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
9057 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
9059 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
9062 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
9063 * but with all dynamically-allocated buffers duplicated in new buffers.
9065 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
9068 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
9070 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
9073 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
9075 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
9078 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
9080 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
9083 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
9084 * but with all dynamically-allocated buffers duplicated in new buffers.
9086 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
9089 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
9091 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
9094 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
9096 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
9099 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
9101 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
9104 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
9105 * but with all dynamically-allocated buffers duplicated in new buffers.
9107 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
9110 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
9112 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
9115 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
9117 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
9120 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
9122 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
9125 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
9126 * but with all dynamically-allocated buffers duplicated in new buffers.
9128 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
9131 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
9133 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
9136 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
9138 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
9141 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
9143 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
9146 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
9147 * but with all dynamically-allocated buffers duplicated in new buffers.
9149 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
9152 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
9154 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
9157 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
9159 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
9162 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
9164 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
9167 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
9168 * but with all dynamically-allocated buffers duplicated in new buffers.
9170 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
9173 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
9175 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
9178 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
9180 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
9183 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
9185 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
9188 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
9189 * but with all dynamically-allocated buffers duplicated in new buffers.
9191 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
9194 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
9196 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
9199 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
9201 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
9204 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
9206 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
9209 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
9210 * but with all dynamically-allocated buffers duplicated in new buffers.
9212 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
9215 * Creates a new CResult_PingDecodeErrorZ in the success state.
9217 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
9220 * Creates a new CResult_PingDecodeErrorZ in the error state.
9222 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
9225 * Frees any resources used by the CResult_PingDecodeErrorZ.
9227 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
9230 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
9231 * but with all dynamically-allocated buffers duplicated in new buffers.
9233 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
9236 * Creates a new CResult_PongDecodeErrorZ in the success state.
9238 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
9241 * Creates a new CResult_PongDecodeErrorZ in the error state.
9243 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
9246 * Frees any resources used by the CResult_PongDecodeErrorZ.
9248 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
9251 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
9252 * but with all dynamically-allocated buffers duplicated in new buffers.
9254 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
9257 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
9259 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
9262 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
9264 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
9267 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
9269 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
9272 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
9273 * but with all dynamically-allocated buffers duplicated in new buffers.
9275 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
9278 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
9280 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
9283 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
9285 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
9288 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
9290 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
9293 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
9294 * but with all dynamically-allocated buffers duplicated in new buffers.
9296 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
9299 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
9301 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
9304 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
9306 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
9309 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
9311 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
9314 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
9315 * but with all dynamically-allocated buffers duplicated in new buffers.
9317 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
9320 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
9322 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
9325 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
9327 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
9330 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
9332 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
9335 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
9336 * but with all dynamically-allocated buffers duplicated in new buffers.
9338 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
9341 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
9343 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
9346 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
9348 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
9351 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
9353 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
9356 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
9357 * but with all dynamically-allocated buffers duplicated in new buffers.
9359 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
9362 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
9364 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
9367 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
9369 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
9372 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
9374 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
9377 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
9378 * but with all dynamically-allocated buffers duplicated in new buffers.
9380 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
9383 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
9385 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
9388 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
9390 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
9393 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
9395 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
9398 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
9399 * but with all dynamically-allocated buffers duplicated in new buffers.
9401 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
9404 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
9406 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
9409 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
9411 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
9414 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
9416 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
9419 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
9420 * but with all dynamically-allocated buffers duplicated in new buffers.
9422 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
9425 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
9427 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
9430 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
9432 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
9435 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
9437 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
9440 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
9441 * but with all dynamically-allocated buffers duplicated in new buffers.
9443 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
9446 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
9448 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
9451 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
9453 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
9456 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
9458 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
9461 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
9462 * but with all dynamically-allocated buffers duplicated in new buffers.
9464 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
9467 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
9469 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
9472 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
9474 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
9477 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
9479 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
9482 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
9483 * but with all dynamically-allocated buffers duplicated in new buffers.
9485 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
9488 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
9490 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
9493 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
9495 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
9498 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
9500 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
9503 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
9504 * but with all dynamically-allocated buffers duplicated in new buffers.
9506 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
9509 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
9511 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
9514 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
9516 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
9519 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
9521 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
9524 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
9525 * but with all dynamically-allocated buffers duplicated in new buffers.
9527 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
9530 * Creates a new tuple which has the same data as `orig`
9531 * but with all dynamically-allocated buffers duplicated in new buffers.
9533 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
9536 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
9538 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
9541 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
9543 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
9546 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
9548 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
9551 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
9553 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
9556 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
9558 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
9561 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
9562 * but with all dynamically-allocated buffers duplicated in new buffers.
9564 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
9567 * Creates a new CResult_SignatureNoneZ in the success state.
9569 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
9572 * Creates a new CResult_SignatureNoneZ in the error state.
9574 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
9577 * Frees any resources used by the CResult_SignatureNoneZ.
9579 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
9582 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
9583 * but with all dynamically-allocated buffers duplicated in new buffers.
9585 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
9588 * Creates a new CResult_SignDecodeErrorZ in the success state.
9590 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
9593 * Creates a new CResult_SignDecodeErrorZ in the error state.
9595 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
9598 * Frees any resources used by the CResult_SignDecodeErrorZ.
9600 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
9603 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
9604 * but with all dynamically-allocated buffers duplicated in new buffers.
9606 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
9609 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9611 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
9614 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
9616 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
9619 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
9621 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
9624 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
9626 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
9629 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
9630 * but with all dynamically-allocated buffers duplicated in new buffers.
9632 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
9635 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
9637 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
9640 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
9642 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
9645 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
9647 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
9650 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
9651 * but with all dynamically-allocated buffers duplicated in new buffers.
9653 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
9656 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9658 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
9661 * Creates a new CResult_TransactionNoneZ in the success state.
9663 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
9666 * Creates a new CResult_TransactionNoneZ in the error state.
9668 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
9671 * Frees any resources used by the CResult_TransactionNoneZ.
9673 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
9676 * Creates a new CResult_NoneErrorZ in the success state.
9678 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
9681 * Creates a new CResult_NoneErrorZ in the error state.
9683 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
9686 * Frees any resources used by the CResult_NoneErrorZ.
9688 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
9691 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9693 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
9696 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
9698 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
9701 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
9703 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
9706 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
9708 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
9711 * Creates a new CResult_NoneAPIErrorZ in the success state.
9713 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
9716 * Creates a new CResult_NoneAPIErrorZ in the error state.
9718 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
9721 * Frees any resources used by the CResult_NoneAPIErrorZ.
9723 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
9726 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
9727 * but with all dynamically-allocated buffers duplicated in new buffers.
9729 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
9732 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9734 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
9737 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9739 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
9742 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
9744 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
9747 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
9749 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
9752 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
9754 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
9757 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
9758 * but with all dynamically-allocated buffers duplicated in new buffers.
9760 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
9763 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9765 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
9768 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
9770 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
9773 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
9775 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
9778 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
9780 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
9783 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
9785 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
9788 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
9790 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
9793 * Frees any resources used by the Event
9795 void Event_free(struct LDKEvent this_ptr);
9798 * Creates a copy of the Event
9800 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
9803 * Serialize the Event object into a byte array which can be read by Event_read
9805 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
9808 * Frees any resources used by the MessageSendEvent
9810 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
9813 * Creates a copy of the MessageSendEvent
9815 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
9818 * Calls the free function if one is set
9820 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
9823 * Calls the free function if one is set
9825 void EventsProvider_free(struct LDKEventsProvider this_ptr);
9828 * Frees any resources used by the APIError
9830 void APIError_free(struct LDKAPIError this_ptr);
9833 * Creates a copy of the APIError
9835 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
9838 * Creates a digital signature of a message given a SecretKey, like the node's secret.
9839 * 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.
9840 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
9842 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, struct LDKSecretKey sk);
9845 * Recovers the PublicKey of the signer of the message given the message and the signature.
9847 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
9850 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
9851 * and the PublicKey.
9853 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
9856 * Creates a copy of the Level
9858 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
9861 * Returns the most verbose logging level.
9863 MUST_USE_RES enum LDKLevel Level_max(void);
9866 * Calls the free function if one is set
9868 void Logger_free(struct LDKLogger this_ptr);
9871 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
9873 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
9876 * Confirmations we will wait for before considering the channel locked in.
9877 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
9878 * equivalent limit applied to outbound channels).
9882 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
9885 * Confirmations we will wait for before considering the channel locked in.
9886 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
9887 * equivalent limit applied to outbound channels).
9891 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
9894 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
9895 * the number of blocks we have to punish our counterparty if they broadcast a revoked
9898 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
9899 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
9900 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
9901 * possibly with time in between to RBF the spending transaction).
9903 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
9904 * case of an honest unilateral channel close, which implicitly decrease the economic value of
9907 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
9908 * can tweak config to ask for more security, not less.
9910 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
9913 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
9914 * the number of blocks we have to punish our counterparty if they broadcast a revoked
9917 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
9918 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
9919 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
9920 * possibly with time in between to RBF the spending transaction).
9922 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
9923 * case of an honest unilateral channel close, which implicitly decrease the economic value of
9926 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
9927 * can tweak config to ask for more security, not less.
9929 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
9932 * Set to the smallest value HTLC we will accept to process.
9934 * This value is sent to our counterparty on channel-open and we close the channel any time
9935 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
9937 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
9940 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
9943 * Set to the smallest value HTLC we will accept to process.
9945 * This value is sent to our counterparty on channel-open and we close the channel any time
9946 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
9948 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
9951 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
9954 * Constructs a new ChannelHandshakeConfig given each field
9956 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);
9959 * Creates a copy of the ChannelHandshakeConfig
9961 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
9964 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
9966 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
9969 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
9971 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
9974 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
9975 * only applies to inbound channels.
9979 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9982 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
9983 * only applies to inbound channels.
9987 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9990 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
9991 * you to limit the maximum minimum-size they can require.
9993 * Default value: u64::max_value.
9995 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9998 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
9999 * you to limit the maximum minimum-size they can require.
10001 * Default value: u64::max_value.
10003 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
10006 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
10007 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
10009 * Default value: 0.
10011 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
10014 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
10015 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
10017 * Default value: 0.
10019 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
10022 * The remote node will require we keep a certain amount in direct payment to ourselves at all
10023 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
10024 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
10026 * Default value: u64::max_value.
10028 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
10031 * The remote node will require we keep a certain amount in direct payment to ourselves at all
10032 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
10033 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
10035 * Default value: u64::max_value.
10037 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
10040 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
10041 * time. This allows you to set a minimum such value.
10043 * Default value: 0.
10045 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
10048 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
10049 * time. This allows you to set a minimum such value.
10051 * Default value: 0.
10053 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
10056 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
10057 * required to always be higher than this value so this only applies to HTLC outputs (and
10058 * potentially to-self outputs before any payments have been made).
10059 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
10060 * This setting allows you to set a minimum dust limit for their commitment transactions,
10061 * reflecting the reality that tiny outputs are not considered standard transactions and will
10062 * not propagate through the Bitcoin network.
10064 * Default value: 546, the current dust limit on the Bitcoin network.
10066 uint64_t ChannelHandshakeLimits_get_min_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
10069 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
10070 * required to always be higher than this value so this only applies to HTLC outputs (and
10071 * potentially to-self outputs before any payments have been made).
10072 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
10073 * This setting allows you to set a minimum dust limit for their commitment transactions,
10074 * reflecting the reality that tiny outputs are not considered standard transactions and will
10075 * not propagate through the Bitcoin network.
10077 * Default value: 546, the current dust limit on the Bitcoin network.
10079 void ChannelHandshakeLimits_set_min_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
10082 * Maximum allowed threshold above which outputs will not be generated in their commitment
10084 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
10086 * Default value: u64::max_value.
10088 uint64_t ChannelHandshakeLimits_get_max_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
10091 * Maximum allowed threshold above which outputs will not be generated in their commitment
10093 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
10095 * Default value: u64::max_value.
10097 void ChannelHandshakeLimits_set_max_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
10100 * Before a channel is usable the funding transaction will need to be confirmed by at least a
10101 * certain number of blocks, specified by the node which is not the funder (as the funder can
10102 * assume they aren't going to double-spend themselves).
10103 * This config allows you to set a limit on the maximum amount of time to wait.
10105 * Default value: 144, or roughly one day and only applies to outbound channels.
10107 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
10110 * Before a channel is usable the funding transaction will need to be confirmed by at least a
10111 * certain number of blocks, specified by the node which is not the funder (as the funder can
10112 * assume they aren't going to double-spend themselves).
10113 * This config allows you to set a limit on the maximum amount of time to wait.
10115 * Default value: 144, or roughly one day and only applies to outbound channels.
10117 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
10120 * Set to force the incoming channel to match our announced channel preference in
10123 * Default value: true, to make the default that no announced channels are possible (which is
10124 * appropriate for any nodes which are not online very reliably).
10126 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
10129 * Set to force the incoming channel to match our announced channel preference in
10132 * Default value: true, to make the default that no announced channels are possible (which is
10133 * appropriate for any nodes which are not online very reliably).
10135 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
10138 * Set to the amount of time we're willing to wait to claim money back to us.
10140 * Not checking this value would be a security issue, as our peer would be able to set it to
10141 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
10143 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
10144 * reduce the loss of having useless locked funds (if your peer accepts)
10146 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
10149 * Set to the amount of time we're willing to wait to claim money back to us.
10151 * Not checking this value would be a security issue, as our peer would be able to set it to
10152 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
10154 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
10155 * reduce the loss of having useless locked funds (if your peer accepts)
10157 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
10160 * Constructs a new ChannelHandshakeLimits given each field
10162 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);
10165 * Creates a copy of the ChannelHandshakeLimits
10167 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
10170 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
10172 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
10175 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
10177 void ChannelConfig_free(struct LDKChannelConfig this_obj);
10180 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
10181 * This may be allowed to change at runtime in a later update, however doing so must result in
10182 * update messages sent to notify all nodes of our updated relay fee.
10184 * Default value: 0.
10186 uint32_t ChannelConfig_get_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
10189 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
10190 * This may be allowed to change at runtime in a later update, however doing so must result in
10191 * update messages sent to notify all nodes of our updated relay fee.
10193 * Default value: 0.
10195 void ChannelConfig_set_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
10198 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
10199 * the channel this config applies to.
10201 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
10202 * HTLC balance when a channel appears on-chain whereas
10203 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
10204 * (non-HTLC-encumbered) balance.
10206 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
10207 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
10208 * commitment transaction at least once per this many blocks (minus some margin to allow us
10209 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
10210 * the spending transaction).
10212 * Default value: 72 (12 hours at an average of 6 blocks/hour).
10213 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
10214 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
10216 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
10218 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
10221 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
10222 * the channel this config applies to.
10224 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
10225 * HTLC balance when a channel appears on-chain whereas
10226 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
10227 * (non-HTLC-encumbered) balance.
10229 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
10230 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
10231 * commitment transaction at least once per this many blocks (minus some margin to allow us
10232 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
10233 * the spending transaction).
10235 * Default value: 72 (12 hours at an average of 6 blocks/hour).
10236 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
10237 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
10239 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
10241 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
10244 * Set to announce the channel publicly and notify all nodes that they can route via this
10247 * This should only be set to true for nodes which expect to be online reliably.
10249 * As the node which funds a channel picks this value this will only apply for new outbound
10250 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
10252 * This cannot be changed after the initial channel handshake.
10254 * Default value: false.
10256 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
10259 * Set to announce the channel publicly and notify all nodes that they can route via this
10262 * This should only be set to true for nodes which expect to be online reliably.
10264 * As the node which funds a channel picks this value this will only apply for new outbound
10265 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
10267 * This cannot be changed after the initial channel handshake.
10269 * Default value: false.
10271 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
10274 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
10275 * supports it, they will then enforce the mutual-close output to us matches what we provided
10276 * at intialization, preventing us from closing to an alternate pubkey.
10278 * This is set to true by default to provide a slight increase in security, though ultimately
10279 * any attacker who is able to take control of a channel can just as easily send the funds via
10280 * lightning payments, so we never require that our counterparties support this option.
10282 * This cannot be changed after a channel has been initialized.
10284 * Default value: true.
10286 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
10289 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
10290 * supports it, they will then enforce the mutual-close output to us matches what we provided
10291 * at intialization, preventing us from closing to an alternate pubkey.
10293 * This is set to true by default to provide a slight increase in security, though ultimately
10294 * any attacker who is able to take control of a channel can just as easily send the funds via
10295 * lightning payments, so we never require that our counterparties support this option.
10297 * This cannot be changed after a channel has been initialized.
10299 * Default value: true.
10301 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
10304 * Constructs a new ChannelConfig given each field
10306 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);
10309 * Creates a copy of the ChannelConfig
10311 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
10314 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
10316 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
10319 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
10321 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
10324 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
10326 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
10329 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
10331 void UserConfig_free(struct LDKUserConfig this_obj);
10334 * Channel config that we propose to our counterparty.
10336 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
10339 * Channel config that we propose to our counterparty.
10341 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
10344 * Limits applied to our counterparty's proposed channel config settings.
10346 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
10349 * Limits applied to our counterparty's proposed channel config settings.
10351 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
10354 * Channel config which affects behavior during channel lifetime.
10356 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
10359 * Channel config which affects behavior during channel lifetime.
10361 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
10364 * Constructs a new UserConfig given each field
10366 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);
10369 * Creates a copy of the UserConfig
10371 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
10374 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
10376 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
10379 * Creates a copy of the AccessError
10381 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
10384 * Calls the free function if one is set
10386 void Access_free(struct LDKAccess this_ptr);
10389 * Calls the free function if one is set
10391 void Listen_free(struct LDKListen this_ptr);
10394 * Calls the free function if one is set
10396 void Confirm_free(struct LDKConfirm this_ptr);
10399 * Calls the free function if one is set
10401 void Watch_free(struct LDKWatch this_ptr);
10404 * Calls the free function if one is set
10406 void Filter_free(struct LDKFilter this_ptr);
10409 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
10411 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
10414 * First block where the transaction output may have been spent.
10416 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
10419 * First block where the transaction output may have been spent.
10421 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10424 * Outpoint identifying the transaction output.
10426 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
10429 * Outpoint identifying the transaction output.
10431 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
10434 * Spending condition of the transaction output.
10436 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
10439 * Spending condition of the transaction output.
10441 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
10444 * Constructs a new WatchedOutput given each field
10446 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
10449 * Calls the free function if one is set
10451 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
10454 * Creates a copy of the ConfirmationTarget
10456 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
10459 * Calls the free function if one is set
10461 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
10464 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
10466 void ChainMonitor_free(struct LDKChainMonitor this_obj);
10469 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
10471 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
10472 * will call back to it indicating transactions and outputs of interest. This allows clients to
10473 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
10474 * always need to fetch full blocks absent another means for determining which blocks contain
10475 * transactions relevant to the watched channels.
10477 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
10480 * Constructs a new Watch which calls the relevant methods on this_arg.
10481 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
10483 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
10486 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
10487 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
10489 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
10492 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
10494 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
10497 * The sequence number of this update. Updates *must* be replayed in-order according to this
10498 * sequence number (and updates may panic if they are not). The update_id values are strictly
10499 * increasing and increase by one for each new update, with one exception specified below.
10501 * This sequence number is also used to track up to which points updates which returned
10502 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
10503 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
10505 * The only instance where update_id values are not strictly increasing is the case where we
10506 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
10507 * its docs for more details.
10509 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
10512 * The sequence number of this update. Updates *must* be replayed in-order according to this
10513 * sequence number (and updates may panic if they are not). The update_id values are strictly
10514 * increasing and increase by one for each new update, with one exception specified below.
10516 * This sequence number is also used to track up to which points updates which returned
10517 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
10518 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
10520 * The only instance where update_id values are not strictly increasing is the case where we
10521 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
10522 * its docs for more details.
10524 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
10527 * Creates a copy of the ChannelMonitorUpdate
10529 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
10532 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
10534 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
10537 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
10539 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
10542 * Creates a copy of the ChannelMonitorUpdateErr
10544 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
10547 * Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
10549 void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
10552 * Creates a copy of the MonitorUpdateError
10554 struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
10557 * Frees any resources used by the MonitorEvent
10559 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
10562 * Creates a copy of the MonitorEvent
10564 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
10567 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
10569 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
10572 * Creates a copy of the HTLCUpdate
10574 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
10577 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
10579 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
10582 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
10584 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
10587 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
10589 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
10592 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
10594 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
10597 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
10600 * panics if the given update is not the next update by update_id.
10602 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);
10605 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
10608 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10611 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
10613 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10616 * Gets a list of txids, with their output scripts (in the order they appear in the
10617 * transaction), which we must learn about spends of via block_connected().
10619 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10622 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
10623 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
10624 * have been registered.
10626 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
10629 * Get the list of HTLCs who's status has been updated on chain. This should be called by
10630 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
10632 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10635 * Gets the list of pending events which were generated by previous actions, clearing the list
10638 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
10639 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
10640 * no internal locking in ChannelMonitors.
10642 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10645 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
10646 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
10647 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
10648 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
10649 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
10650 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
10651 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
10652 * out-of-band the other node operator to coordinate with him if option is available to you.
10653 * In any-case, choice is up to the user.
10655 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);
10658 * Processes transactions in a newly connected block, which may result in any of the following:
10659 * - update the monitor's state against resolved HTLCs
10660 * - punish the counterparty in the case of seeing a revoked commitment transaction
10661 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
10662 * - detect settled outputs for later spending
10663 * - schedule and bump any in-flight claims
10665 * Returns any new outputs to watch from `txdata`; after called, these are also included in
10666 * [`get_outputs_to_watch`].
10668 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
10670 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);
10673 * Determines if the disconnected block contained any transactions of interest and updates
10676 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);
10679 * Processes transactions confirmed in a block with the given header and height, returning new
10680 * outputs to watch. See [`block_connected`] for details.
10682 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
10683 * blocks. See [`chain::Confirm`] for calling expectations.
10685 * [`block_connected`]: Self::block_connected
10687 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);
10690 * Processes a transaction that was reorganized out of the chain.
10692 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
10693 * than blocks. See [`chain::Confirm`] for calling expectations.
10695 * [`block_disconnected`]: Self::block_disconnected
10697 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);
10700 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
10701 * [`block_connected`] for details.
10703 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
10704 * blocks. See [`chain::Confirm`] for calling expectations.
10706 * [`block_connected`]: Self::block_connected
10708 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);
10711 * Returns the set of txids that should be monitored for re-organization out of the chain.
10713 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10716 * Calls the free function if one is set
10718 void Persist_free(struct LDKPersist this_ptr);
10721 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
10723 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
10726 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
10728 void OutPoint_free(struct LDKOutPoint this_obj);
10731 * The referenced transaction's txid.
10733 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
10736 * The referenced transaction's txid.
10738 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10741 * The index of the referenced output in its transaction's vout.
10743 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
10746 * The index of the referenced output in its transaction's vout.
10748 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
10751 * Constructs a new OutPoint given each field
10753 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
10756 * Creates a copy of the OutPoint
10758 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
10761 * Convert an `OutPoint` to a lightning channel id.
10763 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
10766 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
10768 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
10771 * Read a OutPoint from a byte array, created by OutPoint_write
10773 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
10776 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
10778 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
10781 * The outpoint which is spendable
10783 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10786 * The outpoint which is spendable
10788 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
10791 * Per commitment point to derive delayed_payment_key by key holder
10793 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10796 * Per commitment point to derive delayed_payment_key by key holder
10798 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10801 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
10802 * the witness_script.
10804 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10807 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
10808 * the witness_script.
10810 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
10813 * The output which is referenced by the given outpoint
10815 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
10818 * The revocation point specific to the commitment transaction which was broadcast. Used to
10819 * derive the witnessScript for this output.
10821 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10824 * The revocation point specific to the commitment transaction which was broadcast. Used to
10825 * derive the witnessScript for this output.
10827 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10830 * Arbitrary identification information returned by a call to
10831 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
10832 * the channel to spend the output.
10834 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
10837 * Arbitrary identification information returned by a call to
10838 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
10839 * the channel to spend the output.
10841 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10844 * The value of the channel which this output originated from, possibly indirectly.
10846 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10849 * The value of the channel which this output originated from, possibly indirectly.
10851 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
10854 * Constructs a new DelayedPaymentOutputDescriptor given each field
10856 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);
10859 * Creates a copy of the DelayedPaymentOutputDescriptor
10861 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
10864 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
10866 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
10869 * The outpoint which is spendable
10871 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10874 * The outpoint which is spendable
10876 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
10879 * The output which is referenced by the given outpoint
10881 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
10884 * Arbitrary identification information returned by a call to
10885 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
10886 * the channel to spend the output.
10888 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
10891 * Arbitrary identification information returned by a call to
10892 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
10893 * the channel to spend the output.
10895 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10898 * The value of the channel which this transactions spends.
10900 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10903 * The value of the channel which this transactions spends.
10905 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
10908 * Constructs a new StaticPaymentOutputDescriptor given each field
10910 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);
10913 * Creates a copy of the StaticPaymentOutputDescriptor
10915 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
10918 * Frees any resources used by the SpendableOutputDescriptor
10920 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
10923 * Creates a copy of the SpendableOutputDescriptor
10925 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
10928 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
10930 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
10933 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
10935 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
10938 * Calls the free function if one is set
10940 void BaseSign_free(struct LDKBaseSign this_ptr);
10943 * Creates a copy of a Sign
10945 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
10948 * Calls the free function if one is set
10950 void Sign_free(struct LDKSign this_ptr);
10953 * Calls the free function if one is set
10955 void KeysInterface_free(struct LDKKeysInterface this_ptr);
10958 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
10960 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
10963 * Private key of anchor tx
10965 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10968 * Private key of anchor tx
10970 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10973 * Holder secret key for blinded revocation pubkey
10975 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10978 * Holder secret key for blinded revocation pubkey
10980 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10983 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
10985 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10988 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
10990 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10993 * Holder secret key used in HTLC tx
10995 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10998 * Holder secret key used in HTLC tx
11000 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
11003 * Holder htlc secret key used in commitment tx htlc outputs
11005 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
11008 * Holder htlc secret key used in commitment tx htlc outputs
11010 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
11015 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
11020 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11023 * Creates a copy of the InMemorySigner
11025 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
11028 * Create a new InMemorySigner
11030 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);
11033 * Counterparty pubkeys.
11034 * Will panic if ready_channel wasn't called.
11036 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
11039 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
11040 * transactions, ie the amount of time that we have to wait to recover our funds if we
11041 * broadcast a transaction.
11042 * Will panic if ready_channel wasn't called.
11044 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
11047 * The contest_delay value specified by us and applied on transactions broadcastable
11048 * by our counterparty, ie the amount of time that they have to wait to recover their funds
11049 * if they broadcast a transaction.
11050 * Will panic if ready_channel wasn't called.
11052 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
11055 * Whether the holder is the initiator
11056 * Will panic if ready_channel wasn't called.
11058 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
11062 * Will panic if ready_channel wasn't called.
11064 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
11067 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
11068 * building transactions.
11070 * Will panic if ready_channel wasn't called.
11072 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
11075 * Sign the single input of spend_tx at index `input_idx` which spends the output
11076 * described by descriptor, returning the witness stack for the input.
11078 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
11079 * or is not spending the outpoint described by `descriptor.outpoint`.
11081 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);
11084 * Sign the single input of spend_tx at index `input_idx` which spends the output
11085 * described by descriptor, returning the witness stack for the input.
11087 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
11088 * is not spending the outpoint described by `descriptor.outpoint`, or does not have a
11089 * sequence set to `descriptor.to_self_delay`.
11091 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);
11094 * Constructs a new BaseSign which calls the relevant methods on this_arg.
11095 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
11097 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
11100 * Constructs a new Sign which calls the relevant methods on this_arg.
11101 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
11103 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
11106 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
11108 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
11111 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
11113 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
11116 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
11118 void KeysManager_free(struct LDKKeysManager this_obj);
11121 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
11122 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
11123 * starting_time isn't strictly required to actually be a time, but it must absolutely,
11124 * without a doubt, be unique to this instance. ie if you start multiple times with the same
11125 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
11126 * simply use the current time (with very high precision).
11128 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
11129 * obviously, starting_time should be unique every time you reload the library - it is only
11130 * used to generate new ephemeral key data (which will be stored by the individual channel if
11133 * Note that the seed is required to recover certain on-chain funds independent of
11134 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
11135 * channel, and some on-chain during-closing funds.
11137 * Note that until the 0.1 release there is no guarantee of backward compatibility between
11138 * versions. Once the library is more fully supported, the docs will be updated to include a
11139 * detailed description of the guarantee.
11141 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
11144 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
11146 * Key derivation parameters are accessible through a per-channel secrets
11147 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
11148 * onchain output detection for which a corresponding delayed_payment_key must be derived.
11150 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]);
11153 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
11154 * output to the given change destination (if sufficient change value remains). The
11155 * transaction will have a feerate, at least, of the given value.
11157 * Returns `Err(())` if the output value is greater than the input value minus required fee or
11158 * if a descriptor was duplicated.
11160 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
11162 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
11163 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
11165 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);
11168 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
11169 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
11171 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
11174 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
11176 void ChannelManager_free(struct LDKChannelManager this_obj);
11179 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
11181 void ChainParameters_free(struct LDKChainParameters this_obj);
11184 * The network for determining the `chain_hash` in Lightning messages.
11186 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
11189 * The network for determining the `chain_hash` in Lightning messages.
11191 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
11194 * The hash and height of the latest block successfully connected.
11196 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
11198 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
11201 * The hash and height of the latest block successfully connected.
11203 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
11205 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
11208 * Constructs a new ChainParameters given each field
11210 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
11213 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
11215 void BestBlock_free(struct LDKBestBlock this_obj);
11218 * Creates a copy of the BestBlock
11220 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
11223 * Returns the best block from the genesis of the given network.
11225 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
11228 * Returns the best block as identified by the given block hash and height.
11230 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
11233 * Returns the best block hash.
11235 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
11238 * Returns the best block height.
11240 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
11243 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
11245 void ChannelDetails_free(struct LDKChannelDetails this_obj);
11248 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
11249 * thereafter this is the txid of the funding transaction xor the funding transaction output).
11250 * Note that this means this value is *not* persistent - it can change once during the
11251 * lifetime of the channel.
11253 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
11256 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
11257 * thereafter this is the txid of the funding transaction xor the funding transaction output).
11258 * Note that this means this value is *not* persistent - it can change once during the
11259 * lifetime of the channel.
11261 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11264 * The position of the funding transaction in the chain. None if the funding transaction has
11265 * not yet been confirmed and the channel fully opened.
11267 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11270 * The position of the funding transaction in the chain. None if the funding transaction has
11271 * not yet been confirmed and the channel fully opened.
11273 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
11276 * The node_id of our counterparty
11278 struct LDKPublicKey ChannelDetails_get_remote_network_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11281 * The node_id of our counterparty
11283 void ChannelDetails_set_remote_network_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11286 * The Features the channel counterparty provided upon last connection.
11287 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
11288 * many routing-relevant features are present in the init context.
11290 struct LDKInitFeatures ChannelDetails_get_counterparty_features(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11293 * The Features the channel counterparty provided upon last connection.
11294 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
11295 * many routing-relevant features are present in the init context.
11297 void ChannelDetails_set_counterparty_features(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
11300 * The value, in satoshis, of this channel as appears in the funding output
11302 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11305 * The value, in satoshis, of this channel as appears in the funding output
11307 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
11310 * The user_id passed in to create_channel, or 0 if the channel was inbound.
11312 uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11315 * The user_id passed in to create_channel, or 0 if the channel was inbound.
11317 void ChannelDetails_set_user_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
11320 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
11321 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
11322 * available for inclusion in new outbound HTLCs). This further does not include any pending
11323 * outgoing HTLCs which are awaiting some other resolution to be sent.
11325 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11328 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
11329 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
11330 * available for inclusion in new outbound HTLCs). This further does not include any pending
11331 * outgoing HTLCs which are awaiting some other resolution to be sent.
11333 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
11336 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
11337 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
11338 * available for inclusion in new inbound HTLCs).
11339 * Note that there are some corner cases not fully handled here, so the actual available
11340 * inbound capacity may be slightly higher than this.
11342 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11345 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
11346 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
11347 * available for inclusion in new inbound HTLCs).
11348 * Note that there are some corner cases not fully handled here, so the actual available
11349 * inbound capacity may be slightly higher than this.
11351 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
11354 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
11355 * the peer is connected, and (c) no monitor update failure is pending resolution.
11357 bool ChannelDetails_get_is_live(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11360 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
11361 * the peer is connected, and (c) no monitor update failure is pending resolution.
11363 void ChannelDetails_set_is_live(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
11366 * Creates a copy of the ChannelDetails
11368 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
11371 * Frees any resources used by the PaymentSendFailure
11373 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
11376 * Creates a copy of the PaymentSendFailure
11378 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
11381 * Constructs a new ChannelManager to hold several channels and route between them.
11383 * This is the main \"logic hub\" for all channel-related actions, and implements
11384 * ChannelMessageHandler.
11386 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
11388 * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
11390 * Users need to notify the new ChannelManager when a new block is connected or
11391 * disconnected using its `block_connected` and `block_disconnected` methods, starting
11392 * from after `params.latest_hash`.
11394 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);
11397 * Gets the current configuration applied to all new channels, as
11399 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
11402 * Creates a new outbound channel to the given remote node and with the given value.
11404 * user_id will be provided back as user_channel_id in FundingGenerationReady events to allow
11405 * tracking of which events correspond with which create_channel call. Note that the
11406 * user_channel_id defaults to 0 for inbound channels, so you may wish to avoid using 0 for
11407 * user_id here. user_id has no meaning inside of LDK, it is simply copied to events and
11408 * otherwise ignored.
11410 * If successful, will generate a SendOpenChannel message event, so you should probably poll
11411 * PeerManager::process_events afterwards.
11413 * Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
11414 * greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
11416 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);
11419 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
11420 * more information.
11422 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
11425 * Gets the list of usable channels, in random order. Useful as an argument to
11426 * get_route to ensure non-announced channels are used.
11428 * These are guaranteed to have their is_live value set to true, see the documentation for
11429 * ChannelDetails::is_live for more info on exactly what the criteria are.
11431 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
11434 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
11435 * will be accepted on the given channel, and after additional timeout/the closing of all
11436 * pending HTLCs, the channel will be closed on chain.
11438 * May generate a SendShutdown message event on success, which should be relayed.
11440 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
11443 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
11444 * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
11446 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
11449 * Force close all channels, immediately broadcasting the latest local commitment transaction
11450 * for each to the chain and rejecting new HTLCs on each.
11452 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
11455 * Sends a payment along a given route.
11457 * Value parameters are provided via the last hop in route, see documentation for RouteHop
11458 * fields for more info.
11460 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
11461 * payment), we don't do anything to stop you! We always try to ensure that if the provided
11462 * next hop knows the preimage to payment_hash they can claim an additional amount as
11463 * specified in the last hop in the route! Thus, you should probably do your own
11464 * payment_preimage tracking (which you should already be doing as they represent \"proof of
11465 * payment\") and prevent double-sends yourself.
11467 * May generate SendHTLCs message(s) event on success, which should be relayed.
11469 * Each path may have a different return value, and PaymentSendValue may return a Vec with
11470 * each entry matching the corresponding-index entry in the route paths, see
11471 * PaymentSendFailure for more info.
11473 * In general, a path may raise:
11474 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
11475 * node public key) is specified.
11476 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
11477 * (including due to previous monitor update failure or new permanent monitor update
11479 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
11480 * relevant updates.
11482 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
11483 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
11484 * different route unless you intend to pay twice!
11486 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
11487 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
11488 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
11489 * must not contain multiple paths as multi-path payments require a recipient-provided
11491 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
11492 * bit set (either as required or as available). If multiple paths are present in the Route,
11493 * we assume the invoice had the basic_mpp feature set.
11495 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);
11498 * Call this upon creation of a funding transaction for the given channel.
11500 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
11501 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
11503 * Panics if a funding transaction has already been provided for this channel.
11505 * May panic if the output found in the funding transaction is duplicative with some other
11506 * channel (note that this should be trivially prevented by using unique funding transaction
11507 * keys per-channel).
11509 * Do NOT broadcast the funding transaction yourself. When we have safely received our
11510 * counterparty's signature the funding transaction will automatically be broadcast via the
11511 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
11513 * Note that this includes RBF or similar transaction replacement strategies - lightning does
11514 * not currently support replacing a funding transaction on an existing channel. Instead,
11515 * create a new channel with a conflicting funding transaction.
11517 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);
11520 * Generates a signed node_announcement from the given arguments and creates a
11521 * BroadcastNodeAnnouncement event. Note that such messages will be ignored unless peers have
11522 * seen a channel_announcement from us (ie unless we have public channels open).
11524 * RGB is a node \"color\" and alias is a printable human-readable string to describe this node
11525 * to humans. They carry no in-protocol meaning.
11527 * addresses represent the set (possibly empty) of socket addresses on which this node accepts
11528 * incoming connections. These will be broadcast to the network, publicly tying these
11529 * addresses together. If you wish to preserve user privacy, addresses should likely contain
11530 * only Tor Onion addresses.
11532 * Panics if addresses is absurdly large (more than 500).
11534 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
11537 * Processes HTLCs which are pending waiting on random forward delay.
11539 * Should only really ever be called in response to a PendingHTLCsForwardable event.
11540 * Will likely generate further events.
11542 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
11545 * If a peer is disconnected we mark any channels with that peer as 'disabled'.
11546 * After some time, if channels are still disabled we need to broadcast a ChannelUpdate
11547 * to inform the network about the uselessness of these channels.
11549 * This method handles all the details, and must be called roughly once per minute.
11551 * Note that in some rare cases this may generate a `chain::Watch::update_channel` call.
11553 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
11556 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
11557 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
11558 * along the path (including in our own channel on which we received it).
11559 * Returns false if no payment was found to fail backwards, true if the process of failing the
11560 * HTLC backwards has been started.
11562 MUST_USE_RES bool ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], struct LDKThirtyTwoBytes payment_secret);
11565 * Provides a payment preimage in response to a PaymentReceived event, returning true and
11566 * generating message events for the net layer to claim the payment, if possible. Thus, you
11567 * should probably kick the net layer to go send messages if this returns true!
11569 * You must specify the expected amounts for this HTLC, and we will only claim HTLCs
11570 * available within a few percent of the expected amount. This is critical for several
11571 * reasons : a) it avoids providing senders with `proof-of-payment` (in the form of the
11572 * payment_preimage without having provided the full value and b) it avoids certain
11573 * privacy-breaking recipient-probing attacks which may reveal payment activity to
11574 * motivated attackers.
11576 * Note that the privacy concerns in (b) are not relevant in payments with a payment_secret
11577 * set. Thus, for such payments we will claim any payments which do not under-pay.
11579 * May panic if called except in response to a PaymentReceived event.
11581 MUST_USE_RES bool ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret, uint64_t expected_amount);
11584 * Gets the node_id held by this ChannelManager
11586 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
11589 * Restores a single, given channel to normal operation after a
11590 * ChannelMonitorUpdateErr::TemporaryFailure was returned from a channel monitor update
11593 * All ChannelMonitor updates up to and including highest_applied_update_id must have been
11594 * fully committed in every copy of the given channels' ChannelMonitors.
11596 * Note that there is no effect to calling with a highest_applied_update_id other than the
11597 * current latest ChannelMonitorUpdate and one call to this function after multiple
11598 * ChannelMonitorUpdateErr::TemporaryFailures is fine. The highest_applied_update_id field
11599 * exists largely only to prevent races between this and concurrent update_monitor calls.
11601 * Thus, the anticipated use is, at a high level:
11602 * 1) You register a chain::Watch with this ChannelManager,
11603 * 2) it stores each update to disk, and begins updating any remote (eg watchtower) copies of
11604 * said ChannelMonitors as it can, returning ChannelMonitorUpdateErr::TemporaryFailures
11605 * any time it cannot do so instantly,
11606 * 3) update(s) are applied to each remote copy of a ChannelMonitor,
11607 * 4) once all remote copies are updated, you call this function with the update_id that
11608 * completed, and once it is the latest the Channel will be re-enabled.
11610 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);
11613 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
11614 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
11616 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
11619 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
11620 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
11622 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
11625 * Constructs a new Listen which calls the relevant methods on this_arg.
11626 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
11628 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
11631 * Constructs a new Confirm which calls the relevant methods on this_arg.
11632 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
11634 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
11637 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
11638 * indicating whether persistence is necessary. Only one listener on
11639 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
11641 * Note that the feature `allow_wallclock_use` must be enabled to use this function.
11643 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
11646 * Blocks until ChannelManager needs to be persisted. Only one listener on
11647 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
11650 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
11653 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
11654 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
11656 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
11659 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
11661 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
11664 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
11666 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
11669 * The keys provider which will give us relevant keys. Some keys will be loaded during
11670 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
11673 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11676 * The keys provider which will give us relevant keys. Some keys will be loaded during
11677 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
11680 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
11683 * The fee_estimator for use in the ChannelManager in the future.
11685 * No calls to the FeeEstimator will be made during deserialization.
11687 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11690 * The fee_estimator for use in the ChannelManager in the future.
11692 * No calls to the FeeEstimator will be made during deserialization.
11694 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
11697 * The chain::Watch for use in the ChannelManager in the future.
11699 * No calls to the chain::Watch will be made during deserialization. It is assumed that
11700 * you have deserialized ChannelMonitors separately and will add them to your
11701 * chain::Watch after deserializing this ChannelManager.
11703 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11706 * The chain::Watch for use in the ChannelManager in the future.
11708 * No calls to the chain::Watch will be made during deserialization. It is assumed that
11709 * you have deserialized ChannelMonitors separately and will add them to your
11710 * chain::Watch after deserializing this ChannelManager.
11712 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
11715 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
11716 * used to broadcast the latest local commitment transactions of channels which must be
11717 * force-closed during deserialization.
11719 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11722 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
11723 * used to broadcast the latest local commitment transactions of channels which must be
11724 * force-closed during deserialization.
11726 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
11729 * The Logger for use in the ChannelManager and which may be used to log information during
11732 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11735 * The Logger for use in the ChannelManager and which may be used to log information during
11738 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
11741 * Default settings used for new channels. Any existing channels will continue to use the
11742 * runtime settings which were stored when the ChannelManager was serialized.
11744 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11747 * Default settings used for new channels. Any existing channels will continue to use the
11748 * runtime settings which were stored when the ChannelManager was serialized.
11750 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
11753 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
11754 * HashMap for you. This is primarily useful for C bindings where it is not practical to
11755 * populate a HashMap directly from C.
11757 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);
11760 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
11762 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
11765 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
11767 void DecodeError_free(struct LDKDecodeError this_obj);
11770 * Creates a copy of the DecodeError
11772 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
11775 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
11777 void Init_free(struct LDKInit this_obj);
11780 * The relevant features which the sender supports
11782 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
11785 * The relevant features which the sender supports
11787 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
11790 * Constructs a new Init given each field
11792 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
11795 * Creates a copy of the Init
11797 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
11800 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
11802 void ErrorMessage_free(struct LDKErrorMessage this_obj);
11805 * The channel ID involved in the error
11807 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
11810 * The channel ID involved in the error
11812 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11815 * A possibly human-readable error description.
11816 * The string should be sanitized before it is used (e.g. emitted to logs
11817 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
11818 * vulnerability in the terminal emulator or the logging subsystem.
11820 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
11823 * A possibly human-readable error description.
11824 * The string should be sanitized before it is used (e.g. emitted to logs
11825 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
11826 * vulnerability in the terminal emulator or the logging subsystem.
11828 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
11831 * Constructs a new ErrorMessage given each field
11833 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg);
11836 * Creates a copy of the ErrorMessage
11838 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
11841 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
11843 void Ping_free(struct LDKPing this_obj);
11846 * The desired response length
11848 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
11851 * The desired response length
11853 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
11856 * The ping packet size.
11857 * This field is not sent on the wire. byteslen zeros are sent.
11859 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
11862 * The ping packet size.
11863 * This field is not sent on the wire. byteslen zeros are sent.
11865 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
11868 * Constructs a new Ping given each field
11870 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
11873 * Creates a copy of the Ping
11875 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
11878 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
11880 void Pong_free(struct LDKPong this_obj);
11883 * The pong packet size.
11884 * This field is not sent on the wire. byteslen zeros are sent.
11886 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
11889 * The pong packet size.
11890 * This field is not sent on the wire. byteslen zeros are sent.
11892 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
11895 * Constructs a new Pong given each field
11897 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
11900 * Creates a copy of the Pong
11902 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
11905 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
11907 void OpenChannel_free(struct LDKOpenChannel this_obj);
11910 * The genesis hash of the blockchain where the channel is to be opened
11912 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
11915 * The genesis hash of the blockchain where the channel is to be opened
11917 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11920 * A temporary channel ID, until the funding outpoint is announced
11922 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
11925 * A temporary channel ID, until the funding outpoint is announced
11927 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11930 * The channel value
11932 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11935 * The channel value
11937 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11940 * The amount to push to the counterparty as part of the open, in milli-satoshi
11942 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11945 * The amount to push to the counterparty as part of the open, in milli-satoshi
11947 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11950 * The threshold below which outputs on transactions broadcast by sender will be omitted
11952 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11955 * The threshold below which outputs on transactions broadcast by sender will be omitted
11957 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11960 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
11962 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11965 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
11967 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11970 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
11972 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11975 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
11977 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11980 * The minimum HTLC size incoming to sender, in milli-satoshi
11982 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11985 * The minimum HTLC size incoming to sender, in milli-satoshi
11987 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11990 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
11992 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11995 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
11997 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
12000 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
12002 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12005 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
12007 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
12010 * The maximum number of inbound HTLCs towards sender
12012 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12015 * The maximum number of inbound HTLCs towards sender
12017 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
12020 * The sender's key controlling the funding transaction
12022 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12025 * The sender's key controlling the funding transaction
12027 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12030 * Used to derive a revocation key for transactions broadcast by counterparty
12032 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12035 * Used to derive a revocation key for transactions broadcast by counterparty
12037 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12040 * A payment key to sender for transactions broadcast by counterparty
12042 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12045 * A payment key to sender for transactions broadcast by counterparty
12047 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12050 * Used to derive a payment key to sender for transactions broadcast by sender
12052 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12055 * Used to derive a payment key to sender for transactions broadcast by sender
12057 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12060 * Used to derive an HTLC payment key to sender
12062 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12065 * Used to derive an HTLC payment key to sender
12067 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12070 * The first to-be-broadcast-by-sender transaction's per commitment point
12072 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12075 * The first to-be-broadcast-by-sender transaction's per commitment point
12077 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12082 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12087 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
12090 * Creates a copy of the OpenChannel
12092 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
12095 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
12097 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
12100 * A temporary channel ID, until the funding outpoint is announced
12102 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
12105 * A temporary channel ID, until the funding outpoint is announced
12107 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12110 * The threshold below which outputs on transactions broadcast by sender will be omitted
12112 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12115 * The threshold below which outputs on transactions broadcast by sender will be omitted
12117 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
12120 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
12122 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12125 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
12127 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
12130 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
12132 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12135 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
12137 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
12140 * The minimum HTLC size incoming to sender, in milli-satoshi
12142 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12145 * The minimum HTLC size incoming to sender, in milli-satoshi
12147 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
12150 * Minimum depth of the funding transaction before the channel is considered open
12152 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12155 * Minimum depth of the funding transaction before the channel is considered open
12157 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
12160 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
12162 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12165 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
12167 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
12170 * The maximum number of inbound HTLCs towards sender
12172 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12175 * The maximum number of inbound HTLCs towards sender
12177 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
12180 * The sender's key controlling the funding transaction
12182 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12185 * The sender's key controlling the funding transaction
12187 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12190 * Used to derive a revocation key for transactions broadcast by counterparty
12192 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12195 * Used to derive a revocation key for transactions broadcast by counterparty
12197 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12200 * A payment key to sender for transactions broadcast by counterparty
12202 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12205 * A payment key to sender for transactions broadcast by counterparty
12207 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12210 * Used to derive a payment key to sender for transactions broadcast by sender
12212 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12215 * Used to derive a payment key to sender for transactions broadcast by sender
12217 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12220 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
12222 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12225 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
12227 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12230 * The first to-be-broadcast-by-sender transaction's per commitment point
12232 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12235 * The first to-be-broadcast-by-sender transaction's per commitment point
12237 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12240 * Creates a copy of the AcceptChannel
12242 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
12245 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
12247 void FundingCreated_free(struct LDKFundingCreated this_obj);
12250 * A temporary channel ID, until the funding is established
12252 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
12255 * A temporary channel ID, until the funding is established
12257 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12260 * The funding transaction ID
12262 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
12265 * The funding transaction ID
12267 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12270 * The specific output index funding this channel
12272 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
12275 * The specific output index funding this channel
12277 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
12280 * The signature of the channel initiator (funder) on the funding transaction
12282 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
12285 * The signature of the channel initiator (funder) on the funding transaction
12287 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
12290 * Constructs a new FundingCreated given each field
12292 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);
12295 * Creates a copy of the FundingCreated
12297 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
12300 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
12302 void FundingSigned_free(struct LDKFundingSigned this_obj);
12307 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
12312 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12315 * The signature of the channel acceptor (fundee) on the funding transaction
12317 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
12320 * The signature of the channel acceptor (fundee) on the funding transaction
12322 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
12325 * Constructs a new FundingSigned given each field
12327 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
12330 * Creates a copy of the FundingSigned
12332 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
12335 * Frees any resources used by the FundingLocked, if is_owned is set and inner is non-NULL.
12337 void FundingLocked_free(struct LDKFundingLocked this_obj);
12342 const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32];
12347 void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12350 * The per-commitment point of the second commitment transaction
12352 struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr);
12355 * The per-commitment point of the second commitment transaction
12357 void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12360 * Constructs a new FundingLocked given each field
12362 MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
12365 * Creates a copy of the FundingLocked
12367 struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
12370 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
12372 void Shutdown_free(struct LDKShutdown this_obj);
12377 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
12382 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12385 * The destination of this peer's funds on closing.
12386 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
12388 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
12391 * The destination of this peer's funds on closing.
12392 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
12394 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
12397 * Constructs a new Shutdown given each field
12399 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
12402 * Creates a copy of the Shutdown
12404 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
12407 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
12409 void ClosingSigned_free(struct LDKClosingSigned this_obj);
12414 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
12419 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12422 * The proposed total fee for the closing transaction
12424 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
12427 * The proposed total fee for the closing transaction
12429 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
12432 * A signature on the closing transaction
12434 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
12437 * A signature on the closing transaction
12439 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
12442 * Constructs a new ClosingSigned given each field
12444 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg);
12447 * Creates a copy of the ClosingSigned
12449 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
12452 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
12454 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
12459 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
12464 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12469 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
12474 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
12477 * The HTLC value in milli-satoshi
12479 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
12482 * The HTLC value in milli-satoshi
12484 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
12487 * The payment hash, the pre-image of which controls HTLC redemption
12489 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
12492 * The payment hash, the pre-image of which controls HTLC redemption
12494 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12497 * The expiry height of the HTLC
12499 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
12502 * The expiry height of the HTLC
12504 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
12507 * Creates a copy of the UpdateAddHTLC
12509 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
12512 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
12514 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
12519 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
12524 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12529 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
12534 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
12537 * The pre-image of the payment hash, allowing HTLC redemption
12539 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
12542 * The pre-image of the payment hash, allowing HTLC redemption
12544 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12547 * Constructs a new UpdateFulfillHTLC given each field
12549 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
12552 * Creates a copy of the UpdateFulfillHTLC
12554 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
12557 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
12559 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
12564 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
12569 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12574 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
12579 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
12582 * Creates a copy of the UpdateFailHTLC
12584 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
12587 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
12589 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
12594 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
12599 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12604 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
12609 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
12614 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
12619 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
12622 * Creates a copy of the UpdateFailMalformedHTLC
12624 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
12627 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
12629 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
12634 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
12639 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12642 * A signature on the commitment transaction
12644 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
12647 * A signature on the commitment transaction
12649 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
12652 * Signatures on the HTLC transactions
12654 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
12657 * Constructs a new CommitmentSigned given each field
12659 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
12662 * Creates a copy of the CommitmentSigned
12664 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
12667 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
12669 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
12674 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
12679 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12682 * The secret corresponding to the per-commitment point
12684 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
12687 * The secret corresponding to the per-commitment point
12689 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12692 * The next sender-broadcast commitment transaction's per-commitment point
12694 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
12697 * The next sender-broadcast commitment transaction's per-commitment point
12699 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12702 * Constructs a new RevokeAndACK given each field
12704 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);
12707 * Creates a copy of the RevokeAndACK
12709 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
12712 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
12714 void UpdateFee_free(struct LDKUpdateFee this_obj);
12719 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
12724 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12727 * Fee rate per 1000-weight of the transaction
12729 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
12732 * Fee rate per 1000-weight of the transaction
12734 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
12737 * Constructs a new UpdateFee given each field
12739 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
12742 * Creates a copy of the UpdateFee
12744 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
12747 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
12749 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
12752 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
12753 * belonging to the recipient
12755 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
12758 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
12759 * belonging to the recipient
12761 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12764 * The sender's per-commitment point for their current commitment transaction
12766 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
12769 * The sender's per-commitment point for their current commitment transaction
12771 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12774 * Constructs a new DataLossProtect given each field
12776 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
12779 * Creates a copy of the DataLossProtect
12781 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
12784 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
12786 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
12791 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
12796 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12799 * The next commitment number for the sender
12801 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
12804 * The next commitment number for the sender
12806 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
12809 * The next commitment number for the recipient
12811 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
12814 * The next commitment number for the recipient
12816 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
12819 * Creates a copy of the ChannelReestablish
12821 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
12824 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
12826 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
12831 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
12836 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12839 * The short channel ID
12841 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
12844 * The short channel ID
12846 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
12849 * A signature by the node key
12851 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
12854 * A signature by the node key
12856 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
12859 * A signature by the funding key
12861 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
12864 * A signature by the funding key
12866 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
12869 * Constructs a new AnnouncementSignatures given each field
12871 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);
12874 * Creates a copy of the AnnouncementSignatures
12876 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
12879 * Frees any resources used by the NetAddress
12881 void NetAddress_free(struct LDKNetAddress this_ptr);
12884 * Creates a copy of the NetAddress
12886 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
12889 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
12891 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
12894 * Read a Result from a byte array, created by Result_write
12896 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
12899 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
12901 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
12904 * The advertised features
12906 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
12909 * The advertised features
12911 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
12914 * A strictly monotonic announcement counter, with gaps allowed
12916 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
12919 * A strictly monotonic announcement counter, with gaps allowed
12921 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
12924 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
12927 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
12930 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
12933 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12936 * An RGB color for UI purposes
12938 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
12941 * An RGB color for UI purposes
12943 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
12946 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
12949 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
12952 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
12955 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12958 * List of addresses on which this node is reachable
12960 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
12963 * Creates a copy of the UnsignedNodeAnnouncement
12965 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
12968 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
12970 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
12973 * The signature by the node key
12975 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
12978 * The signature by the node key
12980 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
12983 * The actual content of the announcement
12985 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
12988 * The actual content of the announcement
12990 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
12993 * Constructs a new NodeAnnouncement given each field
12995 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
12998 * Creates a copy of the NodeAnnouncement
13000 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
13003 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
13005 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
13008 * The advertised channel features
13010 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
13013 * The advertised channel features
13015 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
13018 * The genesis hash of the blockchain where the channel is to be opened
13020 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
13023 * The genesis hash of the blockchain where the channel is to be opened
13025 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13028 * The short channel ID
13030 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
13033 * The short channel ID
13035 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
13038 * One of the two node_ids which are endpoints of this channel
13040 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
13043 * One of the two node_ids which are endpoints of this channel
13045 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13048 * The other of the two node_ids which are endpoints of this channel
13050 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
13053 * The other of the two node_ids which are endpoints of this channel
13055 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13058 * The funding key for the first node
13060 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
13063 * The funding key for the first node
13065 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13068 * The funding key for the second node
13070 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
13073 * The funding key for the second node
13075 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13078 * Creates a copy of the UnsignedChannelAnnouncement
13080 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
13083 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
13085 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
13088 * Authentication of the announcement by the first public node
13090 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
13093 * Authentication of the announcement by the first public node
13095 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
13098 * Authentication of the announcement by the second public node
13100 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
13103 * Authentication of the announcement by the second public node
13105 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
13108 * Proof of funding UTXO ownership by the first public node
13110 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
13113 * Proof of funding UTXO ownership by the first public node
13115 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
13118 * Proof of funding UTXO ownership by the second public node
13120 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
13123 * Proof of funding UTXO ownership by the second public node
13125 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
13128 * The actual announcement
13130 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
13133 * The actual announcement
13135 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
13138 * Constructs a new ChannelAnnouncement given each field
13140 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);
13143 * Creates a copy of the ChannelAnnouncement
13145 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
13148 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
13150 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
13153 * The genesis hash of the blockchain where the channel is to be opened
13155 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
13158 * The genesis hash of the blockchain where the channel is to be opened
13160 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13163 * The short channel ID
13165 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13168 * The short channel ID
13170 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
13173 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
13175 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13178 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
13180 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
13185 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13190 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
13193 * The number of blocks such that if:
13194 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
13195 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
13196 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
13197 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
13198 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
13199 * forwarding. Note that the HTLC sender is the one who originally sets this value when
13200 * constructing the route.
13202 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13205 * The number of blocks such that if:
13206 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
13207 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
13208 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
13209 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
13210 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
13211 * forwarding. Note that the HTLC sender is the one who originally sets this value when
13212 * constructing the route.
13214 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
13217 * The minimum HTLC size incoming to sender, in milli-satoshi
13219 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13222 * The minimum HTLC size incoming to sender, in milli-satoshi
13224 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
13227 * The base HTLC fee charged by sender, in milli-satoshi
13229 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13232 * The base HTLC fee charged by sender, in milli-satoshi
13234 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
13237 * The amount to fee multiplier, in micro-satoshi
13239 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13242 * The amount to fee multiplier, in micro-satoshi
13244 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
13247 * Creates a copy of the UnsignedChannelUpdate
13249 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
13252 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
13254 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
13257 * A signature of the channel update
13259 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
13262 * A signature of the channel update
13264 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
13267 * The actual channel update
13269 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
13272 * The actual channel update
13274 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
13277 * Constructs a new ChannelUpdate given each field
13279 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
13282 * Creates a copy of the ChannelUpdate
13284 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
13287 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
13289 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
13292 * The genesis hash of the blockchain being queried
13294 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
13297 * The genesis hash of the blockchain being queried
13299 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13302 * The height of the first block for the channel UTXOs being queried
13304 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
13307 * The height of the first block for the channel UTXOs being queried
13309 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
13312 * The number of blocks to include in the query results
13314 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
13317 * The number of blocks to include in the query results
13319 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
13322 * Constructs a new QueryChannelRange given each field
13324 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
13327 * Creates a copy of the QueryChannelRange
13329 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
13332 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
13334 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
13337 * The genesis hash of the blockchain being queried
13339 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
13342 * The genesis hash of the blockchain being queried
13344 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13347 * The height of the first block in the range of the reply
13349 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
13352 * The height of the first block in the range of the reply
13354 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
13357 * The number of blocks included in the range of the reply
13359 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
13362 * The number of blocks included in the range of the reply
13364 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
13367 * True when this is the final reply for a query
13369 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
13372 * True when this is the final reply for a query
13374 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
13377 * The short_channel_ids in the channel range
13379 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
13382 * Constructs a new ReplyChannelRange given each field
13384 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);
13387 * Creates a copy of the ReplyChannelRange
13389 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
13392 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
13394 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
13397 * The genesis hash of the blockchain being queried
13399 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
13402 * The genesis hash of the blockchain being queried
13404 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13407 * The short_channel_ids that are being queried
13409 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
13412 * Constructs a new QueryShortChannelIds given each field
13414 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
13417 * Creates a copy of the QueryShortChannelIds
13419 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
13422 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
13424 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
13427 * The genesis hash of the blockchain that was queried
13429 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
13432 * The genesis hash of the blockchain that was queried
13434 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13437 * Indicates if the query recipient maintains up-to-date channel
13438 * information for the chain_hash
13440 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
13443 * Indicates if the query recipient maintains up-to-date channel
13444 * information for the chain_hash
13446 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
13449 * Constructs a new ReplyShortChannelIdsEnd given each field
13451 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
13454 * Creates a copy of the ReplyShortChannelIdsEnd
13456 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
13459 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
13461 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
13464 * The genesis hash of the blockchain for channel and node information
13466 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
13469 * The genesis hash of the blockchain for channel and node information
13471 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13474 * The starting unix timestamp
13476 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
13479 * The starting unix timestamp
13481 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
13484 * The range of information in seconds
13486 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
13489 * The range of information in seconds
13491 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
13494 * Constructs a new GossipTimestampFilter given each field
13496 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
13499 * Creates a copy of the GossipTimestampFilter
13501 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
13504 * Frees any resources used by the ErrorAction
13506 void ErrorAction_free(struct LDKErrorAction this_ptr);
13509 * Creates a copy of the ErrorAction
13511 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
13514 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
13516 void LightningError_free(struct LDKLightningError this_obj);
13519 * A human-readable message describing the error
13521 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
13524 * A human-readable message describing the error
13526 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
13529 * The action which should be taken against the offending peer.
13531 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
13534 * The action which should be taken against the offending peer.
13536 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
13539 * Constructs a new LightningError given each field
13541 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKCVec_u8Z err_arg, struct LDKErrorAction action_arg);
13544 * Creates a copy of the LightningError
13546 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
13549 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
13551 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
13554 * update_add_htlc messages which should be sent
13556 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
13559 * update_fulfill_htlc messages which should be sent
13561 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
13564 * update_fail_htlc messages which should be sent
13566 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
13569 * update_fail_malformed_htlc messages which should be sent
13571 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
13574 * An update_fee message which should be sent
13576 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
13579 * An update_fee message which should be sent
13581 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
13584 * Finally, the commitment_signed message which should be sent
13586 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
13589 * Finally, the commitment_signed message which should be sent
13591 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
13594 * Constructs a new CommitmentUpdate given each field
13596 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);
13599 * Creates a copy of the CommitmentUpdate
13601 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
13604 * Frees any resources used by the HTLCFailChannelUpdate
13606 void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr);
13609 * Creates a copy of the HTLCFailChannelUpdate
13611 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig);
13614 * Calls the free function if one is set
13616 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
13619 * Calls the free function if one is set
13621 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
13624 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
13626 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
13629 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
13631 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
13634 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
13636 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
13639 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
13641 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
13644 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
13646 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
13649 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
13651 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
13654 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
13656 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
13659 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
13661 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
13664 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
13666 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
13669 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
13671 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
13674 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
13676 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
13679 * Read a FundingCreated from a byte array, created by FundingCreated_write
13681 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
13684 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
13686 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
13689 * Read a FundingSigned from a byte array, created by FundingSigned_write
13691 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
13694 * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
13696 struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
13699 * Read a FundingLocked from a byte array, created by FundingLocked_write
13701 struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
13704 * Serialize the Init object into a byte array which can be read by Init_read
13706 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
13709 * Read a Init from a byte array, created by Init_write
13711 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
13714 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
13716 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
13719 * Read a OpenChannel from a byte array, created by OpenChannel_write
13721 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
13724 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
13726 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
13729 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
13731 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
13734 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
13736 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
13739 * Read a Shutdown from a byte array, created by Shutdown_write
13741 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
13744 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
13746 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
13749 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
13751 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
13754 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
13756 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
13759 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
13761 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
13764 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
13766 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
13769 * Read a UpdateFee from a byte array, created by UpdateFee_write
13771 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
13774 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
13776 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
13779 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
13781 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
13784 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
13786 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
13789 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
13791 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
13794 * Serialize the Ping object into a byte array which can be read by Ping_read
13796 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
13799 * Read a Ping from a byte array, created by Ping_write
13801 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
13804 * Serialize the Pong object into a byte array which can be read by Pong_read
13806 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
13809 * Read a Pong from a byte array, created by Pong_write
13811 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
13814 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
13816 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
13819 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
13821 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
13824 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
13826 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
13829 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
13831 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
13834 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
13836 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
13839 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
13841 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
13844 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
13846 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
13849 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
13851 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
13854 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
13856 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
13859 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
13861 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
13864 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
13866 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
13869 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
13871 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
13874 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
13876 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
13879 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
13881 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
13884 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
13886 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
13889 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
13891 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
13894 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
13896 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
13899 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
13901 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
13904 *\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
13906 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
13909 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
13911 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
13914 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
13916 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
13919 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
13921 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
13924 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
13926 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
13929 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
13931 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
13934 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
13936 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
13939 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
13941 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
13944 * Constructs a new IgnoringMessageHandler given each field
13946 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
13949 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
13950 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
13952 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
13955 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
13956 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
13958 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
13961 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
13963 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
13966 * Constructs a new ErroringMessageHandler
13968 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
13971 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
13972 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
13974 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
13977 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
13978 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
13980 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
13983 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
13985 void MessageHandler_free(struct LDKMessageHandler this_obj);
13988 * A message handler which handles messages specific to channels. Usually this is just a
13989 * ChannelManager object or a ErroringMessageHandler.
13991 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
13994 * A message handler which handles messages specific to channels. Usually this is just a
13995 * ChannelManager object or a ErroringMessageHandler.
13997 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
14000 * A message handler which handles messages updating our knowledge of the network channel
14001 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
14003 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
14006 * A message handler which handles messages updating our knowledge of the network channel
14007 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
14009 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
14012 * Constructs a new MessageHandler given each field
14014 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
14017 * Creates a copy of a SocketDescriptor
14019 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
14022 * Calls the free function if one is set
14024 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
14027 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
14029 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
14032 * Used to indicate that we probably can't make any future connections to this peer, implying
14033 * we should go ahead and force-close any channels we have with it.
14035 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
14038 * Used to indicate that we probably can't make any future connections to this peer, implying
14039 * we should go ahead and force-close any channels we have with it.
14041 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
14044 * Constructs a new PeerHandleError given each field
14046 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
14049 * Creates a copy of the PeerHandleError
14051 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
14054 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
14056 void PeerManager_free(struct LDKPeerManager this_obj);
14059 * Constructs a new PeerManager with the given message handlers and node_id secret key
14060 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
14061 * cryptographically secure random bytes.
14063 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);
14066 * Get the list of node ids for peers which have completed the initial handshake.
14068 * For outbound connections, this will be the same as the their_node_id parameter passed in to
14069 * new_outbound_connection, however entries will only appear once the initial handshake has
14070 * completed and we are sure the remote peer has the private key for the given node_id.
14072 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
14075 * Indicates a new outbound connection has been established to a node with the given node_id.
14076 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
14077 * descriptor but must disconnect the connection immediately.
14079 * Returns a small number of bytes to send to the remote node (currently always 50).
14081 * Panics if descriptor is duplicative with some other descriptor which has not yet had a
14082 * socket_disconnected().
14084 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);
14087 * Indicates a new inbound connection has been established.
14089 * May refuse the connection by returning an Err, but will never write bytes to the remote end
14090 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
14091 * call socket_disconnected for the new descriptor but must disconnect the connection
14094 * Panics if descriptor is duplicative with some other descriptor which has not yet had
14095 * socket_disconnected called.
14097 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor);
14100 * Indicates that there is room to write data to the given socket descriptor.
14102 * May return an Err to indicate that the connection should be closed.
14104 * Will most likely call send_data on the descriptor passed in (or the descriptor handed into
14105 * new_*\\_connection) before returning. Thus, be very careful with reentrancy issues! The
14106 * invariants around calling write_buffer_space_avail in case a write did not fully complete
14107 * must still hold - be ready to call write_buffer_space_avail again if a write call generated
14108 * here isn't sufficient! Panics if the descriptor was not previously registered in a
14109 * new_\\*_connection event.
14111 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
14114 * Indicates that data was read from the given socket descriptor.
14116 * May return an Err to indicate that the connection should be closed.
14118 * Will *not* call back into send_data on any descriptors to avoid reentrancy complexity.
14119 * Thus, however, you almost certainly want to call process_events() after any read_event to
14120 * generate send_data calls to handle responses.
14122 * If Ok(true) is returned, further read_events should not be triggered until a send_data call
14123 * on this file descriptor has resume_read set (preventing DoS issues in the send buffer).
14125 * Panics if the descriptor was not previously registered in a new_*_connection event.
14127 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);
14130 * Checks for any events generated by our handlers and processes them. Includes sending most
14131 * response messages as well as messages generated by calls to handler functions directly (eg
14132 * functions like ChannelManager::process_pending_htlc_forward or send_payment).
14134 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
14137 * Indicates that the given socket descriptor's connection is now closed.
14139 * This must only be called if the socket has been disconnected by the peer or your own
14140 * decision to disconnect it and must NOT be called in any case where other parts of this
14141 * library (eg PeerHandleError, explicit disconnect_socket calls) instruct you to disconnect
14144 * Panics if the descriptor was not previously registered in a successful new_*_connection event.
14146 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
14149 * Disconnect a peer given its node id.
14151 * Set no_connection_possible to true to prevent any further connection with this peer,
14152 * force-closing any channels we have with it.
14154 * If a peer is connected, this will call `disconnect_socket` on the descriptor for the peer,
14155 * so be careful about reentrancy issues.
14157 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
14160 * This function should be called roughly once every 30 seconds.
14161 * It will send pings to each peer and disconnect those which did not respond to the last round of pings.
14162 * Will most likely call send_data on all of the registered descriptors, thus, be very careful with reentrancy issues!
14164 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
14167 * Build the commitment secret from the seed and the commitment number
14169 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
14172 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
14173 * from the base secret and the per_commitment_point.
14175 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
14176 * generated (ie our own).
14178 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
14181 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
14182 * from the base point and the per_commitment_key. This is the public equivalent of
14183 * derive_private_key - using only public keys to derive a public key instead of private keys.
14185 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
14186 * generated (ie our own).
14188 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
14191 * Derives a per-commitment-transaction revocation key from its constituent parts.
14193 * Only the cheating participant owns a valid witness to propagate a revoked
14194 * commitment transaction, thus per_commitment_secret always come from cheater
14195 * and revocation_base_secret always come from punisher, which is the broadcaster
14196 * of the transaction spending with this key knowledge.
14198 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
14199 * generated (ie our own).
14201 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
14204 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
14205 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
14206 * public key instead of private keys.
14208 * Only the cheating participant owns a valid witness to propagate a revoked
14209 * commitment transaction, thus per_commitment_point always come from cheater
14210 * and revocation_base_point always come from punisher, which is the broadcaster
14211 * of the transaction spending with this key knowledge.
14213 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
14214 * generated (ie our own).
14216 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
14219 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
14221 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
14224 * The broadcaster's per-commitment public key which was used to derive the other keys.
14226 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
14229 * The broadcaster's per-commitment public key which was used to derive the other keys.
14231 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14234 * The revocation key which is used to allow the broadcaster of the commitment
14235 * transaction to provide their counterparty the ability to punish them if they broadcast
14238 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
14241 * The revocation key which is used to allow the broadcaster of the commitment
14242 * transaction to provide their counterparty the ability to punish them if they broadcast
14245 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14248 * Broadcaster's HTLC Key
14250 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
14253 * Broadcaster's HTLC Key
14255 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14258 * Countersignatory's HTLC Key
14260 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
14263 * Countersignatory's HTLC Key
14265 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14268 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
14270 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
14273 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
14275 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14278 * Constructs a new TxCreationKeys given each field
14280 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);
14283 * Creates a copy of the TxCreationKeys
14285 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
14288 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
14290 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
14293 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
14295 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
14298 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
14300 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
14303 * The public key which is used to sign all commitment transactions, as it appears in the
14304 * on-chain channel lock-in 2-of-2 multisig output.
14306 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
14309 * The public key which is used to sign all commitment transactions, as it appears in the
14310 * on-chain channel lock-in 2-of-2 multisig output.
14312 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14315 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
14316 * revocation keys. This is combined with the per-commitment-secret generated by the
14317 * counterparty to create a secret which the counterparty can reveal to revoke previous
14320 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
14323 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
14324 * revocation keys. This is combined with the per-commitment-secret generated by the
14325 * counterparty to create a secret which the counterparty can reveal to revoke previous
14328 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14331 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
14332 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
14333 * static across every commitment transaction.
14335 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
14338 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
14339 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
14340 * static across every commitment transaction.
14342 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14345 * The base point which is used (with derive_public_key) to derive a per-commitment payment
14346 * public key which receives non-HTLC-encumbered funds which are only available for spending
14347 * after some delay (or can be claimed via the revocation path).
14349 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
14352 * The base point which is used (with derive_public_key) to derive a per-commitment payment
14353 * public key which receives non-HTLC-encumbered funds which are only available for spending
14354 * after some delay (or can be claimed via the revocation path).
14356 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14359 * The base point which is used (with derive_public_key) to derive a per-commitment public key
14360 * which is used to encumber HTLC-in-flight outputs.
14362 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
14365 * The base point which is used (with derive_public_key) to derive a per-commitment public key
14366 * which is used to encumber HTLC-in-flight outputs.
14368 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14371 * Constructs a new ChannelPublicKeys given each field
14373 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);
14376 * Creates a copy of the ChannelPublicKeys
14378 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
14381 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
14383 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
14386 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
14388 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
14391 * Create per-state keys from channel base points and the per-commitment point.
14392 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
14394 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);
14397 * Generate per-state keys from channel static keys.
14398 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
14400 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);
14403 * A script either spendable by the revocation
14404 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
14405 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
14407 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
14410 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
14412 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
14415 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
14416 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
14417 * need to compare this value to whether the commitment transaction in question is that of
14418 * the counterparty or our own.
14420 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
14423 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
14424 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
14425 * need to compare this value to whether the commitment transaction in question is that of
14426 * the counterparty or our own.
14428 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
14431 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
14432 * this divided by 1000.
14434 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
14437 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
14438 * this divided by 1000.
14440 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
14443 * The CLTV lock-time at which this HTLC expires.
14445 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
14448 * The CLTV lock-time at which this HTLC expires.
14450 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
14453 * The hash of the preimage which unlocks this HTLC.
14455 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
14458 * The hash of the preimage which unlocks this HTLC.
14460 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14463 * The position within the commitment transactions' outputs. This may be None if the value is
14464 * below the dust limit (in which case no output appears in the commitment transaction and the
14465 * value is spent to additional transaction fees).
14467 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
14470 * The position within the commitment transactions' outputs. This may be None if the value is
14471 * below the dust limit (in which case no output appears in the commitment transaction and the
14472 * value is spent to additional transaction fees).
14474 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
14477 * Constructs a new HTLCOutputInCommitment given each field
14479 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);
14482 * Creates a copy of the HTLCOutputInCommitment
14484 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
14487 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
14489 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
14492 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
14494 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
14497 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
14498 * does not need to have its previous_output_index filled.
14500 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys);
14503 * Gets the redeemscript for a funding output from the two funding public keys.
14504 * Note that the order of funding public keys does not matter.
14506 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
14509 * panics if htlc.transaction_output_index.is_none()!
14511 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);
14514 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
14516 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
14519 * Holder public keys
14521 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14524 * Holder public keys
14526 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
14529 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
14531 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14534 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
14536 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
14539 * Whether the holder is the initiator of this channel.
14540 * This is an input to the commitment number obscure factor computation.
14542 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14545 * Whether the holder is the initiator of this channel.
14546 * This is an input to the commitment number obscure factor computation.
14548 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
14551 * The late-bound counterparty channel transaction parameters.
14552 * These parameters are populated at the point in the protocol where the counterparty provides them.
14554 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14557 * The late-bound counterparty channel transaction parameters.
14558 * These parameters are populated at the point in the protocol where the counterparty provides them.
14560 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
14563 * The late-bound funding outpoint
14565 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14568 * The late-bound funding outpoint
14570 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
14573 * Constructs a new ChannelTransactionParameters given each field
14575 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);
14578 * Creates a copy of the ChannelTransactionParameters
14580 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
14583 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
14585 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
14588 * Counter-party public keys
14590 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
14593 * Counter-party public keys
14595 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
14598 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
14600 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
14603 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
14605 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
14608 * Constructs a new CounterpartyChannelTransactionParameters given each field
14610 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
14613 * Creates a copy of the CounterpartyChannelTransactionParameters
14615 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
14618 * Whether the late bound parameters are populated.
14620 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
14623 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
14624 * given that the holder is the broadcaster.
14626 * self.is_populated() must be true before calling this function.
14628 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
14631 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
14632 * given that the counterparty is the broadcaster.
14634 * self.is_populated() must be true before calling this function.
14636 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
14639 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
14641 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
14644 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
14646 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
14649 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
14651 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
14654 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
14656 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
14659 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
14661 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
14664 * Get the channel pubkeys for the broadcaster
14666 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14669 * Get the channel pubkeys for the countersignatory
14671 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14674 * Get the contest delay applicable to the transactions.
14675 * Note that the contest delay was selected by the countersignatory.
14677 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14680 * Whether the channel is outbound from the broadcaster.
14682 * The boolean representing the side that initiated the channel is
14683 * an input to the commitment number obscure factor computation.
14685 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14688 * The funding outpoint
14690 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14693 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
14695 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
14698 * Our counterparty's signature for the transaction
14700 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
14703 * Our counterparty's signature for the transaction
14705 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
14708 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
14710 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
14713 * Creates a copy of the HolderCommitmentTransaction
14715 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
14718 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
14720 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
14723 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
14725 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
14728 * Create a new holder transaction with the given counterparty signatures.
14729 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
14731 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);
14734 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
14736 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
14739 * The commitment transaction
14741 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
14744 * The commitment transaction
14746 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
14749 * The txid for the commitment transaction.
14751 * This is provided as a performance optimization, instead of calling transaction.txid()
14754 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
14757 * The txid for the commitment transaction.
14759 * This is provided as a performance optimization, instead of calling transaction.txid()
14762 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14765 * Constructs a new BuiltCommitmentTransaction given each field
14767 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
14770 * Creates a copy of the BuiltCommitmentTransaction
14772 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
14775 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
14777 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
14780 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
14782 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
14785 * Get the SIGHASH_ALL sighash value of the transaction.
14787 * This can be used to verify a signature.
14789 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);
14792 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
14793 * because we are about to broadcast a holder transaction.
14795 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);
14798 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
14800 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
14803 * Creates a copy of the CommitmentTransaction
14805 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
14808 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
14810 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
14813 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
14815 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
14818 * The backwards-counting commitment number
14820 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14823 * The value to be sent to the broadcaster
14825 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14828 * The value to be sent to the counterparty
14830 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14833 * The feerate paid per 1000-weight-unit in this commitment transaction.
14835 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14838 * Trust our pre-built transaction and derived transaction creation public keys.
14840 * Applies a wrapper which allows access to these fields.
14842 * This should only be used if you fully trust the builder of this object. It should not
14843 *\tbe used by an external signer - instead use the verify function.
14845 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14848 * Verify our pre-built transaction and derived transaction creation public keys.
14850 * Applies a wrapper which allows access to these fields.
14852 * An external validating signer must call this method before signing
14853 * or using the built transaction.
14855 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);
14858 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
14860 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
14863 * The transaction ID of the built Bitcoin transaction
14865 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
14868 * The pre-built Bitcoin commitment transaction
14870 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
14873 * The pre-calculated transaction creation public keys.
14875 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
14878 * Get a signature for each HTLC which was included in the commitment transaction (ie for
14879 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
14881 * The returned Vec has one entry for each HTLC, and in the same order.
14883 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);
14886 * Get the transaction number obscure factor
14888 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
14891 * Creates a copy of the InitFeatures
14893 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
14896 * Creates a copy of the NodeFeatures
14898 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
14901 * Creates a copy of the ChannelFeatures
14903 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
14906 * Creates a copy of the InvoiceFeatures
14908 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
14911 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
14913 void InitFeatures_free(struct LDKInitFeatures this_obj);
14916 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
14918 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
14921 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
14923 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
14926 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
14928 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
14931 * Create a blank Features with no features set
14933 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
14936 * Creates a Features with the bits set which are known by the implementation
14938 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
14941 * Create a blank Features with no features set
14943 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
14946 * Creates a Features with the bits set which are known by the implementation
14948 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
14951 * Create a blank Features with no features set
14953 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
14956 * Creates a Features with the bits set which are known by the implementation
14958 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
14961 * Create a blank Features with no features set
14963 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
14966 * Creates a Features with the bits set which are known by the implementation
14968 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
14971 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
14973 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
14976 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
14978 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
14981 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
14983 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
14986 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
14988 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
14991 * Read a InitFeatures from a byte array, created by InitFeatures_write
14993 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
14996 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
14998 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
15001 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
15003 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
15006 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
15008 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
15011 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
15013 void RouteHop_free(struct LDKRouteHop this_obj);
15016 * The node_id of the node at this hop.
15018 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
15021 * The node_id of the node at this hop.
15023 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15026 * The node_announcement features of the node at this hop. For the last hop, these may be
15027 * amended to match the features present in the invoice this node generated.
15029 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
15032 * The node_announcement features of the node at this hop. For the last hop, these may be
15033 * amended to match the features present in the invoice this node generated.
15035 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
15038 * The channel that should be used from the previous hop to reach this node.
15040 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
15043 * The channel that should be used from the previous hop to reach this node.
15045 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
15048 * The channel_announcement features of the channel that should be used from the previous hop
15049 * to reach this node.
15051 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
15054 * The channel_announcement features of the channel that should be used from the previous hop
15055 * to reach this node.
15057 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
15060 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
15061 * For the last hop, this should be the full value of the payment (might be more than
15062 * requested if we had to match htlc_minimum_msat).
15064 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
15067 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
15068 * For the last hop, this should be the full value of the payment (might be more than
15069 * requested if we had to match htlc_minimum_msat).
15071 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
15074 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
15075 * expected at the destination, in excess of the current block height.
15077 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
15080 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
15081 * expected at the destination, in excess of the current block height.
15083 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
15086 * Constructs a new RouteHop given each field
15088 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);
15091 * Creates a copy of the RouteHop
15093 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
15096 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
15098 void Route_free(struct LDKRoute this_obj);
15101 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
15102 * last RouteHop in each path must be the same.
15103 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
15104 * destination. Thus, this must always be at least length one. While the maximum length of any
15105 * given path is variable, keeping the length of any path to less than 20 should currently
15106 * ensure it is viable.
15108 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
15111 * Constructs a new Route given each field
15113 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
15116 * Creates a copy of the Route
15118 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
15121 * Serialize the Route object into a byte array which can be read by Route_read
15123 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
15126 * Read a Route from a byte array, created by Route_write
15128 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
15131 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
15133 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
15136 * The node_id of the non-target end of the route
15138 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
15141 * The node_id of the non-target end of the route
15143 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15146 * The short_channel_id of this channel
15148 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
15151 * The short_channel_id of this channel
15153 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
15156 * The fees which must be paid to use this channel
15158 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
15161 * The fees which must be paid to use this channel
15163 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
15166 * The difference in CLTV values between this node and the next node.
15168 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
15171 * The difference in CLTV values between this node and the next node.
15173 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
15176 * The minimum value, in msat, which must be relayed to the next hop.
15178 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
15181 * The minimum value, in msat, which must be relayed to the next hop.
15183 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
15186 * The maximum value in msat available for routing with a single HTLC.
15188 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
15191 * The maximum value in msat available for routing with a single HTLC.
15193 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
15196 * Constructs a new RouteHintHop given each field
15198 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);
15201 * Creates a copy of the RouteHintHop
15203 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
15206 * Gets a route from us (payer) to the given target node (payee).
15208 * If the payee provided features in their invoice, they should be provided via payee_features.
15209 * Without this, MPP will only be used if the payee's features are available in the network graph.
15211 * Extra routing hops between known nodes and the target will be used if they are included in
15214 * If some channels aren't announced, it may be useful to fill in a first_hops with the
15215 * results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
15216 * view of our local channels (from net_graph_msg_handler) will be ignored, and only those
15217 * in first_hops will be used.
15219 * Panics if first_hops contains channels without short_channel_ids
15220 * (ChannelManager::list_usable_channels will never include such channels).
15222 * The fees on channels from us to next-hops are ignored (as they are assumed to all be
15223 * equal), however the enabled/disabled bit on such channels as well as the
15224 * htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
15226 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);
15229 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
15231 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
15234 * Creates a copy of the NetworkGraph
15236 struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
15239 * Frees any resources used by the LockedNetworkGraph, if is_owned is set and inner is non-NULL.
15241 void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj);
15244 * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
15246 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
15249 * Creates a new tracker of the actual state of the network of channels and nodes,
15250 * assuming a fresh network graph.
15251 * Chain monitor is used to make sure announced channels exist on-chain,
15252 * channel data is correct, and that the announcement is signed with
15253 * channel owners' keys.
15255 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger);
15258 * Creates a new tracker of the actual state of the network of channels and nodes,
15259 * assuming an existing Network Graph.
15261 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph);
15264 * Adds a provider used to check new announcements. Does not affect
15265 * existing announcements unless they are updated.
15266 * Add, update or remove the provider would replace the current one.
15268 void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKAccess *chain_access);
15271 * Take a read lock on the network_graph and return it in the C-bindings
15272 * newtype helper. This is likely only useful when called via the C
15273 * bindings as you can call `self.network_graph.read().unwrap()` in Rust
15276 MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
15279 * Get a reference to the NetworkGraph which this read-lock contains.
15281 MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg);
15284 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
15285 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
15287 struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
15290 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
15291 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
15293 struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
15296 * Frees any resources used by the DirectionalChannelInfo, if is_owned is set and inner is non-NULL.
15298 void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_obj);
15301 * When the last update to the channel direction was issued.
15302 * Value is opaque, as set in the announcement.
15304 uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15307 * When the last update to the channel direction was issued.
15308 * Value is opaque, as set in the announcement.
15310 void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val);
15313 * Whether the channel can be currently used for payments (in this one direction).
15315 bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15318 * Whether the channel can be currently used for payments (in this one direction).
15320 void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, bool val);
15323 * The difference in CLTV values that you must have when routing through this channel.
15325 uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15328 * The difference in CLTV values that you must have when routing through this channel.
15330 void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint16_t val);
15333 * The minimum value, which must be relayed to the next hop via the channel
15335 uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15338 * The minimum value, which must be relayed to the next hop via the channel
15340 void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val);
15343 * The maximum value which may be relayed to the next hop via the channel.
15345 struct LDKCOption_u64Z DirectionalChannelInfo_get_htlc_maximum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15348 * The maximum value which may be relayed to the next hop via the channel.
15350 void DirectionalChannelInfo_set_htlc_maximum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
15353 * Fees charged when the channel is used for routing
15355 struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15358 * Fees charged when the channel is used for routing
15360 void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
15363 * Most recent update for the channel received from the network
15364 * Mostly redundant with the data we store in fields explicitly.
15365 * Everything else is useful only for sending out for initial routing sync.
15366 * Not stored if contains excess data to prevent DoS.
15368 struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15371 * Most recent update for the channel received from the network
15372 * Mostly redundant with the data we store in fields explicitly.
15373 * Everything else is useful only for sending out for initial routing sync.
15374 * Not stored if contains excess data to prevent DoS.
15376 void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
15379 * Constructs a new DirectionalChannelInfo given each field
15381 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);
15384 * Creates a copy of the DirectionalChannelInfo
15386 struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig);
15389 * Serialize the DirectionalChannelInfo object into a byte array which can be read by DirectionalChannelInfo_read
15391 struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj);
15394 * Read a DirectionalChannelInfo from a byte array, created by DirectionalChannelInfo_write
15396 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser);
15399 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
15401 void ChannelInfo_free(struct LDKChannelInfo this_obj);
15404 * Protocol features of a channel communicated during its announcement
15406 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15409 * Protocol features of a channel communicated during its announcement
15411 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
15414 * Source node of the first direction of a channel
15416 struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15419 * Source node of the first direction of a channel
15421 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15424 * Details about the first direction of a channel
15426 struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15429 * Details about the first direction of a channel
15431 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
15434 * Source node of the second direction of a channel
15436 struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15439 * Source node of the second direction of a channel
15441 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15444 * Details about the second direction of a channel
15446 struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15449 * Details about the second direction of a channel
15451 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
15454 * The channel capacity as seen on-chain, if chain lookup is available.
15456 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15459 * The channel capacity as seen on-chain, if chain lookup is available.
15461 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
15464 * An initial announcement of the channel
15465 * Mostly redundant with the data we store in fields explicitly.
15466 * Everything else is useful only for sending out for initial routing sync.
15467 * Not stored if contains excess data to prevent DoS.
15469 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15472 * An initial announcement of the channel
15473 * Mostly redundant with the data we store in fields explicitly.
15474 * Everything else is useful only for sending out for initial routing sync.
15475 * Not stored if contains excess data to prevent DoS.
15477 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
15480 * Constructs a new ChannelInfo given each field
15482 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);
15485 * Creates a copy of the ChannelInfo
15487 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
15490 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
15492 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
15495 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
15497 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
15500 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
15502 void RoutingFees_free(struct LDKRoutingFees this_obj);
15505 * Flat routing fee in satoshis
15507 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
15510 * Flat routing fee in satoshis
15512 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
15515 * Liquidity-based routing fee in millionths of a routed amount.
15516 * In other words, 10000 is 1%.
15518 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
15521 * Liquidity-based routing fee in millionths of a routed amount.
15522 * In other words, 10000 is 1%.
15524 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
15527 * Constructs a new RoutingFees given each field
15529 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
15532 * Creates a copy of the RoutingFees
15534 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
15537 * Read a RoutingFees from a byte array, created by RoutingFees_write
15539 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
15542 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
15544 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
15547 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
15549 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
15552 * Protocol features the node announced support for
15554 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
15557 * Protocol features the node announced support for
15559 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
15562 * When the last known update to the node state was issued.
15563 * Value is opaque, as set in the announcement.
15565 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
15568 * When the last known update to the node state was issued.
15569 * Value is opaque, as set in the announcement.
15571 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
15574 * Color assigned to the node
15576 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
15579 * Color assigned to the node
15581 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
15584 * Moniker assigned to the node.
15585 * May be invalid or malicious (eg control chars),
15586 * should not be exposed to the user.
15588 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
15591 * Moniker assigned to the node.
15592 * May be invalid or malicious (eg control chars),
15593 * should not be exposed to the user.
15595 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15598 * Internet-level addresses via which one can connect to the node
15600 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
15603 * An initial announcement of the node
15604 * Mostly redundant with the data we store in fields explicitly.
15605 * Everything else is useful only for sending out for initial routing sync.
15606 * Not stored if contains excess data to prevent DoS.
15608 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
15611 * An initial announcement of the node
15612 * Mostly redundant with the data we store in fields explicitly.
15613 * Everything else is useful only for sending out for initial routing sync.
15614 * Not stored if contains excess data to prevent DoS.
15616 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
15619 * Constructs a new NodeAnnouncementInfo given each field
15621 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);
15624 * Creates a copy of the NodeAnnouncementInfo
15626 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
15629 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
15631 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
15634 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
15636 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
15639 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
15641 void NodeInfo_free(struct LDKNodeInfo this_obj);
15644 * All valid channels a node has announced
15646 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
15649 * Lowest fees enabling routing via any of the enabled, known channels to a node.
15650 * The two fields (flat and proportional fee) are independent,
15651 * meaning they don't have to refer to the same channel.
15653 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
15656 * Lowest fees enabling routing via any of the enabled, known channels to a node.
15657 * The two fields (flat and proportional fee) are independent,
15658 * meaning they don't have to refer to the same channel.
15660 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
15663 * More information about a node from node_announcement.
15664 * Optional because we store a Node entry after learning about it from
15665 * a channel announcement, but before receiving a node announcement.
15667 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
15670 * More information about a node from node_announcement.
15671 * Optional because we store a Node entry after learning about it from
15672 * a channel announcement, but before receiving a node announcement.
15674 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
15677 * Constructs a new NodeInfo given each field
15679 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
15682 * Creates a copy of the NodeInfo
15684 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
15687 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
15689 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
15692 * Read a NodeInfo from a byte array, created by NodeInfo_write
15694 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
15697 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
15699 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
15702 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
15704 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
15707 * Creates a new, empty, network graph.
15709 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
15712 * For an already known node (from channel announcements), update its stored properties from a
15713 * given node announcement.
15715 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
15716 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
15717 * routing messages from a source using a protocol other than the lightning P2P protocol.
15719 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
15722 * For an already known node (from channel announcements), update its stored properties from a
15723 * given node announcement without verifying the associated signatures. Because we aren't
15724 * given the associated signatures here we cannot relay the node announcement to any of our
15727 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
15730 * Store or update channel info from a channel announcement.
15732 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
15733 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
15734 * routing messages from a source using a protocol other than the lightning P2P protocol.
15736 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
15737 * the corresponding UTXO exists on chain and is correctly-formatted.
15739 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);
15742 * Store or update channel info from a channel announcement without verifying the associated
15743 * signatures. Because we aren't given the associated signatures here we cannot relay the
15744 * channel announcement to any of our peers.
15746 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
15747 * the corresponding UTXO exists on chain and is correctly-formatted.
15749 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);
15752 * Close a channel if a corresponding HTLC fail was sent.
15753 * If permanent, removes a channel from the local storage.
15754 * May cause the removal of nodes too, if this was their last channel.
15755 * If not permanent, makes channels unavailable for routing.
15757 void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
15760 * For an already known (from announcement) channel, update info about one of the directions
15763 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
15764 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
15765 * routing messages from a source using a protocol other than the lightning P2P protocol.
15767 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
15770 * For an already known (from announcement) channel, update info about one of the directions
15771 * of the channel without verifying the associated signatures. Because we aren't given the
15772 * associated signatures here we cannot relay the channel update to any of our peers.
15774 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
15777 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
15779 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
15782 * Initialize a new FilesystemPersister and set the path to the individual channels'
15785 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKCVec_u8Z path_to_channel_data);
15788 * Get the directory which was provided when this persister was initialized.
15790 MUST_USE_RES struct LDKCVec_u8Z FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
15793 * Writes the provided `ChannelManager` to the path provided at `FilesystemPersister`
15794 * initialization, within a file called \"manager\".
15796 MUST_USE_RES struct LDKCResult_NoneErrorZ FilesystemPersister_persist_manager(struct LDKCVec_u8Z data_dir, const struct LDKChannelManager *NONNULL_PTR manager);
15799 * Read `ChannelMonitor`s from disk.
15801 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
15804 * Constructs a new Persist which calls the relevant methods on this_arg.
15805 * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
15807 struct LDKPersist FilesystemPersister_as_Persist(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
15809 #endif /* LDK_C_BINDINGS_H */