1 /* Text to put at the beginning of the generated file. Probably a license. */
3 /* Generated with cbindgen:0.16.0 */
5 /* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */
13 * An error when accessing the chain via [`Access`].
15 typedef enum LDKAccessError {
17 * The requested chain is unknown.
19 LDKAccessError_UnknownChain,
21 * The requested transaction doesn't exist or hasn't confirmed.
23 LDKAccessError_UnknownTx,
25 * Must be last for serialization purposes
27 LDKAccessError_Sentinel,
31 * An error enum representing a failure to persist a channel monitor update.
33 typedef enum LDKChannelMonitorUpdateErr {
35 * Used to indicate a temporary failure (eg connection to a watchtower or remote backup of
36 * our state failed, but is expected to succeed at some point in the future).
38 * Such a failure will \"freeze\" a channel, preventing us from revoking old states or
39 * submitting new commitment transactions to the counterparty. Once the update(s) which failed
40 * have been successfully applied, ChannelManager::channel_monitor_updated can be used to
41 * restore the channel to an operational state.
43 * Note that a given ChannelManager will *never* re-generate a given ChannelMonitorUpdate. If
44 * you return a TemporaryFailure you must ensure that it is written to disk safely before
45 * writing out the latest ChannelManager state.
47 * Even when a channel has been \"frozen\" updates to the ChannelMonitor can continue to occur
48 * (eg if an inbound HTLC which we forwarded was claimed upstream resulting in us attempting
49 * to claim it on this channel) and those updates must be applied wherever they can be. At
50 * least one such updated ChannelMonitor must be persisted otherwise PermanentFailure should
51 * be returned to get things on-chain ASAP using only the in-memory copy. Obviously updates to
52 * the channel which would invalidate previous ChannelMonitors are not made when a channel has
55 * Note that even if updates made after TemporaryFailure succeed you must still call
56 * channel_monitor_updated to ensure you have the latest monitor and re-enable normal channel
59 * Note that the update being processed here will not be replayed for you when you call
60 * ChannelManager::channel_monitor_updated, so you must store the update itself along
61 * with the persisted ChannelMonitor on your own local disk prior to returning a
62 * TemporaryFailure. You may, of course, employ a journaling approach, storing only the
63 * ChannelMonitorUpdate on disk without updating the monitor itself, replaying the journal at
66 * For deployments where a copy of ChannelMonitors and other local state are backed up in a
67 * remote location (with local copies persisted immediately), it is anticipated that all
68 * updates will return TemporaryFailure until the remote copies could be updated.
70 LDKChannelMonitorUpdateErr_TemporaryFailure,
72 * Used to indicate no further channel monitor updates will be allowed (eg we've moved on to a
73 * different watchtower and cannot update with all watchtowers that were previously informed
76 * At reception of this error, ChannelManager will force-close the channel and return at
77 * least a final ChannelMonitorUpdate::ChannelForceClosed which must be delivered to at
78 * least one ChannelMonitor copy. Revocation secret MUST NOT be released and offchain channel
79 * update must be rejected.
81 * This failure may also signal a failure to update the local persisted copy of one of
82 * the channel monitor instance.
84 * Note that even when you fail a holder commitment transaction update, you must store the
85 * update to ensure you can claim from it in case of a duplicate copy of this ChannelMonitor
86 * broadcasts it (e.g distributed channel-monitor deployment)
88 * In case of distributed watchtowers deployment, the new version must be written to disk, as
89 * state may have been stored but rejected due to a block forcing a commitment broadcast. This
90 * storage is used to claim outputs of rejected state confirmed onchain by another watchtower,
91 * lagging behind on block processing.
93 LDKChannelMonitorUpdateErr_PermanentFailure,
95 * Must be last for serialization purposes
97 LDKChannelMonitorUpdateErr_Sentinel,
98 } LDKChannelMonitorUpdateErr;
101 * An enum that represents the speed at which we want a transaction to confirm used for feerate
104 typedef enum LDKConfirmationTarget {
106 * We are happy with this transaction confirming slowly when feerate drops some.
108 LDKConfirmationTarget_Background,
110 * We'd like this transaction to confirm without major delay, but 12-18 blocks is fine.
112 LDKConfirmationTarget_Normal,
114 * We'd like this transaction to confirm in the next few blocks.
116 LDKConfirmationTarget_HighPriority,
118 * Must be last for serialization purposes
120 LDKConfirmationTarget_Sentinel,
121 } LDKConfirmationTarget;
124 * Represents an IO Error. Note that some information is lost in the conversion from Rust.
126 typedef enum LDKIOError {
128 LDKIOError_PermissionDenied,
129 LDKIOError_ConnectionRefused,
130 LDKIOError_ConnectionReset,
131 LDKIOError_ConnectionAborted,
132 LDKIOError_NotConnected,
133 LDKIOError_AddrInUse,
134 LDKIOError_AddrNotAvailable,
135 LDKIOError_BrokenPipe,
136 LDKIOError_AlreadyExists,
137 LDKIOError_WouldBlock,
138 LDKIOError_InvalidInput,
139 LDKIOError_InvalidData,
141 LDKIOError_WriteZero,
142 LDKIOError_Interrupted,
144 LDKIOError_UnexpectedEof,
146 * Must be last for serialization purposes
152 * An enum representing the available verbosity levels of the logger.
154 typedef enum LDKLevel {
156 *Designates logger being silent
160 * Designates very serious errors
164 * Designates hazardous situations
168 * Designates useful information
172 * Designates lower priority information
176 * Designates very low priority, often extremely verbose, information
180 * Must be last for serialization purposes
186 * An enum representing the possible Bitcoin or test networks which we can run on
188 typedef enum LDKNetwork {
190 * The main Bitcoin blockchain.
194 * The testnet3 blockchain.
198 * A local test blockchain.
202 * A blockchain on which blocks are signed instead of mined.
206 * Must be last for serialization purposes
212 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
214 typedef enum LDKSecp256k1Error {
216 * Signature failed verification
218 LDKSecp256k1Error_IncorrectSignature,
220 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
222 LDKSecp256k1Error_InvalidMessage,
226 LDKSecp256k1Error_InvalidPublicKey,
230 LDKSecp256k1Error_InvalidSignature,
234 LDKSecp256k1Error_InvalidSecretKey,
238 LDKSecp256k1Error_InvalidRecoveryId,
240 * Invalid tweak for add_assign or mul_assign
242 LDKSecp256k1Error_InvalidTweak,
244 * tweak_add_check failed on an xonly public key
246 LDKSecp256k1Error_TweakCheckFailed,
248 * Didn't pass enough memory to context creation with preallocated memory
250 LDKSecp256k1Error_NotEnoughMemory,
252 * Must be last for serialization purposes
254 LDKSecp256k1Error_Sentinel,
258 * A serialized transaction, in (pointer, length) form.
260 * This type optionally owns its own memory, and thus the semantics around access change based on
261 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
262 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
263 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
264 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
265 * you would be invalid.
267 * Note that, while it may change in the future, because transactions on the Rust side are stored
268 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
269 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
270 * `data_is_owned` either set or unset at your discretion.
272 typedef struct LDKTransaction {
274 * The serialized transaction data.
276 * This is non-const for your convenience, an object passed to Rust is never written to.
280 * The length of the serialized transaction
284 * Whether the data pointed to by `data` should be freed or not.
290 * A dynamically-allocated array of u8s of arbitrary size.
291 * This corresponds to std::vector in C++
293 typedef struct LDKCVec_u8Z {
295 * The elements in the array.
296 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
300 * The number of elements pointed to by `data`.
306 * A transaction output including a scriptPubKey and value.
307 * This type *does* own its own memory, so must be free'd appropriately.
309 typedef struct LDKTxOut {
311 * The script_pubkey in this output
313 struct LDKCVec_u8Z script_pubkey;
315 * The value, in satoshis, of this output
323 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
324 * with our counterparty.
326 typedef struct MUST_USE_STRUCT LDKChannelConfig {
328 * A pointer to the opaque Rust object.
329 * Nearly everywhere, inner must be non-null, however in places where
330 * the Rust equivalent takes an Option, it may be set to null to indicate None.
332 LDKnativeChannelConfig *inner;
334 * Indicates that this is the only struct which contains the same pointer.
335 * Rust functions which take ownership of an object provided via an argument require
336 * this to be true and invalidate the object pointed to by inner.
344 * An error in decoding a message or struct.
346 typedef struct MUST_USE_STRUCT LDKDecodeError {
348 * A pointer to the opaque Rust object.
349 * Nearly everywhere, inner must be non-null, however in places where
350 * the Rust equivalent takes an Option, it may be set to null to indicate None.
352 LDKnativeDecodeError *inner;
354 * Indicates that this is the only struct which contains the same pointer.
355 * Rust functions which take ownership of an object provided via an argument require
356 * this to be true and invalidate the object pointed to by inner.
362 * The contents of CResult_ChannelConfigDecodeErrorZ
364 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
366 * A pointer to the contents in the success state.
367 * Reading from this pointer when `result_ok` is not set is undefined.
369 struct LDKChannelConfig *result;
371 * A pointer to the contents in the error state.
372 * Reading from this pointer when `result_ok` is set is undefined.
374 struct LDKDecodeError *err;
375 } LDKCResult_ChannelConfigDecodeErrorZPtr;
378 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
379 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
380 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
382 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
384 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
385 * `err` or `result` depending on the state of `result_ok`.
387 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
389 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
392 } LDKCResult_ChannelConfigDecodeErrorZ;
397 * A reference to a transaction output.
399 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
400 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
402 typedef struct MUST_USE_STRUCT LDKOutPoint {
404 * A pointer to the opaque Rust object.
405 * Nearly everywhere, inner must be non-null, however in places where
406 * the Rust equivalent takes an Option, it may be set to null to indicate None.
408 LDKnativeOutPoint *inner;
410 * Indicates that this is the only struct which contains the same pointer.
411 * Rust functions which take ownership of an object provided via an argument require
412 * this to be true and invalidate the object pointed to by inner.
418 * The contents of CResult_OutPointDecodeErrorZ
420 typedef union LDKCResult_OutPointDecodeErrorZPtr {
422 * A pointer to the contents in the success state.
423 * Reading from this pointer when `result_ok` is not set is undefined.
425 struct LDKOutPoint *result;
427 * A pointer to the contents in the error state.
428 * Reading from this pointer when `result_ok` is set is undefined.
430 struct LDKDecodeError *err;
431 } LDKCResult_OutPointDecodeErrorZPtr;
434 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
435 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
436 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
438 typedef struct LDKCResult_OutPointDecodeErrorZ {
440 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
441 * `err` or `result` depending on the state of `result_ok`.
443 union LDKCResult_OutPointDecodeErrorZPtr contents;
445 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
448 } LDKCResult_OutPointDecodeErrorZ;
451 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
453 typedef struct LDKSecretKey {
455 * The bytes of the secret key
461 * The contents of CResult_SecretKeyErrorZ
463 typedef union LDKCResult_SecretKeyErrorZPtr {
465 * A pointer to the contents in the success state.
466 * Reading from this pointer when `result_ok` is not set is undefined.
468 struct LDKSecretKey *result;
470 * A pointer to the contents in the error state.
471 * Reading from this pointer when `result_ok` is set is undefined.
473 enum LDKSecp256k1Error *err;
474 } LDKCResult_SecretKeyErrorZPtr;
477 * A CResult_SecretKeyErrorZ represents the result of a fallible operation,
478 * containing a crate::c_types::SecretKey on success and a crate::c_types::Secp256k1Error on failure.
479 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
481 typedef struct LDKCResult_SecretKeyErrorZ {
483 * The contents of this CResult_SecretKeyErrorZ, accessible via either
484 * `err` or `result` depending on the state of `result_ok`.
486 union LDKCResult_SecretKeyErrorZPtr contents;
488 * Whether this CResult_SecretKeyErrorZ represents a success state.
491 } LDKCResult_SecretKeyErrorZ;
494 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
496 typedef struct LDKPublicKey {
498 * The bytes of the public key
500 uint8_t compressed_form[33];
504 * The contents of CResult_PublicKeyErrorZ
506 typedef union LDKCResult_PublicKeyErrorZPtr {
508 * A pointer to the contents in the success state.
509 * Reading from this pointer when `result_ok` is not set is undefined.
511 struct LDKPublicKey *result;
513 * A pointer to the contents in the error state.
514 * Reading from this pointer when `result_ok` is set is undefined.
516 enum LDKSecp256k1Error *err;
517 } LDKCResult_PublicKeyErrorZPtr;
520 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
521 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
522 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
524 typedef struct LDKCResult_PublicKeyErrorZ {
526 * The contents of this CResult_PublicKeyErrorZ, accessible via either
527 * `err` or `result` depending on the state of `result_ok`.
529 union LDKCResult_PublicKeyErrorZPtr contents;
531 * Whether this CResult_PublicKeyErrorZ represents a success state.
534 } LDKCResult_PublicKeyErrorZ;
539 * The set of public keys which are used in the creation of one commitment transaction.
540 * These are derived from the channel base keys and per-commitment data.
542 * A broadcaster key is provided from potential broadcaster of the computed transaction.
543 * A countersignatory key is coming from a protocol participant unable to broadcast the
546 * These keys are assumed to be good, either because the code derived them from
547 * channel basepoints via the new function, or they were obtained via
548 * CommitmentTransaction.trust().keys() because we trusted the source of the
549 * pre-calculated keys.
551 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
553 * A pointer to the opaque Rust object.
554 * Nearly everywhere, inner must be non-null, however in places where
555 * the Rust equivalent takes an Option, it may be set to null to indicate None.
557 LDKnativeTxCreationKeys *inner;
559 * Indicates that this is the only struct which contains the same pointer.
560 * Rust functions which take ownership of an object provided via an argument require
561 * this to be true and invalidate the object pointed to by inner.
567 * The contents of CResult_TxCreationKeysDecodeErrorZ
569 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
571 * A pointer to the contents in the success state.
572 * Reading from this pointer when `result_ok` is not set is undefined.
574 struct LDKTxCreationKeys *result;
576 * A pointer to the contents in the error state.
577 * Reading from this pointer when `result_ok` is set is undefined.
579 struct LDKDecodeError *err;
580 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
583 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
584 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
585 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
587 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
589 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
590 * `err` or `result` depending on the state of `result_ok`.
592 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
594 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
597 } LDKCResult_TxCreationKeysDecodeErrorZ;
602 * One counterparty's public keys which do not change over the life of a channel.
604 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
606 * A pointer to the opaque Rust object.
607 * Nearly everywhere, inner must be non-null, however in places where
608 * the Rust equivalent takes an Option, it may be set to null to indicate None.
610 LDKnativeChannelPublicKeys *inner;
612 * Indicates that this is the only struct which contains the same pointer.
613 * Rust functions which take ownership of an object provided via an argument require
614 * this to be true and invalidate the object pointed to by inner.
617 } LDKChannelPublicKeys;
620 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
622 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
624 * A pointer to the contents in the success state.
625 * Reading from this pointer when `result_ok` is not set is undefined.
627 struct LDKChannelPublicKeys *result;
629 * A pointer to the contents in the error state.
630 * Reading from this pointer when `result_ok` is set is undefined.
632 struct LDKDecodeError *err;
633 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
636 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
637 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
638 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
640 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
642 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
643 * `err` or `result` depending on the state of `result_ok`.
645 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
647 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
650 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
653 * The contents of CResult_TxCreationKeysErrorZ
655 typedef union LDKCResult_TxCreationKeysErrorZPtr {
657 * A pointer to the contents in the success state.
658 * Reading from this pointer when `result_ok` is not set is undefined.
660 struct LDKTxCreationKeys *result;
662 * A pointer to the contents in the error state.
663 * Reading from this pointer when `result_ok` is set is undefined.
665 enum LDKSecp256k1Error *err;
666 } LDKCResult_TxCreationKeysErrorZPtr;
669 * A CResult_TxCreationKeysErrorZ represents the result of a fallible operation,
670 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::c_types::Secp256k1Error on failure.
671 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
673 typedef struct LDKCResult_TxCreationKeysErrorZ {
675 * The contents of this CResult_TxCreationKeysErrorZ, accessible via either
676 * `err` or `result` depending on the state of `result_ok`.
678 union LDKCResult_TxCreationKeysErrorZPtr contents;
680 * Whether this CResult_TxCreationKeysErrorZ represents a success state.
683 } LDKCResult_TxCreationKeysErrorZ;
686 * An enum which can either contain a u32 or not
688 typedef enum LDKCOption_u32Z_Tag {
690 * When we're in this state, this COption_u32Z contains a u32
692 LDKCOption_u32Z_Some,
694 * When we're in this state, this COption_u32Z contains nothing
696 LDKCOption_u32Z_None,
698 * Must be last for serialization purposes
700 LDKCOption_u32Z_Sentinel,
701 } LDKCOption_u32Z_Tag;
703 typedef struct LDKCOption_u32Z {
704 LDKCOption_u32Z_Tag tag;
715 * Information about an HTLC as it appears in a commitment transaction
717 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
719 * A pointer to the opaque Rust object.
720 * Nearly everywhere, inner must be non-null, however in places where
721 * the Rust equivalent takes an Option, it may be set to null to indicate None.
723 LDKnativeHTLCOutputInCommitment *inner;
725 * Indicates that this is the only struct which contains the same pointer.
726 * Rust functions which take ownership of an object provided via an argument require
727 * this to be true and invalidate the object pointed to by inner.
730 } LDKHTLCOutputInCommitment;
733 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
735 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
737 * A pointer to the contents in the success state.
738 * Reading from this pointer when `result_ok` is not set is undefined.
740 struct LDKHTLCOutputInCommitment *result;
742 * A pointer to the contents in the error state.
743 * Reading from this pointer when `result_ok` is set is undefined.
745 struct LDKDecodeError *err;
746 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
749 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
750 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
751 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
753 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
755 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
756 * `err` or `result` depending on the state of `result_ok`.
758 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
760 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
763 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
768 * Late-bound per-channel counterparty data used to build transactions.
770 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
772 * A pointer to the opaque Rust object.
773 * Nearly everywhere, inner must be non-null, however in places where
774 * the Rust equivalent takes an Option, it may be set to null to indicate None.
776 LDKnativeCounterpartyChannelTransactionParameters *inner;
778 * Indicates that this is the only struct which contains the same pointer.
779 * Rust functions which take ownership of an object provided via an argument require
780 * this to be true and invalidate the object pointed to by inner.
783 } LDKCounterpartyChannelTransactionParameters;
786 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
788 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
790 * A pointer to the contents in the success state.
791 * Reading from this pointer when `result_ok` is not set is undefined.
793 struct LDKCounterpartyChannelTransactionParameters *result;
795 * A pointer to the contents in the error state.
796 * Reading from this pointer when `result_ok` is set is undefined.
798 struct LDKDecodeError *err;
799 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
802 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
803 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
804 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
806 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
808 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
809 * `err` or `result` depending on the state of `result_ok`.
811 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
813 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
816 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
821 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
822 * The fields are organized by holder/counterparty.
824 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
825 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
827 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
829 * A pointer to the opaque Rust object.
830 * Nearly everywhere, inner must be non-null, however in places where
831 * the Rust equivalent takes an Option, it may be set to null to indicate None.
833 LDKnativeChannelTransactionParameters *inner;
835 * Indicates that this is the only struct which contains the same pointer.
836 * Rust functions which take ownership of an object provided via an argument require
837 * this to be true and invalidate the object pointed to by inner.
840 } LDKChannelTransactionParameters;
843 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
845 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
847 * A pointer to the contents in the success state.
848 * Reading from this pointer when `result_ok` is not set is undefined.
850 struct LDKChannelTransactionParameters *result;
852 * A pointer to the contents in the error state.
853 * Reading from this pointer when `result_ok` is set is undefined.
855 struct LDKDecodeError *err;
856 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
859 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
860 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
861 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
863 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
865 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
866 * `err` or `result` depending on the state of `result_ok`.
868 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
870 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
873 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
876 * Represents a secp256k1 signature serialized as two 32-byte numbers
878 typedef struct LDKSignature {
880 * The bytes of the signature in "compact" form
882 uint8_t compact_form[64];
886 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
887 * This corresponds to std::vector in C++
889 typedef struct LDKCVec_SignatureZ {
891 * The elements in the array.
892 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
894 struct LDKSignature *data;
896 * The number of elements pointed to by `data`.
899 } LDKCVec_SignatureZ;
904 * Information needed to build and sign a holder's commitment transaction.
906 * The transaction is only signed once we are ready to broadcast.
908 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
910 * A pointer to the opaque Rust object.
911 * Nearly everywhere, inner must be non-null, however in places where
912 * the Rust equivalent takes an Option, it may be set to null to indicate None.
914 LDKnativeHolderCommitmentTransaction *inner;
916 * Indicates that this is the only struct which contains the same pointer.
917 * Rust functions which take ownership of an object provided via an argument require
918 * this to be true and invalidate the object pointed to by inner.
921 } LDKHolderCommitmentTransaction;
924 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
926 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
928 * A pointer to the contents in the success state.
929 * Reading from this pointer when `result_ok` is not set is undefined.
931 struct LDKHolderCommitmentTransaction *result;
933 * A pointer to the contents in the error state.
934 * Reading from this pointer when `result_ok` is set is undefined.
936 struct LDKDecodeError *err;
937 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
940 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
941 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
942 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
944 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
946 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
947 * `err` or `result` depending on the state of `result_ok`.
949 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
951 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
954 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
959 * A pre-built Bitcoin commitment transaction and its txid.
961 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
963 * A pointer to the opaque Rust object.
964 * Nearly everywhere, inner must be non-null, however in places where
965 * the Rust equivalent takes an Option, it may be set to null to indicate None.
967 LDKnativeBuiltCommitmentTransaction *inner;
969 * Indicates that this is the only struct which contains the same pointer.
970 * Rust functions which take ownership of an object provided via an argument require
971 * this to be true and invalidate the object pointed to by inner.
974 } LDKBuiltCommitmentTransaction;
977 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
979 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
981 * A pointer to the contents in the success state.
982 * Reading from this pointer when `result_ok` is not set is undefined.
984 struct LDKBuiltCommitmentTransaction *result;
986 * A pointer to the contents in the error state.
987 * Reading from this pointer when `result_ok` is set is undefined.
989 struct LDKDecodeError *err;
990 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
993 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
994 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
995 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
997 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
999 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
1000 * `err` or `result` depending on the state of `result_ok`.
1002 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
1004 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
1007 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
1012 * This class tracks the per-transaction information needed to build a commitment transaction and to
1013 * actually build it and sign. It is used for holder transactions that we sign only when needed
1014 * and for transactions we sign for the counterparty.
1016 * This class can be used inside a signer implementation to generate a signature given the relevant
1019 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
1021 * A pointer to the opaque Rust object.
1022 * Nearly everywhere, inner must be non-null, however in places where
1023 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1025 LDKnativeCommitmentTransaction *inner;
1027 * Indicates that this is the only struct which contains the same pointer.
1028 * Rust functions which take ownership of an object provided via an argument require
1029 * this to be true and invalidate the object pointed to by inner.
1032 } LDKCommitmentTransaction;
1035 * The contents of CResult_CommitmentTransactionDecodeErrorZ
1037 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
1039 * A pointer to the contents in the success state.
1040 * Reading from this pointer when `result_ok` is not set is undefined.
1042 struct LDKCommitmentTransaction *result;
1044 * A pointer to the contents in the error state.
1045 * Reading from this pointer when `result_ok` is set is undefined.
1047 struct LDKDecodeError *err;
1048 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
1051 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1052 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1053 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1055 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
1057 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
1058 * `err` or `result` depending on the state of `result_ok`.
1060 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
1062 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
1065 } LDKCResult_CommitmentTransactionDecodeErrorZ;
1070 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
1071 * transaction and the transaction creation keys) are trusted.
1073 * See trust() and verify() functions on CommitmentTransaction.
1075 * This structure implements Deref.
1077 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
1079 * A pointer to the opaque Rust object.
1080 * Nearly everywhere, inner must be non-null, however in places where
1081 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1083 LDKnativeTrustedCommitmentTransaction *inner;
1085 * Indicates that this is the only struct which contains the same pointer.
1086 * Rust functions which take ownership of an object provided via an argument require
1087 * this to be true and invalidate the object pointed to by inner.
1090 } LDKTrustedCommitmentTransaction;
1093 * The contents of CResult_TrustedCommitmentTransactionNoneZ
1095 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
1097 * A pointer to the contents in the success state.
1098 * Reading from this pointer when `result_ok` is not set is undefined.
1100 struct LDKTrustedCommitmentTransaction *result;
1102 * Note that this value is always NULL, as there are no contents in the Err variant
1105 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
1108 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
1109 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
1110 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1112 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
1114 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
1115 * `err` or `result` depending on the state of `result_ok`.
1117 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
1119 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
1122 } LDKCResult_TrustedCommitmentTransactionNoneZ;
1125 * The contents of CResult_CVec_SignatureZNoneZ
1127 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
1129 * A pointer to the contents in the success state.
1130 * Reading from this pointer when `result_ok` is not set is undefined.
1132 struct LDKCVec_SignatureZ *result;
1134 * Note that this value is always NULL, as there are no contents in the Err variant
1137 } LDKCResult_CVec_SignatureZNoneZPtr;
1140 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
1141 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
1142 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1144 typedef struct LDKCResult_CVec_SignatureZNoneZ {
1146 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
1147 * `err` or `result` depending on the state of `result_ok`.
1149 union LDKCResult_CVec_SignatureZNoneZPtr contents;
1151 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
1154 } LDKCResult_CVec_SignatureZNoneZ;
1159 * An update generated by the underlying Channel itself which contains some new information the
1160 * ChannelMonitor should be made aware of.
1162 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
1164 * A pointer to the opaque Rust object.
1165 * Nearly everywhere, inner must be non-null, however in places where
1166 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1168 LDKnativeChannelMonitorUpdate *inner;
1170 * Indicates that this is the only struct which contains the same pointer.
1171 * Rust functions which take ownership of an object provided via an argument require
1172 * this to be true and invalidate the object pointed to by inner.
1175 } LDKChannelMonitorUpdate;
1178 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
1180 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
1182 * A pointer to the contents in the success state.
1183 * Reading from this pointer when `result_ok` is not set is undefined.
1185 struct LDKChannelMonitorUpdate *result;
1187 * A pointer to the contents in the error state.
1188 * Reading from this pointer when `result_ok` is set is undefined.
1190 struct LDKDecodeError *err;
1191 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
1194 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
1195 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
1196 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1198 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
1200 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
1201 * `err` or `result` depending on the state of `result_ok`.
1203 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
1205 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
1208 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
1213 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
1214 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
1215 * preimage claim backward will lead to loss of funds.
1217 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
1219 * A pointer to the opaque Rust object.
1220 * Nearly everywhere, inner must be non-null, however in places where
1221 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1223 LDKnativeHTLCUpdate *inner;
1225 * Indicates that this is the only struct which contains the same pointer.
1226 * Rust functions which take ownership of an object provided via an argument require
1227 * this to be true and invalidate the object pointed to by inner.
1233 * The contents of CResult_HTLCUpdateDecodeErrorZ
1235 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
1237 * A pointer to the contents in the success state.
1238 * Reading from this pointer when `result_ok` is not set is undefined.
1240 struct LDKHTLCUpdate *result;
1242 * A pointer to the contents in the error state.
1243 * Reading from this pointer when `result_ok` is set is undefined.
1245 struct LDKDecodeError *err;
1246 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
1249 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
1250 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
1251 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1253 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
1255 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
1256 * `err` or `result` depending on the state of `result_ok`.
1258 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
1260 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
1263 } LDKCResult_HTLCUpdateDecodeErrorZ;
1268 * General Err type for ChannelMonitor actions. Generally, this implies that the data provided is
1269 * inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this
1270 * means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was
1272 * Contains a developer-readable error message.
1274 typedef struct MUST_USE_STRUCT LDKMonitorUpdateError {
1276 * A pointer to the opaque Rust object.
1277 * Nearly everywhere, inner must be non-null, however in places where
1278 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1280 LDKnativeMonitorUpdateError *inner;
1282 * Indicates that this is the only struct which contains the same pointer.
1283 * Rust functions which take ownership of an object provided via an argument require
1284 * this to be true and invalidate the object pointed to by inner.
1287 } LDKMonitorUpdateError;
1290 * The contents of CResult_NoneMonitorUpdateErrorZ
1292 typedef union LDKCResult_NoneMonitorUpdateErrorZPtr {
1294 * Note that this value is always NULL, as there are no contents in the OK variant
1298 * A pointer to the contents in the error state.
1299 * Reading from this pointer when `result_ok` is set is undefined.
1301 struct LDKMonitorUpdateError *err;
1302 } LDKCResult_NoneMonitorUpdateErrorZPtr;
1305 * A CResult_NoneMonitorUpdateErrorZ represents the result of a fallible operation,
1306 * containing a () on success and a crate::lightning::chain::channelmonitor::MonitorUpdateError on failure.
1307 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1309 typedef struct LDKCResult_NoneMonitorUpdateErrorZ {
1311 * The contents of this CResult_NoneMonitorUpdateErrorZ, accessible via either
1312 * `err` or `result` depending on the state of `result_ok`.
1314 union LDKCResult_NoneMonitorUpdateErrorZPtr contents;
1316 * Whether this CResult_NoneMonitorUpdateErrorZ represents a success state.
1319 } LDKCResult_NoneMonitorUpdateErrorZ;
1322 * A tuple of 2 elements. See the individual fields for the types contained.
1324 typedef struct LDKC2Tuple_OutPointScriptZ {
1326 * The element at position 0
1328 struct LDKOutPoint a;
1330 * The element at position 1
1332 struct LDKCVec_u8Z b;
1333 } LDKC2Tuple_OutPointScriptZ;
1336 * A tuple of 2 elements. See the individual fields for the types contained.
1338 typedef struct LDKC2Tuple_u32ScriptZ {
1340 * The element at position 0
1344 * The element at position 1
1346 struct LDKCVec_u8Z b;
1347 } LDKC2Tuple_u32ScriptZ;
1350 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
1351 * This corresponds to std::vector in C++
1353 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
1355 * The elements in the array.
1356 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1358 struct LDKC2Tuple_u32ScriptZ *data;
1360 * The number of elements pointed to by `data`.
1363 } LDKCVec_C2Tuple_u32ScriptZZ;
1366 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
1367 * look up the corresponding function in rust-lightning's docs.
1369 typedef struct LDKThirtyTwoBytes {
1371 * The thirty-two bytes
1374 } LDKThirtyTwoBytes;
1377 * A tuple of 2 elements. See the individual fields for the types contained.
1379 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
1381 * The element at position 0
1383 struct LDKThirtyTwoBytes a;
1385 * The element at position 1
1387 struct LDKCVec_C2Tuple_u32ScriptZZ b;
1388 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
1391 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
1392 * This corresponds to std::vector in C++
1394 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
1396 * The elements in the array.
1397 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1399 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
1401 * The number of elements pointed to by `data`.
1404 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
1407 * An event to be processed by the ChannelManager.
1409 typedef enum LDKMonitorEvent_Tag {
1411 * A monitor event containing an HTLCUpdate.
1413 LDKMonitorEvent_HTLCEvent,
1415 * A monitor event that the Channel's commitment transaction was broadcasted.
1417 LDKMonitorEvent_CommitmentTxBroadcasted,
1419 * Must be last for serialization purposes
1421 LDKMonitorEvent_Sentinel,
1422 } LDKMonitorEvent_Tag;
1424 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
1425 LDKMonitorEvent_Tag tag;
1428 struct LDKHTLCUpdate htlc_event;
1431 struct LDKOutPoint commitment_tx_broadcasted;
1437 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
1438 * This corresponds to std::vector in C++
1440 typedef struct LDKCVec_MonitorEventZ {
1442 * The elements in the array.
1443 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1445 struct LDKMonitorEvent *data;
1447 * The number of elements pointed to by `data`.
1450 } LDKCVec_MonitorEventZ;
1455 * Information about a spendable output to a P2WSH script. See
1456 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
1458 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
1460 * A pointer to the opaque Rust object.
1461 * Nearly everywhere, inner must be non-null, however in places where
1462 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1464 LDKnativeDelayedPaymentOutputDescriptor *inner;
1466 * Indicates that this is the only struct which contains the same pointer.
1467 * Rust functions which take ownership of an object provided via an argument require
1468 * this to be true and invalidate the object pointed to by inner.
1471 } LDKDelayedPaymentOutputDescriptor;
1476 * Information about a spendable output to our \"payment key\". See
1477 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
1479 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
1481 * A pointer to the opaque Rust object.
1482 * Nearly everywhere, inner must be non-null, however in places where
1483 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1485 LDKnativeStaticPaymentOutputDescriptor *inner;
1487 * Indicates that this is the only struct which contains the same pointer.
1488 * Rust functions which take ownership of an object provided via an argument require
1489 * this to be true and invalidate the object pointed to by inner.
1492 } LDKStaticPaymentOutputDescriptor;
1495 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
1496 * claim at any point in the future) an event is generated which you must track and be able to
1497 * spend on-chain. The information needed to do this is provided in this enum, including the
1498 * outpoint describing which txid and output index is available, the full output which exists at
1499 * that txid/index, and any keys or other information required to sign.
1501 typedef enum LDKSpendableOutputDescriptor_Tag {
1503 * An output to a script which was provided via KeysInterface directly, either from
1504 * `get_destination_script()` or `get_shutdown_pubkey()`, thus you should already know how to
1505 * spend it. No secret keys are provided as rust-lightning was never given any key.
1506 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
1507 * on-chain using the payment preimage or after it has timed out.
1509 LDKSpendableOutputDescriptor_StaticOutput,
1511 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
1513 * The witness in the spending input should be:
1514 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
1516 * Note that the nSequence field in the spending input must be set to to_self_delay
1517 * (which means the transaction is not broadcastable until at least to_self_delay
1518 * blocks after the outpoint confirms).
1520 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
1521 * it is an output from an old state which we broadcast (which should never happen).
1523 * To derive the delayed_payment key which is used to sign for this input, you must pass the
1524 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
1525 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
1526 * chan_utils::derive_private_key. The public key can be generated without the secret key
1527 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
1530 * To derive the revocation_pubkey provided here (which is used in the witness
1531 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
1532 * call to Sign::ready_channel) and the provided per_commitment point
1533 * to chan_utils::derive_public_revocation_key.
1535 * The witness script which is hashed and included in the output script_pubkey may be
1536 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
1537 * (derived as above), and the to_self_delay contained here to
1538 * chan_utils::get_revokeable_redeemscript.
1540 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
1542 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
1543 * corresponds to the public key in Sign::pubkeys().payment_point).
1544 * The witness in the spending input, is, thus, simply:
1545 * <BIP 143 signature> <payment key>
1547 * These are generally the result of our counterparty having broadcast the current state,
1548 * allowing us to claim the non-HTLC-encumbered outputs immediately.
1550 LDKSpendableOutputDescriptor_StaticPaymentOutput,
1552 * Must be last for serialization purposes
1554 LDKSpendableOutputDescriptor_Sentinel,
1555 } LDKSpendableOutputDescriptor_Tag;
1557 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
1559 * The outpoint which is spendable
1561 struct LDKOutPoint outpoint;
1563 * The output which is referenced by the given outpoint.
1565 struct LDKTxOut output;
1566 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
1568 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
1569 LDKSpendableOutputDescriptor_Tag tag;
1571 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
1573 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
1576 struct LDKStaticPaymentOutputDescriptor static_payment_output;
1579 } LDKSpendableOutputDescriptor;
1582 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
1583 * This corresponds to std::vector in C++
1585 typedef struct LDKCVec_SpendableOutputDescriptorZ {
1587 * The elements in the array.
1588 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1590 struct LDKSpendableOutputDescriptor *data;
1592 * The number of elements pointed to by `data`.
1595 } LDKCVec_SpendableOutputDescriptorZ;
1598 * An Event which you should probably take some action in response to.
1600 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
1601 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
1602 * written as it makes no sense to respond to it after reconnecting to peers).
1604 typedef enum LDKEvent_Tag {
1606 * Used to indicate that the client should generate a funding transaction with the given
1607 * parameters and then call ChannelManager::funding_transaction_generated.
1608 * Generated in ChannelManager message handling.
1609 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
1610 * counterparty can steal your funds!
1612 LDKEvent_FundingGenerationReady,
1614 * Indicates we've received money! Just gotta dig out that payment preimage and feed it to
1615 * ChannelManager::claim_funds to get it....
1616 * Note that if the preimage is not known or the amount paid is incorrect, you should call
1617 * ChannelManager::fail_htlc_backwards to free up resources for this HTLC and avoid
1618 * network congestion.
1619 * The amount paid should be considered 'incorrect' when it is less than or more than twice
1620 * the amount expected.
1621 * If you fail to call either ChannelManager::claim_funds or
1622 * ChannelManager::fail_htlc_backwards within the HTLC's timeout, the HTLC will be
1623 * automatically failed.
1625 LDKEvent_PaymentReceived,
1627 * Indicates an outbound payment we made succeeded (ie it made it all the way to its target
1628 * and we got back the payment preimage for it).
1629 * Note that duplicative PaymentSent Events may be generated - it is your responsibility to
1630 * deduplicate them by payment_preimage (which MUST be unique)!
1632 LDKEvent_PaymentSent,
1634 * Indicates an outbound payment we made failed. Probably some intermediary node dropped
1635 * something. You may wish to retry with a different route.
1636 * Note that duplicative PaymentFailed Events may be generated - it is your responsibility to
1637 * deduplicate them by payment_hash (which MUST be unique)!
1639 LDKEvent_PaymentFailed,
1641 * Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
1642 * time in the future.
1644 LDKEvent_PendingHTLCsForwardable,
1646 * Used to indicate that an output was generated on-chain which you should know how to spend.
1647 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
1648 * counterparty spending them due to some kind of timeout. Thus, you need to store them
1649 * somewhere and spend them when you create on-chain transactions.
1651 LDKEvent_SpendableOutputs,
1653 * Must be last for serialization purposes
1658 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
1660 * The random channel_id we picked which you'll need to pass into
1661 * ChannelManager::funding_transaction_generated.
1663 struct LDKThirtyTwoBytes temporary_channel_id;
1665 * The value, in satoshis, that the output should have.
1667 uint64_t channel_value_satoshis;
1669 * The script which should be used in the transaction output.
1671 struct LDKCVec_u8Z output_script;
1673 * The value passed in to ChannelManager::create_channel
1675 uint64_t user_channel_id;
1676 } LDKEvent_LDKFundingGenerationReady_Body;
1678 typedef struct LDKEvent_LDKPaymentReceived_Body {
1680 * The hash for which the preimage should be handed to the ChannelManager.
1682 struct LDKThirtyTwoBytes payment_hash;
1684 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
1685 * number of deanonymization attacks during the routing process.
1686 * As nodes upgrade, the invoices you provide should likely migrate to setting the
1687 * payment_secret feature to required, at which point you should fail_backwards any HTLCs
1688 * which have a None here.
1689 * Until then, however, values of None should be ignored, and only incorrect Some values
1690 * should result in an HTLC fail_backwards.
1691 * Note that, in any case, this value must be passed as-is to any fail or claim calls as
1692 * the HTLC index includes this value.
1694 struct LDKThirtyTwoBytes payment_secret;
1696 * The value, in thousandths of a satoshi, that this payment is for. Note that you must
1697 * compare this to the expected value before accepting the payment (as otherwise you are
1698 * providing proof-of-payment for less than the value you expected!).
1701 } LDKEvent_LDKPaymentReceived_Body;
1703 typedef struct LDKEvent_LDKPaymentSent_Body {
1705 * The preimage to the hash given to ChannelManager::send_payment.
1706 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
1709 struct LDKThirtyTwoBytes payment_preimage;
1710 } LDKEvent_LDKPaymentSent_Body;
1712 typedef struct LDKEvent_LDKPaymentFailed_Body {
1714 * The hash which was given to ChannelManager::send_payment.
1716 struct LDKThirtyTwoBytes payment_hash;
1718 * Indicates the payment was rejected for some reason by the recipient. This implies that
1719 * the payment has failed, not just the route in question. If this is not set, you may
1720 * retry the payment via a different route.
1722 bool rejected_by_dest;
1723 } LDKEvent_LDKPaymentFailed_Body;
1725 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
1727 * The minimum amount of time that should be waited prior to calling
1728 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
1729 * you should wait a random amount of time in roughly the range (now + time_forwardable,
1730 * now + 5*time_forwardable).
1732 uint64_t time_forwardable;
1733 } LDKEvent_LDKPendingHTLCsForwardable_Body;
1735 typedef struct LDKEvent_LDKSpendableOutputs_Body {
1737 * The outputs which you should store as spendable by you.
1739 struct LDKCVec_SpendableOutputDescriptorZ outputs;
1740 } LDKEvent_LDKSpendableOutputs_Body;
1742 typedef struct MUST_USE_STRUCT LDKEvent {
1745 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
1746 LDKEvent_LDKPaymentReceived_Body payment_received;
1747 LDKEvent_LDKPaymentSent_Body payment_sent;
1748 LDKEvent_LDKPaymentFailed_Body payment_failed;
1749 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
1750 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
1755 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
1756 * This corresponds to std::vector in C++
1758 typedef struct LDKCVec_EventZ {
1760 * The elements in the array.
1761 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1763 struct LDKEvent *data;
1765 * The number of elements pointed to by `data`.
1771 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
1772 * This corresponds to std::vector in C++
1774 typedef struct LDKCVec_TransactionZ {
1776 * The elements in the array.
1777 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1779 struct LDKTransaction *data;
1781 * The number of elements pointed to by `data`.
1784 } LDKCVec_TransactionZ;
1787 * A tuple of 2 elements. See the individual fields for the types contained.
1789 typedef struct LDKC2Tuple_usizeTransactionZ {
1791 * The element at position 0
1795 * The element at position 1
1797 struct LDKTransaction b;
1798 } LDKC2Tuple_usizeTransactionZ;
1801 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
1802 * This corresponds to std::vector in C++
1804 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
1806 * The elements in the array.
1807 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1809 struct LDKC2Tuple_usizeTransactionZ *data;
1811 * The number of elements pointed to by `data`.
1814 } LDKCVec_C2Tuple_usizeTransactionZZ;
1817 * A tuple of 2 elements. See the individual fields for the types contained.
1819 typedef struct LDKC2Tuple_u32TxOutZ {
1821 * The element at position 0
1825 * The element at position 1
1828 } LDKC2Tuple_u32TxOutZ;
1831 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
1832 * This corresponds to std::vector in C++
1834 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
1836 * The elements in the array.
1837 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1839 struct LDKC2Tuple_u32TxOutZ *data;
1841 * The number of elements pointed to by `data`.
1844 } LDKCVec_C2Tuple_u32TxOutZZ;
1847 * A tuple of 2 elements. See the individual fields for the types contained.
1849 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
1851 * The element at position 0
1853 struct LDKThirtyTwoBytes a;
1855 * The element at position 1
1857 struct LDKCVec_C2Tuple_u32TxOutZZ b;
1858 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
1861 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
1862 * This corresponds to std::vector in C++
1864 typedef struct LDKCVec_TransactionOutputsZ {
1866 * The elements in the array.
1867 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1869 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
1871 * The number of elements pointed to by `data`.
1874 } LDKCVec_TransactionOutputsZ;
1877 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
1878 * This corresponds to std::vector in C++
1880 typedef struct LDKCVec_TxidZ {
1882 * The elements in the array.
1883 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1885 struct LDKThirtyTwoBytes *data;
1887 * The number of elements pointed to by `data`.
1893 * The contents of CResult_NoneChannelMonitorUpdateErrZ
1895 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
1897 * Note that this value is always NULL, as there are no contents in the OK variant
1901 * A pointer to the contents in the error state.
1902 * Reading from this pointer when `result_ok` is set is undefined.
1904 enum LDKChannelMonitorUpdateErr *err;
1905 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
1908 * A CResult_NoneChannelMonitorUpdateErrZ represents the result of a fallible operation,
1909 * containing a () on success and a crate::lightning::chain::channelmonitor::ChannelMonitorUpdateErr on failure.
1910 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1912 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
1914 * The contents of this CResult_NoneChannelMonitorUpdateErrZ, accessible via either
1915 * `err` or `result` depending on the state of `result_ok`.
1917 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
1919 * Whether this CResult_NoneChannelMonitorUpdateErrZ represents a success state.
1922 } LDKCResult_NoneChannelMonitorUpdateErrZ;
1925 * A tuple of 2 elements. See the individual fields for the types contained.
1927 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
1929 * The element at position 0
1931 struct LDKSignature a;
1933 * The element at position 1
1935 struct LDKCVec_SignatureZ b;
1936 } LDKC2Tuple_SignatureCVec_SignatureZZ;
1939 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
1941 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
1943 * A pointer to the contents in the success state.
1944 * Reading from this pointer when `result_ok` is not set is undefined.
1946 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
1948 * Note that this value is always NULL, as there are no contents in the Err variant
1951 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
1954 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
1955 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
1956 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1958 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
1960 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
1961 * `err` or `result` depending on the state of `result_ok`.
1963 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
1965 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
1968 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
1971 * The contents of CResult_SignatureNoneZ
1973 typedef union LDKCResult_SignatureNoneZPtr {
1975 * A pointer to the contents in the success state.
1976 * Reading from this pointer when `result_ok` is not set is undefined.
1978 struct LDKSignature *result;
1980 * Note that this value is always NULL, as there are no contents in the Err variant
1983 } LDKCResult_SignatureNoneZPtr;
1986 * A CResult_SignatureNoneZ represents the result of a fallible operation,
1987 * containing a crate::c_types::Signature on success and a () on failure.
1988 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1990 typedef struct LDKCResult_SignatureNoneZ {
1992 * The contents of this CResult_SignatureNoneZ, accessible via either
1993 * `err` or `result` depending on the state of `result_ok`.
1995 union LDKCResult_SignatureNoneZPtr contents;
1997 * Whether this CResult_SignatureNoneZ represents a success state.
2000 } LDKCResult_SignatureNoneZ;
2005 * The unsigned part of a channel_announcement
2007 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
2009 * A pointer to the opaque Rust object.
2010 * Nearly everywhere, inner must be non-null, however in places where
2011 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2013 LDKnativeUnsignedChannelAnnouncement *inner;
2015 * Indicates that this is the only struct which contains the same pointer.
2016 * Rust functions which take ownership of an object provided via an argument require
2017 * this to be true and invalidate the object pointed to by inner.
2020 } LDKUnsignedChannelAnnouncement;
2023 * A trait to sign lightning channel transactions as described in BOLT 3.
2025 * Signing services could be implemented on a hardware wallet. In this case,
2026 * the current Sign would be a front-end on top of a communication
2027 * channel connected to your secure device and lightning key material wouldn't
2028 * reside on a hot server. Nevertheless, a this deployment would still need
2029 * to trust the ChannelManager to avoid loss of funds as this latest component
2030 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
2032 * A more secure iteration would be to use hashlock (or payment points) to pair
2033 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
2034 * at the price of more state and computation on the hardware wallet side. In the future,
2035 * we are looking forward to design such interface.
2037 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
2038 * to act, as liveness and breach reply correctness are always going to be hard requirements
2039 * of LN security model, orthogonal of key management issues.
2041 typedef struct LDKBaseSign {
2043 * An opaque pointer which is passed to your function implementations as an argument.
2044 * This has no meaning in the LDK, and can be NULL or any other value.
2048 * Gets the per-commitment point for a specific commitment number
2050 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
2052 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
2054 * Gets the commitment secret for a specific commitment number as part of the revocation process
2056 * An external signer implementation should error here if the commitment was already signed
2057 * and should refuse to sign it in the future.
2059 * May be called more than once for the same index.
2061 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
2063 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
2065 * Gets the holder's channel public keys and basepoints
2067 struct LDKChannelPublicKeys pubkeys;
2069 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
2070 * Note that this takes a pointer to this object, not the this_ptr like other methods do
2071 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
2073 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
2075 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
2076 * some SpendableOutputDescriptor types. This should be sufficient to identify this
2077 * Sign object uniquely and lookup or re-derive its keys.
2079 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
2081 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
2083 * Note that if signing fails or is rejected, the channel will be force-closed.
2085 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx);
2087 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
2088 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
2089 * latest commitment_tx when we initiate a force-close.
2090 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
2091 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
2093 * This may be called multiple times for the same transaction.
2095 * An external signer implementation should check that the commitment has not been revoked.
2097 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
2099 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
2101 * Create a signature for the given input in a transaction spending an HTLC or commitment
2102 * transaction output when our counterparty broadcasts an old state.
2104 * A justice transaction may claim multiples outputs at the same time if timelocks are
2105 * similar, but only a signature for the input at index `input` should be signed for here.
2106 * It may be called multiples time for same output(s) if a fee-bump is needed with regards
2107 * to an upcoming timelock expiration.
2109 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2111 * per_commitment_key is revocation secret which was provided by our counterparty when they
2112 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2113 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
2116 * htlc holds HTLC elements (hash, timelock) if the output being spent is a HTLC output, thus
2117 * changing the format of the witness script (which is committed to in the BIP 143
2120 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);
2122 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
2123 * transaction, either offered or received.
2125 * Such a transaction may claim multiples offered outputs at same time if we know the
2126 * preimage for each when we create it, but only the input at index `input` should be
2127 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
2128 * needed with regards to an upcoming timelock expiration.
2130 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
2133 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2135 * Per_commitment_point is the dynamic point corresponding to the channel state
2136 * detected onchain. It has been generated by our counterparty and is used to derive
2137 * channel state keys, which are then included in the witness script and committed to in the
2138 * BIP 143 signature.
2140 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);
2142 * Create a signature for a (proposed) closing transaction.
2144 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
2145 * chosen to forgo their output as dust.
2147 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, struct LDKTransaction closing_tx);
2149 * Signs a channel announcement message with our funding key, proving it comes from one
2150 * of the channel participants.
2152 * Note that if this fails or is rejected, the channel will not be publicly announced and
2153 * our counterparty may (though likely will not) close the channel on us for violating the
2156 struct LDKCResult_SignatureNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
2158 * Set the counterparty static channel data, including basepoints,
2159 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
2160 * This is done as soon as the funding outpoint is known. Since these are static channel data,
2161 * they MUST NOT be allowed to change to different values once set.
2163 * channel_parameters.is_populated() MUST be true.
2165 * We bind holder_selected_contest_delay late here for API convenience.
2167 * Will be called before any signatures are applied.
2169 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
2171 * Frees any resources associated with this object given its this_arg pointer.
2172 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2174 void (*free)(void *this_arg);
2178 * A cloneable signer.
2180 * Although we require signers to be cloneable, it may be useful for developers to be able to use
2181 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
2182 * which implies Sized, into this derived trait.
2184 typedef struct LDKSign {
2186 * An opaque pointer which is passed to your function implementations as an argument.
2187 * This has no meaning in the LDK, and can be NULL or any other value.
2191 * Implementation of BaseSign for this object.
2193 struct LDKBaseSign BaseSign;
2195 * Creates a copy of the BaseSign, for a copy of this Sign.
2196 * Because BaseSign doesn't natively support copying itself, you have to provide a full copy implementation here.
2198 struct LDKBaseSign (*BaseSign_clone)(const struct LDKBaseSign *NONNULL_PTR orig_BaseSign);
2200 * Serialize the object into a byte array
2202 struct LDKCVec_u8Z (*write)(const void *this_arg);
2204 * Creates a copy of the object pointed to by this_arg, for a copy of this Sign.
2205 * Note that the ultimate copy of the Sign will have all function pointers the same as the original.
2206 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new Sign.
2208 void *(*clone)(const void *this_arg);
2210 * Frees any resources associated with this object given its this_arg pointer.
2211 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2213 void (*free)(void *this_arg);
2219 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
2220 * on-chain transactions to ensure no loss of funds occurs.
2222 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
2223 * information and are actively monitoring the chain.
2225 * Pending Events or updated HTLCs which have not yet been read out by
2226 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
2227 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
2228 * gotten are fully handled before re-serializing the new state.
2230 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
2231 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
2232 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
2233 * returned block hash and the the current chain and then reconnecting blocks to get to the
2234 * best chain) upon deserializing the object!
2236 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
2238 * A pointer to the opaque Rust object.
2239 * Nearly everywhere, inner must be non-null, however in places where
2240 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2242 LDKnativeChannelMonitor *inner;
2244 * Indicates that this is the only struct which contains the same pointer.
2245 * Rust functions which take ownership of an object provided via an argument require
2246 * this to be true and invalidate the object pointed to by inner.
2249 } LDKChannelMonitor;
2252 * A tuple of 2 elements. See the individual fields for the types contained.
2254 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
2256 * The element at position 0
2258 struct LDKThirtyTwoBytes a;
2260 * The element at position 1
2262 struct LDKChannelMonitor b;
2263 } LDKC2Tuple_BlockHashChannelMonitorZ;
2266 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
2268 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
2270 * A pointer to the contents in the success state.
2271 * Reading from this pointer when `result_ok` is not set is undefined.
2273 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
2275 * A pointer to the contents in the error state.
2276 * Reading from this pointer when `result_ok` is set is undefined.
2278 struct LDKDecodeError *err;
2279 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
2282 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
2283 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
2284 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2286 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
2288 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
2289 * `err` or `result` depending on the state of `result_ok`.
2291 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
2293 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
2296 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
2303 typedef struct MUST_USE_STRUCT LDKRouteHop {
2305 * A pointer to the opaque Rust object.
2306 * Nearly everywhere, inner must be non-null, however in places where
2307 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2309 LDKnativeRouteHop *inner;
2311 * Indicates that this is the only struct which contains the same pointer.
2312 * Rust functions which take ownership of an object provided via an argument require
2313 * this to be true and invalidate the object pointed to by inner.
2319 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
2320 * This corresponds to std::vector in C++
2322 typedef struct LDKCVec_RouteHopZ {
2324 * The elements in the array.
2325 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2327 struct LDKRouteHop *data;
2329 * The number of elements pointed to by `data`.
2332 } LDKCVec_RouteHopZ;
2335 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
2336 * This corresponds to std::vector in C++
2338 typedef struct LDKCVec_CVec_RouteHopZZ {
2340 * The elements in the array.
2341 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2343 struct LDKCVec_RouteHopZ *data;
2345 * The number of elements pointed to by `data`.
2348 } LDKCVec_CVec_RouteHopZZ;
2353 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
2354 * it can take multiple paths. Each path is composed of one or more hops through the network.
2356 typedef struct MUST_USE_STRUCT LDKRoute {
2358 * A pointer to the opaque Rust object.
2359 * Nearly everywhere, inner must be non-null, however in places where
2360 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2362 LDKnativeRoute *inner;
2364 * Indicates that this is the only struct which contains the same pointer.
2365 * Rust functions which take ownership of an object provided via an argument require
2366 * this to be true and invalidate the object pointed to by inner.
2372 * The contents of CResult_RouteDecodeErrorZ
2374 typedef union LDKCResult_RouteDecodeErrorZPtr {
2376 * A pointer to the contents in the success state.
2377 * Reading from this pointer when `result_ok` is not set is undefined.
2379 struct LDKRoute *result;
2381 * A pointer to the contents in the error state.
2382 * Reading from this pointer when `result_ok` is set is undefined.
2384 struct LDKDecodeError *err;
2385 } LDKCResult_RouteDecodeErrorZPtr;
2388 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
2389 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
2390 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2392 typedef struct LDKCResult_RouteDecodeErrorZ {
2394 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
2395 * `err` or `result` depending on the state of `result_ok`.
2397 union LDKCResult_RouteDecodeErrorZPtr contents;
2399 * Whether this CResult_RouteDecodeErrorZ represents a success state.
2402 } LDKCResult_RouteDecodeErrorZ;
2405 * An enum which can either contain a u64 or not
2407 typedef enum LDKCOption_u64Z_Tag {
2409 * When we're in this state, this COption_u64Z contains a u64
2411 LDKCOption_u64Z_Some,
2413 * When we're in this state, this COption_u64Z contains nothing
2415 LDKCOption_u64Z_None,
2417 * Must be last for serialization purposes
2419 LDKCOption_u64Z_Sentinel,
2420 } LDKCOption_u64Z_Tag;
2422 typedef struct LDKCOption_u64Z {
2423 LDKCOption_u64Z_Tag tag;
2434 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
2436 typedef struct MUST_USE_STRUCT LDKChannelDetails {
2438 * A pointer to the opaque Rust object.
2439 * Nearly everywhere, inner must be non-null, however in places where
2440 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2442 LDKnativeChannelDetails *inner;
2444 * Indicates that this is the only struct which contains the same pointer.
2445 * Rust functions which take ownership of an object provided via an argument require
2446 * this to be true and invalidate the object pointed to by inner.
2449 } LDKChannelDetails;
2452 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
2453 * This corresponds to std::vector in C++
2455 typedef struct LDKCVec_ChannelDetailsZ {
2457 * The elements in the array.
2458 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2460 struct LDKChannelDetails *data;
2462 * The number of elements pointed to by `data`.
2465 } LDKCVec_ChannelDetailsZ;
2470 * A channel descriptor which provides a last-hop route to get_route
2472 typedef struct MUST_USE_STRUCT LDKRouteHint {
2474 * A pointer to the opaque Rust object.
2475 * Nearly everywhere, inner must be non-null, however in places where
2476 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2478 LDKnativeRouteHint *inner;
2480 * Indicates that this is the only struct which contains the same pointer.
2481 * Rust functions which take ownership of an object provided via an argument require
2482 * this to be true and invalidate the object pointed to by inner.
2488 * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
2489 * This corresponds to std::vector in C++
2491 typedef struct LDKCVec_RouteHintZ {
2493 * The elements in the array.
2494 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2496 struct LDKRouteHint *data;
2498 * The number of elements pointed to by `data`.
2501 } LDKCVec_RouteHintZ;
2506 * An Err type for failure to process messages.
2508 typedef struct MUST_USE_STRUCT LDKLightningError {
2510 * A pointer to the opaque Rust object.
2511 * Nearly everywhere, inner must be non-null, however in places where
2512 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2514 LDKnativeLightningError *inner;
2516 * Indicates that this is the only struct which contains the same pointer.
2517 * Rust functions which take ownership of an object provided via an argument require
2518 * this to be true and invalidate the object pointed to by inner.
2521 } LDKLightningError;
2524 * The contents of CResult_RouteLightningErrorZ
2526 typedef union LDKCResult_RouteLightningErrorZPtr {
2528 * A pointer to the contents in the success state.
2529 * Reading from this pointer when `result_ok` is not set is undefined.
2531 struct LDKRoute *result;
2533 * A pointer to the contents in the error state.
2534 * Reading from this pointer when `result_ok` is set is undefined.
2536 struct LDKLightningError *err;
2537 } LDKCResult_RouteLightningErrorZPtr;
2540 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
2541 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
2542 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2544 typedef struct LDKCResult_RouteLightningErrorZ {
2546 * The contents of this CResult_RouteLightningErrorZ, accessible via either
2547 * `err` or `result` depending on the state of `result_ok`.
2549 union LDKCResult_RouteLightningErrorZPtr contents;
2551 * Whether this CResult_RouteLightningErrorZ represents a success state.
2554 } LDKCResult_RouteLightningErrorZ;
2559 * An accept_channel message to be sent or received from a peer
2561 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
2563 * A pointer to the opaque Rust object.
2564 * Nearly everywhere, inner must be non-null, however in places where
2565 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2567 LDKnativeAcceptChannel *inner;
2569 * Indicates that this is the only struct which contains the same pointer.
2570 * Rust functions which take ownership of an object provided via an argument require
2571 * this to be true and invalidate the object pointed to by inner.
2579 * An open_channel message to be sent or received from a peer
2581 typedef struct MUST_USE_STRUCT LDKOpenChannel {
2583 * A pointer to the opaque Rust object.
2584 * Nearly everywhere, inner must be non-null, however in places where
2585 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2587 LDKnativeOpenChannel *inner;
2589 * Indicates that this is the only struct which contains the same pointer.
2590 * Rust functions which take ownership of an object provided via an argument require
2591 * this to be true and invalidate the object pointed to by inner.
2599 * A funding_created message to be sent or received from a peer
2601 typedef struct MUST_USE_STRUCT LDKFundingCreated {
2603 * A pointer to the opaque Rust object.
2604 * Nearly everywhere, inner must be non-null, however in places where
2605 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2607 LDKnativeFundingCreated *inner;
2609 * Indicates that this is the only struct which contains the same pointer.
2610 * Rust functions which take ownership of an object provided via an argument require
2611 * this to be true and invalidate the object pointed to by inner.
2614 } LDKFundingCreated;
2619 * A funding_signed message to be sent or received from a peer
2621 typedef struct MUST_USE_STRUCT LDKFundingSigned {
2623 * A pointer to the opaque Rust object.
2624 * Nearly everywhere, inner must be non-null, however in places where
2625 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2627 LDKnativeFundingSigned *inner;
2629 * Indicates that this is the only struct which contains the same pointer.
2630 * Rust functions which take ownership of an object provided via an argument require
2631 * this to be true and invalidate the object pointed to by inner.
2639 * A funding_locked message to be sent or received from a peer
2641 typedef struct MUST_USE_STRUCT LDKFundingLocked {
2643 * A pointer to the opaque Rust object.
2644 * Nearly everywhere, inner must be non-null, however in places where
2645 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2647 LDKnativeFundingLocked *inner;
2649 * Indicates that this is the only struct which contains the same pointer.
2650 * Rust functions which take ownership of an object provided via an argument require
2651 * this to be true and invalidate the object pointed to by inner.
2659 * An announcement_signatures message to be sent or received from a peer
2661 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
2663 * A pointer to the opaque Rust object.
2664 * Nearly everywhere, inner must be non-null, however in places where
2665 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2667 LDKnativeAnnouncementSignatures *inner;
2669 * Indicates that this is the only struct which contains the same pointer.
2670 * Rust functions which take ownership of an object provided via an argument require
2671 * this to be true and invalidate the object pointed to by inner.
2674 } LDKAnnouncementSignatures;
2679 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
2680 * transaction updates if they were pending.
2682 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
2684 * A pointer to the opaque Rust object.
2685 * Nearly everywhere, inner must be non-null, however in places where
2686 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2688 LDKnativeCommitmentUpdate *inner;
2690 * Indicates that this is the only struct which contains the same pointer.
2691 * Rust functions which take ownership of an object provided via an argument require
2692 * this to be true and invalidate the object pointed to by inner.
2695 } LDKCommitmentUpdate;
2700 * A revoke_and_ack message to be sent or received from a peer
2702 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
2704 * A pointer to the opaque Rust object.
2705 * Nearly everywhere, inner must be non-null, however in places where
2706 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2708 LDKnativeRevokeAndACK *inner;
2710 * Indicates that this is the only struct which contains the same pointer.
2711 * Rust functions which take ownership of an object provided via an argument require
2712 * this to be true and invalidate the object pointed to by inner.
2720 * A closing_signed message to be sent or received from a peer
2722 typedef struct MUST_USE_STRUCT LDKClosingSigned {
2724 * A pointer to the opaque Rust object.
2725 * Nearly everywhere, inner must be non-null, however in places where
2726 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2728 LDKnativeClosingSigned *inner;
2730 * Indicates that this is the only struct which contains the same pointer.
2731 * Rust functions which take ownership of an object provided via an argument require
2732 * this to be true and invalidate the object pointed to by inner.
2740 * A shutdown message to be sent or received from a peer
2742 typedef struct MUST_USE_STRUCT LDKShutdown {
2744 * A pointer to the opaque Rust object.
2745 * Nearly everywhere, inner must be non-null, however in places where
2746 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2748 LDKnativeShutdown *inner;
2750 * Indicates that this is the only struct which contains the same pointer.
2751 * Rust functions which take ownership of an object provided via an argument require
2752 * this to be true and invalidate the object pointed to by inner.
2760 * A channel_reestablish message to be sent or received from a peer
2762 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
2764 * A pointer to the opaque Rust object.
2765 * Nearly everywhere, inner must be non-null, however in places where
2766 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2768 LDKnativeChannelReestablish *inner;
2770 * Indicates that this is the only struct which contains the same pointer.
2771 * Rust functions which take ownership of an object provided via an argument require
2772 * this to be true and invalidate the object pointed to by inner.
2775 } LDKChannelReestablish;
2780 * A channel_announcement message to be sent or received from a peer
2782 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
2784 * A pointer to the opaque Rust object.
2785 * Nearly everywhere, inner must be non-null, however in places where
2786 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2788 LDKnativeChannelAnnouncement *inner;
2790 * Indicates that this is the only struct which contains the same pointer.
2791 * Rust functions which take ownership of an object provided via an argument require
2792 * this to be true and invalidate the object pointed to by inner.
2795 } LDKChannelAnnouncement;
2800 * A channel_update message to be sent or received from a peer
2802 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
2804 * A pointer to the opaque Rust object.
2805 * Nearly everywhere, inner must be non-null, however in places where
2806 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2808 LDKnativeChannelUpdate *inner;
2810 * Indicates that this is the only struct which contains the same pointer.
2811 * Rust functions which take ownership of an object provided via an argument require
2812 * this to be true and invalidate the object pointed to by inner.
2820 * A node_announcement message to be sent or received from a peer
2822 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
2824 * A pointer to the opaque Rust object.
2825 * Nearly everywhere, inner must be non-null, however in places where
2826 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2828 LDKnativeNodeAnnouncement *inner;
2830 * Indicates that this is the only struct which contains the same pointer.
2831 * Rust functions which take ownership of an object provided via an argument require
2832 * this to be true and invalidate the object pointed to by inner.
2835 } LDKNodeAnnouncement;
2840 * An error message to be sent or received from a peer
2842 typedef struct MUST_USE_STRUCT LDKErrorMessage {
2844 * A pointer to the opaque Rust object.
2845 * Nearly everywhere, inner must be non-null, however in places where
2846 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2848 LDKnativeErrorMessage *inner;
2850 * Indicates that this is the only struct which contains the same pointer.
2851 * Rust functions which take ownership of an object provided via an argument require
2852 * this to be true and invalidate the object pointed to by inner.
2858 * Used to put an error message in a LightningError
2860 typedef enum LDKErrorAction_Tag {
2862 * The peer took some action which made us think they were useless. Disconnect them.
2864 LDKErrorAction_DisconnectPeer,
2866 * The peer did something harmless that we weren't able to process, just log and ignore
2868 LDKErrorAction_IgnoreError,
2870 * The peer did something incorrect. Tell them.
2872 LDKErrorAction_SendErrorMessage,
2874 * Must be last for serialization purposes
2876 LDKErrorAction_Sentinel,
2877 } LDKErrorAction_Tag;
2879 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
2881 * An error message which we should make an effort to send before we disconnect.
2883 struct LDKErrorMessage msg;
2884 } LDKErrorAction_LDKDisconnectPeer_Body;
2886 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
2888 * The message to send.
2890 struct LDKErrorMessage msg;
2891 } LDKErrorAction_LDKSendErrorMessage_Body;
2893 typedef struct MUST_USE_STRUCT LDKErrorAction {
2894 LDKErrorAction_Tag tag;
2896 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
2897 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
2902 * The information we received from a peer along the route of a payment we originated. This is
2903 * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
2904 * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
2906 typedef enum LDKHTLCFailChannelUpdate_Tag {
2908 * We received an error which included a full ChannelUpdate message.
2910 LDKHTLCFailChannelUpdate_ChannelUpdateMessage,
2912 * We received an error which indicated only that a channel has been closed
2914 LDKHTLCFailChannelUpdate_ChannelClosed,
2916 * We received an error which indicated only that a node has failed
2918 LDKHTLCFailChannelUpdate_NodeFailure,
2920 * Must be last for serialization purposes
2922 LDKHTLCFailChannelUpdate_Sentinel,
2923 } LDKHTLCFailChannelUpdate_Tag;
2925 typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body {
2927 * The unwrapped message we received
2929 struct LDKChannelUpdate msg;
2930 } LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
2932 typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
2934 * The short_channel_id which has now closed.
2936 uint64_t short_channel_id;
2938 * when this true, this channel should be permanently removed from the
2939 * consideration. Otherwise, this channel can be restored as new channel_update is received
2942 } LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
2944 typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
2946 * The node_id that has failed.
2948 struct LDKPublicKey node_id;
2950 * when this true, node should be permanently removed from the
2951 * consideration. Otherwise, the channels connected to this node can be
2952 * restored as new channel_update is received
2955 } LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
2957 typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate {
2958 LDKHTLCFailChannelUpdate_Tag tag;
2960 LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message;
2961 LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed;
2962 LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure;
2964 } LDKHTLCFailChannelUpdate;
2969 * A query_channel_range message is used to query a peer for channel
2970 * UTXOs in a range of blocks. The recipient of a query makes a best
2971 * effort to reply to the query using one or more reply_channel_range
2974 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
2976 * A pointer to the opaque Rust object.
2977 * Nearly everywhere, inner must be non-null, however in places where
2978 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2980 LDKnativeQueryChannelRange *inner;
2982 * Indicates that this is the only struct which contains the same pointer.
2983 * Rust functions which take ownership of an object provided via an argument require
2984 * this to be true and invalidate the object pointed to by inner.
2987 } LDKQueryChannelRange;
2992 * A query_short_channel_ids message is used to query a peer for
2993 * routing gossip messages related to one or more short_channel_ids.
2994 * The query recipient will reply with the latest, if available,
2995 * channel_announcement, channel_update and node_announcement messages
2996 * it maintains for the requested short_channel_ids followed by a
2997 * reply_short_channel_ids_end message. The short_channel_ids sent in
2998 * this query are encoded. We only support encoding_type=0 uncompressed
2999 * serialization and do not support encoding_type=1 zlib serialization.
3001 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
3003 * A pointer to the opaque Rust object.
3004 * Nearly everywhere, inner must be non-null, however in places where
3005 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3007 LDKnativeQueryShortChannelIds *inner;
3009 * Indicates that this is the only struct which contains the same pointer.
3010 * Rust functions which take ownership of an object provided via an argument require
3011 * this to be true and invalidate the object pointed to by inner.
3014 } LDKQueryShortChannelIds;
3019 * A reply_channel_range message is a reply to a query_channel_range
3020 * message. Multiple reply_channel_range messages can be sent in reply
3021 * to a single query_channel_range message. The query recipient makes a
3022 * best effort to respond based on their local network view which may
3023 * not be a perfect view of the network. The short_channel_ids in the
3024 * reply are encoded. We only support encoding_type=0 uncompressed
3025 * serialization and do not support encoding_type=1 zlib serialization.
3027 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
3029 * A pointer to the opaque Rust object.
3030 * Nearly everywhere, inner must be non-null, however in places where
3031 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3033 LDKnativeReplyChannelRange *inner;
3035 * Indicates that this is the only struct which contains the same pointer.
3036 * Rust functions which take ownership of an object provided via an argument require
3037 * this to be true and invalidate the object pointed to by inner.
3040 } LDKReplyChannelRange;
3043 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
3044 * broadcast to most peers).
3045 * These events are handled by PeerManager::process_events if you are using a PeerManager.
3047 typedef enum LDKMessageSendEvent_Tag {
3049 * Used to indicate that we've accepted a channel open and should send the accept_channel
3050 * message provided to the given peer.
3052 LDKMessageSendEvent_SendAcceptChannel,
3054 * Used to indicate that we've initiated a channel open and should send the open_channel
3055 * message provided to the given peer.
3057 LDKMessageSendEvent_SendOpenChannel,
3059 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
3061 LDKMessageSendEvent_SendFundingCreated,
3063 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
3065 LDKMessageSendEvent_SendFundingSigned,
3067 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
3069 LDKMessageSendEvent_SendFundingLocked,
3071 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
3073 LDKMessageSendEvent_SendAnnouncementSignatures,
3075 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
3076 * message should be sent to the peer with the given node_id.
3078 LDKMessageSendEvent_UpdateHTLCs,
3080 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
3082 LDKMessageSendEvent_SendRevokeAndACK,
3084 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
3086 LDKMessageSendEvent_SendClosingSigned,
3088 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
3090 LDKMessageSendEvent_SendShutdown,
3092 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
3094 LDKMessageSendEvent_SendChannelReestablish,
3096 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
3097 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
3099 * Note that after doing so, you very likely (unless you did so very recently) want to call
3100 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
3101 * This ensures that any nodes which see our channel_announcement also have a relevant
3102 * node_announcement, including relevant feature flags which may be important for routing
3105 LDKMessageSendEvent_BroadcastChannelAnnouncement,
3107 * Used to indicate that a node_announcement should be broadcast to all peers.
3109 LDKMessageSendEvent_BroadcastNodeAnnouncement,
3111 * Used to indicate that a channel_update should be broadcast to all peers.
3113 LDKMessageSendEvent_BroadcastChannelUpdate,
3115 * Broadcast an error downstream to be handled
3117 LDKMessageSendEvent_HandleError,
3119 * When a payment fails we may receive updates back from the hop where it failed. In such
3120 * cases this event is generated so that we can inform the network graph of this information.
3122 LDKMessageSendEvent_PaymentFailureNetworkUpdate,
3124 * Query a peer for channels with funding transaction UTXOs in a block range.
3126 LDKMessageSendEvent_SendChannelRangeQuery,
3128 * Request routing gossip messages from a peer for a list of channels identified by
3129 * their short_channel_ids.
3131 LDKMessageSendEvent_SendShortIdsQuery,
3133 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
3134 * emitted during processing of the query.
3136 LDKMessageSendEvent_SendReplyChannelRange,
3138 * Must be last for serialization purposes
3140 LDKMessageSendEvent_Sentinel,
3141 } LDKMessageSendEvent_Tag;
3143 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
3145 * The node_id of the node which should receive this message
3147 struct LDKPublicKey node_id;
3149 * The message which should be sent.
3151 struct LDKAcceptChannel msg;
3152 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
3154 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
3156 * The node_id of the node which should receive this message
3158 struct LDKPublicKey node_id;
3160 * The message which should be sent.
3162 struct LDKOpenChannel msg;
3163 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
3165 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
3167 * The node_id of the node which should receive this message
3169 struct LDKPublicKey node_id;
3171 * The message which should be sent.
3173 struct LDKFundingCreated msg;
3174 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
3176 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
3178 * The node_id of the node which should receive this message
3180 struct LDKPublicKey node_id;
3182 * The message which should be sent.
3184 struct LDKFundingSigned msg;
3185 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
3187 typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
3189 * The node_id of the node which should receive these message(s)
3191 struct LDKPublicKey node_id;
3193 * The funding_locked message which should be sent.
3195 struct LDKFundingLocked msg;
3196 } LDKMessageSendEvent_LDKSendFundingLocked_Body;
3198 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
3200 * The node_id of the node which should receive these message(s)
3202 struct LDKPublicKey node_id;
3204 * The announcement_signatures message which should be sent.
3206 struct LDKAnnouncementSignatures msg;
3207 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
3209 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
3211 * The node_id of the node which should receive these message(s)
3213 struct LDKPublicKey node_id;
3215 * The update messages which should be sent. ALL messages in the struct should be sent!
3217 struct LDKCommitmentUpdate updates;
3218 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
3220 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
3222 * The node_id of the node which should receive this message
3224 struct LDKPublicKey node_id;
3226 * The message which should be sent.
3228 struct LDKRevokeAndACK msg;
3229 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
3231 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
3233 * The node_id of the node which should receive this message
3235 struct LDKPublicKey node_id;
3237 * The message which should be sent.
3239 struct LDKClosingSigned msg;
3240 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
3242 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
3244 * The node_id of the node which should receive this message
3246 struct LDKPublicKey node_id;
3248 * The message which should be sent.
3250 struct LDKShutdown msg;
3251 } LDKMessageSendEvent_LDKSendShutdown_Body;
3253 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
3255 * The node_id of the node which should receive this message
3257 struct LDKPublicKey node_id;
3259 * The message which should be sent.
3261 struct LDKChannelReestablish msg;
3262 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
3264 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
3266 * The channel_announcement which should be sent.
3268 struct LDKChannelAnnouncement msg;
3270 * The followup channel_update which should be sent.
3272 struct LDKChannelUpdate update_msg;
3273 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
3275 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
3277 * The node_announcement which should be sent.
3279 struct LDKNodeAnnouncement msg;
3280 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
3282 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
3284 * The channel_update which should be sent.
3286 struct LDKChannelUpdate msg;
3287 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
3289 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
3291 * The node_id of the node which should receive this message
3293 struct LDKPublicKey node_id;
3295 * The action which should be taken.
3297 struct LDKErrorAction action;
3298 } LDKMessageSendEvent_LDKHandleError_Body;
3300 typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
3302 * The channel/node update which should be sent to NetGraphMsgHandler
3304 struct LDKHTLCFailChannelUpdate update;
3305 } LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
3307 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
3309 * The node_id of this message recipient
3311 struct LDKPublicKey node_id;
3313 * The query_channel_range which should be sent.
3315 struct LDKQueryChannelRange msg;
3316 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
3318 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
3320 * The node_id of this message recipient
3322 struct LDKPublicKey node_id;
3324 * The query_short_channel_ids which should be sent.
3326 struct LDKQueryShortChannelIds msg;
3327 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
3329 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
3331 * The node_id of this message recipient
3333 struct LDKPublicKey node_id;
3335 * The reply_channel_range which should be sent.
3337 struct LDKReplyChannelRange msg;
3338 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
3340 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
3341 LDKMessageSendEvent_Tag tag;
3343 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
3344 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
3345 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
3346 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
3347 LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
3348 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
3349 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
3350 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
3351 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
3352 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
3353 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
3354 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
3355 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
3356 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
3357 LDKMessageSendEvent_LDKHandleError_Body handle_error;
3358 LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update;
3359 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
3360 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
3361 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
3363 } LDKMessageSendEvent;
3366 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
3367 * This corresponds to std::vector in C++
3369 typedef struct LDKCVec_MessageSendEventZ {
3371 * The elements in the array.
3372 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3374 struct LDKMessageSendEvent *data;
3376 * The number of elements pointed to by `data`.
3379 } LDKCVec_MessageSendEventZ;
3382 * The contents of CResult_boolLightningErrorZ
3384 typedef union LDKCResult_boolLightningErrorZPtr {
3386 * A pointer to the contents in the success state.
3387 * Reading from this pointer when `result_ok` is not set is undefined.
3391 * A pointer to the contents in the error state.
3392 * Reading from this pointer when `result_ok` is set is undefined.
3394 struct LDKLightningError *err;
3395 } LDKCResult_boolLightningErrorZPtr;
3398 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
3399 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
3400 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3402 typedef struct LDKCResult_boolLightningErrorZ {
3404 * The contents of this CResult_boolLightningErrorZ, accessible via either
3405 * `err` or `result` depending on the state of `result_ok`.
3407 union LDKCResult_boolLightningErrorZPtr contents;
3409 * Whether this CResult_boolLightningErrorZ represents a success state.
3412 } LDKCResult_boolLightningErrorZ;
3415 * A tuple of 3 elements. See the individual fields for the types contained.
3417 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
3419 * The element at position 0
3421 struct LDKChannelAnnouncement a;
3423 * The element at position 1
3425 struct LDKChannelUpdate b;
3427 * The element at position 2
3429 struct LDKChannelUpdate c;
3430 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
3433 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
3434 * This corresponds to std::vector in C++
3436 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
3438 * The elements in the array.
3439 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3441 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
3443 * The number of elements pointed to by `data`.
3446 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
3449 * A dynamically-allocated array of crate::lightning::ln::msgs::NodeAnnouncements of arbitrary size.
3450 * This corresponds to std::vector in C++
3452 typedef struct LDKCVec_NodeAnnouncementZ {
3454 * The elements in the array.
3455 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3457 struct LDKNodeAnnouncement *data;
3459 * The number of elements pointed to by `data`.
3462 } LDKCVec_NodeAnnouncementZ;
3465 * The contents of CResult_NoneLightningErrorZ
3467 typedef union LDKCResult_NoneLightningErrorZPtr {
3469 * Note that this value is always NULL, as there are no contents in the OK variant
3473 * A pointer to the contents in the error state.
3474 * Reading from this pointer when `result_ok` is set is undefined.
3476 struct LDKLightningError *err;
3477 } LDKCResult_NoneLightningErrorZPtr;
3480 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
3481 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
3482 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3484 typedef struct LDKCResult_NoneLightningErrorZ {
3486 * The contents of this CResult_NoneLightningErrorZ, accessible via either
3487 * `err` or `result` depending on the state of `result_ok`.
3489 union LDKCResult_NoneLightningErrorZPtr contents;
3491 * Whether this CResult_NoneLightningErrorZ represents a success state.
3494 } LDKCResult_NoneLightningErrorZ;
3497 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
3498 * This corresponds to std::vector in C++
3500 typedef struct LDKCVec_PublicKeyZ {
3502 * The elements in the array.
3503 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3505 struct LDKPublicKey *data;
3507 * The number of elements pointed to by `data`.
3510 } LDKCVec_PublicKeyZ;
3515 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
3516 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
3519 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
3521 * A pointer to the opaque Rust object.
3522 * Nearly everywhere, inner must be non-null, however in places where
3523 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3525 LDKnativePeerHandleError *inner;
3527 * Indicates that this is the only struct which contains the same pointer.
3528 * Rust functions which take ownership of an object provided via an argument require
3529 * this to be true and invalidate the object pointed to by inner.
3532 } LDKPeerHandleError;
3535 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
3537 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
3539 * A pointer to the contents in the success state.
3540 * Reading from this pointer when `result_ok` is not set is undefined.
3542 struct LDKCVec_u8Z *result;
3544 * A pointer to the contents in the error state.
3545 * Reading from this pointer when `result_ok` is set is undefined.
3547 struct LDKPeerHandleError *err;
3548 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
3551 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
3552 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
3553 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3555 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
3557 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
3558 * `err` or `result` depending on the state of `result_ok`.
3560 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
3562 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
3565 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
3568 * The contents of CResult_NonePeerHandleErrorZ
3570 typedef union LDKCResult_NonePeerHandleErrorZPtr {
3572 * Note that this value is always NULL, as there are no contents in the OK variant
3576 * A pointer to the contents in the error state.
3577 * Reading from this pointer when `result_ok` is set is undefined.
3579 struct LDKPeerHandleError *err;
3580 } LDKCResult_NonePeerHandleErrorZPtr;
3583 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
3584 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
3585 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3587 typedef struct LDKCResult_NonePeerHandleErrorZ {
3589 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
3590 * `err` or `result` depending on the state of `result_ok`.
3592 union LDKCResult_NonePeerHandleErrorZPtr contents;
3594 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
3597 } LDKCResult_NonePeerHandleErrorZ;
3600 * The contents of CResult_boolPeerHandleErrorZ
3602 typedef union LDKCResult_boolPeerHandleErrorZPtr {
3604 * A pointer to the contents in the success state.
3605 * Reading from this pointer when `result_ok` is not set is undefined.
3609 * A pointer to the contents in the error state.
3610 * Reading from this pointer when `result_ok` is set is undefined.
3612 struct LDKPeerHandleError *err;
3613 } LDKCResult_boolPeerHandleErrorZPtr;
3616 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
3617 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
3618 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3620 typedef struct LDKCResult_boolPeerHandleErrorZ {
3622 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
3623 * `err` or `result` depending on the state of `result_ok`.
3625 union LDKCResult_boolPeerHandleErrorZPtr contents;
3627 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
3630 } LDKCResult_boolPeerHandleErrorZ;
3633 * The contents of CResult_TxOutAccessErrorZ
3635 typedef union LDKCResult_TxOutAccessErrorZPtr {
3637 * A pointer to the contents in the success state.
3638 * Reading from this pointer when `result_ok` is not set is undefined.
3640 struct LDKTxOut *result;
3642 * A pointer to the contents in the error state.
3643 * Reading from this pointer when `result_ok` is set is undefined.
3645 enum LDKAccessError *err;
3646 } LDKCResult_TxOutAccessErrorZPtr;
3649 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
3650 * containing a crate::c_types::TxOut on success and a crate::lightning::chain::AccessError on failure.
3651 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3653 typedef struct LDKCResult_TxOutAccessErrorZ {
3655 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
3656 * `err` or `result` depending on the state of `result_ok`.
3658 union LDKCResult_TxOutAccessErrorZPtr contents;
3660 * Whether this CResult_TxOutAccessErrorZ represents a success state.
3663 } LDKCResult_TxOutAccessErrorZ;
3666 * An enum which can either contain a crate::c_types::derived::C2Tuple_usizeTransactionZ or not
3668 typedef enum LDKCOption_C2Tuple_usizeTransactionZZ_Tag {
3670 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains a crate::c_types::derived::C2Tuple_usizeTransactionZ
3672 LDKCOption_C2Tuple_usizeTransactionZZ_Some,
3674 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains nothing
3676 LDKCOption_C2Tuple_usizeTransactionZZ_None,
3678 * Must be last for serialization purposes
3680 LDKCOption_C2Tuple_usizeTransactionZZ_Sentinel,
3681 } LDKCOption_C2Tuple_usizeTransactionZZ_Tag;
3683 typedef struct LDKCOption_C2Tuple_usizeTransactionZZ {
3684 LDKCOption_C2Tuple_usizeTransactionZZ_Tag tag;
3687 struct LDKC2Tuple_usizeTransactionZ some;
3690 } LDKCOption_C2Tuple_usizeTransactionZZ;
3695 * Details about one direction of a channel. Received
3696 * within a channel update.
3698 typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
3700 * A pointer to the opaque Rust object.
3701 * Nearly everywhere, inner must be non-null, however in places where
3702 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3704 LDKnativeDirectionalChannelInfo *inner;
3706 * Indicates that this is the only struct which contains the same pointer.
3707 * Rust functions which take ownership of an object provided via an argument require
3708 * this to be true and invalidate the object pointed to by inner.
3711 } LDKDirectionalChannelInfo;
3714 * The contents of CResult_DirectionalChannelInfoDecodeErrorZ
3716 typedef union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr {
3718 * A pointer to the contents in the success state.
3719 * Reading from this pointer when `result_ok` is not set is undefined.
3721 struct LDKDirectionalChannelInfo *result;
3723 * A pointer to the contents in the error state.
3724 * Reading from this pointer when `result_ok` is set is undefined.
3726 struct LDKDecodeError *err;
3727 } LDKCResult_DirectionalChannelInfoDecodeErrorZPtr;
3730 * A CResult_DirectionalChannelInfoDecodeErrorZ represents the result of a fallible operation,
3731 * containing a crate::lightning::routing::network_graph::DirectionalChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
3732 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3734 typedef struct LDKCResult_DirectionalChannelInfoDecodeErrorZ {
3736 * The contents of this CResult_DirectionalChannelInfoDecodeErrorZ, accessible via either
3737 * `err` or `result` depending on the state of `result_ok`.
3739 union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr contents;
3741 * Whether this CResult_DirectionalChannelInfoDecodeErrorZ represents a success state.
3744 } LDKCResult_DirectionalChannelInfoDecodeErrorZ;
3749 * Details about a channel (both directions).
3750 * Received within a channel announcement.
3752 typedef struct MUST_USE_STRUCT LDKChannelInfo {
3754 * A pointer to the opaque Rust object.
3755 * Nearly everywhere, inner must be non-null, however in places where
3756 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3758 LDKnativeChannelInfo *inner;
3760 * Indicates that this is the only struct which contains the same pointer.
3761 * Rust functions which take ownership of an object provided via an argument require
3762 * this to be true and invalidate the object pointed to by inner.
3768 * The contents of CResult_ChannelInfoDecodeErrorZ
3770 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
3772 * A pointer to the contents in the success state.
3773 * Reading from this pointer when `result_ok` is not set is undefined.
3775 struct LDKChannelInfo *result;
3777 * A pointer to the contents in the error state.
3778 * Reading from this pointer when `result_ok` is set is undefined.
3780 struct LDKDecodeError *err;
3781 } LDKCResult_ChannelInfoDecodeErrorZPtr;
3784 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
3785 * containing a crate::lightning::routing::network_graph::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
3786 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3788 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
3790 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
3791 * `err` or `result` depending on the state of `result_ok`.
3793 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
3795 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
3798 } LDKCResult_ChannelInfoDecodeErrorZ;
3803 * Fees for routing via a given channel or a node
3805 typedef struct MUST_USE_STRUCT LDKRoutingFees {
3807 * A pointer to the opaque Rust object.
3808 * Nearly everywhere, inner must be non-null, however in places where
3809 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3811 LDKnativeRoutingFees *inner;
3813 * Indicates that this is the only struct which contains the same pointer.
3814 * Rust functions which take ownership of an object provided via an argument require
3815 * this to be true and invalidate the object pointed to by inner.
3821 * The contents of CResult_RoutingFeesDecodeErrorZ
3823 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
3825 * A pointer to the contents in the success state.
3826 * Reading from this pointer when `result_ok` is not set is undefined.
3828 struct LDKRoutingFees *result;
3830 * A pointer to the contents in the error state.
3831 * Reading from this pointer when `result_ok` is set is undefined.
3833 struct LDKDecodeError *err;
3834 } LDKCResult_RoutingFeesDecodeErrorZPtr;
3837 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
3838 * containing a crate::lightning::routing::network_graph::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
3839 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3841 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
3843 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
3844 * `err` or `result` depending on the state of `result_ok`.
3846 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
3848 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
3851 } LDKCResult_RoutingFeesDecodeErrorZ;
3854 * A 4-byte byte array.
3856 typedef struct LDKFourBytes {
3864 * A 16-byte byte array.
3866 typedef struct LDKSixteenBytes {
3874 * A 10-byte byte array.
3876 typedef struct LDKTenBytes {
3884 * An address which can be used to connect to a remote peer
3886 typedef enum LDKNetAddress_Tag {
3888 * An IPv4 address/port on which the peer is listening.
3892 * An IPv6 address/port on which the peer is listening.
3896 * An old-style Tor onion address/port on which the peer is listening.
3898 LDKNetAddress_OnionV2,
3900 * A new-style Tor onion address/port on which the peer is listening.
3901 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
3902 * wrap as base32 and append \".onion\".
3904 LDKNetAddress_OnionV3,
3906 * Must be last for serialization purposes
3908 LDKNetAddress_Sentinel,
3909 } LDKNetAddress_Tag;
3911 typedef struct LDKNetAddress_LDKIPv4_Body {
3913 * The 4-byte IPv4 address
3915 struct LDKFourBytes addr;
3917 * The port on which the node is listening
3920 } LDKNetAddress_LDKIPv4_Body;
3922 typedef struct LDKNetAddress_LDKIPv6_Body {
3924 * The 16-byte IPv6 address
3926 struct LDKSixteenBytes addr;
3928 * The port on which the node is listening
3931 } LDKNetAddress_LDKIPv6_Body;
3933 typedef struct LDKNetAddress_LDKOnionV2_Body {
3935 * The bytes (usually encoded in base32 with \".onion\" appended)
3937 struct LDKTenBytes addr;
3939 * The port on which the node is listening
3942 } LDKNetAddress_LDKOnionV2_Body;
3944 typedef struct LDKNetAddress_LDKOnionV3_Body {
3946 * The ed25519 long-term public key of the peer
3948 struct LDKThirtyTwoBytes ed25519_pubkey;
3950 * The checksum of the pubkey and version, as included in the onion address
3954 * The version byte, as defined by the Tor Onion v3 spec.
3958 * The port on which the node is listening
3961 } LDKNetAddress_LDKOnionV3_Body;
3963 typedef struct MUST_USE_STRUCT LDKNetAddress {
3964 LDKNetAddress_Tag tag;
3966 LDKNetAddress_LDKIPv4_Body i_pv4;
3967 LDKNetAddress_LDKIPv6_Body i_pv6;
3968 LDKNetAddress_LDKOnionV2_Body onion_v2;
3969 LDKNetAddress_LDKOnionV3_Body onion_v3;
3974 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
3975 * This corresponds to std::vector in C++
3977 typedef struct LDKCVec_NetAddressZ {
3979 * The elements in the array.
3980 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3982 struct LDKNetAddress *data;
3984 * The number of elements pointed to by `data`.
3987 } LDKCVec_NetAddressZ;
3992 * Information received in the latest node_announcement from this node.
3994 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
3996 * A pointer to the opaque Rust object.
3997 * Nearly everywhere, inner must be non-null, however in places where
3998 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4000 LDKnativeNodeAnnouncementInfo *inner;
4002 * Indicates that this is the only struct which contains the same pointer.
4003 * Rust functions which take ownership of an object provided via an argument require
4004 * this to be true and invalidate the object pointed to by inner.
4007 } LDKNodeAnnouncementInfo;
4010 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
4012 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
4014 * A pointer to the contents in the success state.
4015 * Reading from this pointer when `result_ok` is not set is undefined.
4017 struct LDKNodeAnnouncementInfo *result;
4019 * A pointer to the contents in the error state.
4020 * Reading from this pointer when `result_ok` is set is undefined.
4022 struct LDKDecodeError *err;
4023 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
4026 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
4027 * containing a crate::lightning::routing::network_graph::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4028 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4030 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
4032 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
4033 * `err` or `result` depending on the state of `result_ok`.
4035 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
4037 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
4040 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
4043 * A dynamically-allocated array of u64s of arbitrary size.
4044 * This corresponds to std::vector in C++
4046 typedef struct LDKCVec_u64Z {
4048 * The elements in the array.
4049 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4053 * The number of elements pointed to by `data`.
4061 * Details about a node in the network, known from the network announcement.
4063 typedef struct MUST_USE_STRUCT LDKNodeInfo {
4065 * A pointer to the opaque Rust object.
4066 * Nearly everywhere, inner must be non-null, however in places where
4067 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4069 LDKnativeNodeInfo *inner;
4071 * Indicates that this is the only struct which contains the same pointer.
4072 * Rust functions which take ownership of an object provided via an argument require
4073 * this to be true and invalidate the object pointed to by inner.
4079 * The contents of CResult_NodeInfoDecodeErrorZ
4081 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
4083 * A pointer to the contents in the success state.
4084 * Reading from this pointer when `result_ok` is not set is undefined.
4086 struct LDKNodeInfo *result;
4088 * A pointer to the contents in the error state.
4089 * Reading from this pointer when `result_ok` is set is undefined.
4091 struct LDKDecodeError *err;
4092 } LDKCResult_NodeInfoDecodeErrorZPtr;
4095 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
4096 * containing a crate::lightning::routing::network_graph::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4097 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4099 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
4101 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
4102 * `err` or `result` depending on the state of `result_ok`.
4104 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
4106 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
4109 } LDKCResult_NodeInfoDecodeErrorZ;
4114 * Represents the network as nodes and channels between them
4116 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
4118 * A pointer to the opaque Rust object.
4119 * Nearly everywhere, inner must be non-null, however in places where
4120 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4122 LDKnativeNetworkGraph *inner;
4124 * Indicates that this is the only struct which contains the same pointer.
4125 * Rust functions which take ownership of an object provided via an argument require
4126 * this to be true and invalidate the object pointed to by inner.
4132 * The contents of CResult_NetworkGraphDecodeErrorZ
4134 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
4136 * A pointer to the contents in the success state.
4137 * Reading from this pointer when `result_ok` is not set is undefined.
4139 struct LDKNetworkGraph *result;
4141 * A pointer to the contents in the error state.
4142 * Reading from this pointer when `result_ok` is set is undefined.
4144 struct LDKDecodeError *err;
4145 } LDKCResult_NetworkGraphDecodeErrorZPtr;
4148 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
4149 * containing a crate::lightning::routing::network_graph::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
4150 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4152 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
4154 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
4155 * `err` or `result` depending on the state of `result_ok`.
4157 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
4159 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
4162 } LDKCResult_NetworkGraphDecodeErrorZ;
4167 * Features used within an `init` message.
4169 typedef struct MUST_USE_STRUCT LDKInitFeatures {
4171 * A pointer to the opaque Rust object.
4172 * Nearly everywhere, inner must be non-null, however in places where
4173 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4175 LDKnativeInitFeatures *inner;
4177 * Indicates that this is the only struct which contains the same pointer.
4178 * Rust functions which take ownership of an object provided via an argument require
4179 * this to be true and invalidate the object pointed to by inner.
4185 * The contents of CResult_InitFeaturesDecodeErrorZ
4187 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
4189 * A pointer to the contents in the success state.
4190 * Reading from this pointer when `result_ok` is not set is undefined.
4192 struct LDKInitFeatures *result;
4194 * A pointer to the contents in the error state.
4195 * Reading from this pointer when `result_ok` is set is undefined.
4197 struct LDKDecodeError *err;
4198 } LDKCResult_InitFeaturesDecodeErrorZPtr;
4201 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
4202 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4203 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4205 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
4207 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
4208 * `err` or `result` depending on the state of `result_ok`.
4210 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
4212 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
4215 } LDKCResult_InitFeaturesDecodeErrorZ;
4220 * Features used within a `node_announcement` message.
4222 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
4224 * A pointer to the opaque Rust object.
4225 * Nearly everywhere, inner must be non-null, however in places where
4226 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4228 LDKnativeNodeFeatures *inner;
4230 * Indicates that this is the only struct which contains the same pointer.
4231 * Rust functions which take ownership of an object provided via an argument require
4232 * this to be true and invalidate the object pointed to by inner.
4238 * The contents of CResult_NodeFeaturesDecodeErrorZ
4240 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
4242 * A pointer to the contents in the success state.
4243 * Reading from this pointer when `result_ok` is not set is undefined.
4245 struct LDKNodeFeatures *result;
4247 * A pointer to the contents in the error state.
4248 * Reading from this pointer when `result_ok` is set is undefined.
4250 struct LDKDecodeError *err;
4251 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
4254 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
4255 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4256 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4258 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
4260 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
4261 * `err` or `result` depending on the state of `result_ok`.
4263 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
4265 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
4268 } LDKCResult_NodeFeaturesDecodeErrorZ;
4273 * Features used within a `channel_announcement` message.
4275 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
4277 * A pointer to the opaque Rust object.
4278 * Nearly everywhere, inner must be non-null, however in places where
4279 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4281 LDKnativeChannelFeatures *inner;
4283 * Indicates that this is the only struct which contains the same pointer.
4284 * Rust functions which take ownership of an object provided via an argument require
4285 * this to be true and invalidate the object pointed to by inner.
4288 } LDKChannelFeatures;
4291 * The contents of CResult_ChannelFeaturesDecodeErrorZ
4293 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
4295 * A pointer to the contents in the success state.
4296 * Reading from this pointer when `result_ok` is not set is undefined.
4298 struct LDKChannelFeatures *result;
4300 * A pointer to the contents in the error state.
4301 * Reading from this pointer when `result_ok` is set is undefined.
4303 struct LDKDecodeError *err;
4304 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
4307 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
4308 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4309 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4311 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
4313 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
4314 * `err` or `result` depending on the state of `result_ok`.
4316 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
4318 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
4321 } LDKCResult_ChannelFeaturesDecodeErrorZ;
4326 * Features used within an invoice.
4328 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
4330 * A pointer to the opaque Rust object.
4331 * Nearly everywhere, inner must be non-null, however in places where
4332 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4334 LDKnativeInvoiceFeatures *inner;
4336 * Indicates that this is the only struct which contains the same pointer.
4337 * Rust functions which take ownership of an object provided via an argument require
4338 * this to be true and invalidate the object pointed to by inner.
4341 } LDKInvoiceFeatures;
4344 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
4346 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
4348 * A pointer to the contents in the success state.
4349 * Reading from this pointer when `result_ok` is not set is undefined.
4351 struct LDKInvoiceFeatures *result;
4353 * A pointer to the contents in the error state.
4354 * Reading from this pointer when `result_ok` is set is undefined.
4356 struct LDKDecodeError *err;
4357 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
4360 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
4361 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4362 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4364 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
4366 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
4367 * `err` or `result` depending on the state of `result_ok`.
4369 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
4371 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
4374 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
4377 * The contents of CResult_NetAddressu8Z
4379 typedef union LDKCResult_NetAddressu8ZPtr {
4381 * A pointer to the contents in the success state.
4382 * Reading from this pointer when `result_ok` is not set is undefined.
4384 struct LDKNetAddress *result;
4386 * A pointer to the contents in the error state.
4387 * Reading from this pointer when `result_ok` is set is undefined.
4390 } LDKCResult_NetAddressu8ZPtr;
4393 * A CResult_NetAddressu8Z represents the result of a fallible operation,
4394 * containing a crate::lightning::ln::msgs::NetAddress on success and a u8 on failure.
4395 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4397 typedef struct LDKCResult_NetAddressu8Z {
4399 * The contents of this CResult_NetAddressu8Z, accessible via either
4400 * `err` or `result` depending on the state of `result_ok`.
4402 union LDKCResult_NetAddressu8ZPtr contents;
4404 * Whether this CResult_NetAddressu8Z represents a success state.
4407 } LDKCResult_NetAddressu8Z;
4410 * The contents of CResult_CResult_NetAddressu8ZDecodeErrorZ
4412 typedef union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr {
4414 * A pointer to the contents in the success state.
4415 * Reading from this pointer when `result_ok` is not set is undefined.
4417 struct LDKCResult_NetAddressu8Z *result;
4419 * A pointer to the contents in the error state.
4420 * Reading from this pointer when `result_ok` is set is undefined.
4422 struct LDKDecodeError *err;
4423 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr;
4426 * A CResult_CResult_NetAddressu8ZDecodeErrorZ represents the result of a fallible operation,
4427 * containing a crate::c_types::derived::CResult_NetAddressu8Z on success and a crate::lightning::ln::msgs::DecodeError on failure.
4428 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4430 typedef struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ {
4432 * The contents of this CResult_CResult_NetAddressu8ZDecodeErrorZ, accessible via either
4433 * `err` or `result` depending on the state of `result_ok`.
4435 union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr contents;
4437 * Whether this CResult_CResult_NetAddressu8ZDecodeErrorZ represents a success state.
4440 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZ;
4445 * An update_add_htlc message to be sent or received from a peer
4447 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
4449 * A pointer to the opaque Rust object.
4450 * Nearly everywhere, inner must be non-null, however in places where
4451 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4453 LDKnativeUpdateAddHTLC *inner;
4455 * Indicates that this is the only struct which contains the same pointer.
4456 * Rust functions which take ownership of an object provided via an argument require
4457 * this to be true and invalidate the object pointed to by inner.
4463 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
4464 * This corresponds to std::vector in C++
4466 typedef struct LDKCVec_UpdateAddHTLCZ {
4468 * The elements in the array.
4469 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4471 struct LDKUpdateAddHTLC *data;
4473 * The number of elements pointed to by `data`.
4476 } LDKCVec_UpdateAddHTLCZ;
4481 * An update_fulfill_htlc message to be sent or received from a peer
4483 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
4485 * A pointer to the opaque Rust object.
4486 * Nearly everywhere, inner must be non-null, however in places where
4487 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4489 LDKnativeUpdateFulfillHTLC *inner;
4491 * Indicates that this is the only struct which contains the same pointer.
4492 * Rust functions which take ownership of an object provided via an argument require
4493 * this to be true and invalidate the object pointed to by inner.
4496 } LDKUpdateFulfillHTLC;
4499 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
4500 * This corresponds to std::vector in C++
4502 typedef struct LDKCVec_UpdateFulfillHTLCZ {
4504 * The elements in the array.
4505 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4507 struct LDKUpdateFulfillHTLC *data;
4509 * The number of elements pointed to by `data`.
4512 } LDKCVec_UpdateFulfillHTLCZ;
4517 * An update_fail_htlc message to be sent or received from a peer
4519 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
4521 * A pointer to the opaque Rust object.
4522 * Nearly everywhere, inner must be non-null, however in places where
4523 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4525 LDKnativeUpdateFailHTLC *inner;
4527 * Indicates that this is the only struct which contains the same pointer.
4528 * Rust functions which take ownership of an object provided via an argument require
4529 * this to be true and invalidate the object pointed to by inner.
4532 } LDKUpdateFailHTLC;
4535 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
4536 * This corresponds to std::vector in C++
4538 typedef struct LDKCVec_UpdateFailHTLCZ {
4540 * The elements in the array.
4541 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4543 struct LDKUpdateFailHTLC *data;
4545 * The number of elements pointed to by `data`.
4548 } LDKCVec_UpdateFailHTLCZ;
4553 * An update_fail_malformed_htlc message to be sent or received from a peer
4555 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
4557 * A pointer to the opaque Rust object.
4558 * Nearly everywhere, inner must be non-null, however in places where
4559 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4561 LDKnativeUpdateFailMalformedHTLC *inner;
4563 * Indicates that this is the only struct which contains the same pointer.
4564 * Rust functions which take ownership of an object provided via an argument require
4565 * this to be true and invalidate the object pointed to by inner.
4568 } LDKUpdateFailMalformedHTLC;
4571 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
4572 * This corresponds to std::vector in C++
4574 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
4576 * The elements in the array.
4577 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4579 struct LDKUpdateFailMalformedHTLC *data;
4581 * The number of elements pointed to by `data`.
4584 } LDKCVec_UpdateFailMalformedHTLCZ;
4587 * The contents of CResult_AcceptChannelDecodeErrorZ
4589 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
4591 * A pointer to the contents in the success state.
4592 * Reading from this pointer when `result_ok` is not set is undefined.
4594 struct LDKAcceptChannel *result;
4596 * A pointer to the contents in the error state.
4597 * Reading from this pointer when `result_ok` is set is undefined.
4599 struct LDKDecodeError *err;
4600 } LDKCResult_AcceptChannelDecodeErrorZPtr;
4603 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
4604 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
4605 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4607 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
4609 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
4610 * `err` or `result` depending on the state of `result_ok`.
4612 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
4614 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
4617 } LDKCResult_AcceptChannelDecodeErrorZ;
4620 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
4622 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
4624 * A pointer to the contents in the success state.
4625 * Reading from this pointer when `result_ok` is not set is undefined.
4627 struct LDKAnnouncementSignatures *result;
4629 * A pointer to the contents in the error state.
4630 * Reading from this pointer when `result_ok` is set is undefined.
4632 struct LDKDecodeError *err;
4633 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
4636 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
4637 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4638 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4640 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
4642 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
4643 * `err` or `result` depending on the state of `result_ok`.
4645 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
4647 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
4650 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
4653 * The contents of CResult_ChannelReestablishDecodeErrorZ
4655 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
4657 * A pointer to the contents in the success state.
4658 * Reading from this pointer when `result_ok` is not set is undefined.
4660 struct LDKChannelReestablish *result;
4662 * A pointer to the contents in the error state.
4663 * Reading from this pointer when `result_ok` is set is undefined.
4665 struct LDKDecodeError *err;
4666 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
4669 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
4670 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
4671 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4673 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
4675 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
4676 * `err` or `result` depending on the state of `result_ok`.
4678 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
4680 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
4683 } LDKCResult_ChannelReestablishDecodeErrorZ;
4686 * The contents of CResult_ClosingSignedDecodeErrorZ
4688 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
4690 * A pointer to the contents in the success state.
4691 * Reading from this pointer when `result_ok` is not set is undefined.
4693 struct LDKClosingSigned *result;
4695 * A pointer to the contents in the error state.
4696 * Reading from this pointer when `result_ok` is set is undefined.
4698 struct LDKDecodeError *err;
4699 } LDKCResult_ClosingSignedDecodeErrorZPtr;
4702 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
4703 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
4704 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4706 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
4708 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
4709 * `err` or `result` depending on the state of `result_ok`.
4711 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
4713 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
4716 } LDKCResult_ClosingSignedDecodeErrorZ;
4721 * A commitment_signed message to be sent or received from a peer
4723 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
4725 * A pointer to the opaque Rust object.
4726 * Nearly everywhere, inner must be non-null, however in places where
4727 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4729 LDKnativeCommitmentSigned *inner;
4731 * Indicates that this is the only struct which contains the same pointer.
4732 * Rust functions which take ownership of an object provided via an argument require
4733 * this to be true and invalidate the object pointed to by inner.
4736 } LDKCommitmentSigned;
4739 * The contents of CResult_CommitmentSignedDecodeErrorZ
4741 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
4743 * A pointer to the contents in the success state.
4744 * Reading from this pointer when `result_ok` is not set is undefined.
4746 struct LDKCommitmentSigned *result;
4748 * A pointer to the contents in the error state.
4749 * Reading from this pointer when `result_ok` is set is undefined.
4751 struct LDKDecodeError *err;
4752 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
4755 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
4756 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
4757 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4759 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
4761 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
4762 * `err` or `result` depending on the state of `result_ok`.
4764 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
4766 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
4769 } LDKCResult_CommitmentSignedDecodeErrorZ;
4772 * The contents of CResult_FundingCreatedDecodeErrorZ
4774 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
4776 * A pointer to the contents in the success state.
4777 * Reading from this pointer when `result_ok` is not set is undefined.
4779 struct LDKFundingCreated *result;
4781 * A pointer to the contents in the error state.
4782 * Reading from this pointer when `result_ok` is set is undefined.
4784 struct LDKDecodeError *err;
4785 } LDKCResult_FundingCreatedDecodeErrorZPtr;
4788 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
4789 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
4790 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4792 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
4794 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
4795 * `err` or `result` depending on the state of `result_ok`.
4797 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
4799 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
4802 } LDKCResult_FundingCreatedDecodeErrorZ;
4805 * The contents of CResult_FundingSignedDecodeErrorZ
4807 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
4809 * A pointer to the contents in the success state.
4810 * Reading from this pointer when `result_ok` is not set is undefined.
4812 struct LDKFundingSigned *result;
4814 * A pointer to the contents in the error state.
4815 * Reading from this pointer when `result_ok` is set is undefined.
4817 struct LDKDecodeError *err;
4818 } LDKCResult_FundingSignedDecodeErrorZPtr;
4821 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
4822 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
4823 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4825 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
4827 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
4828 * `err` or `result` depending on the state of `result_ok`.
4830 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
4832 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
4835 } LDKCResult_FundingSignedDecodeErrorZ;
4838 * The contents of CResult_FundingLockedDecodeErrorZ
4840 typedef union LDKCResult_FundingLockedDecodeErrorZPtr {
4842 * A pointer to the contents in the success state.
4843 * Reading from this pointer when `result_ok` is not set is undefined.
4845 struct LDKFundingLocked *result;
4847 * A pointer to the contents in the error state.
4848 * Reading from this pointer when `result_ok` is set is undefined.
4850 struct LDKDecodeError *err;
4851 } LDKCResult_FundingLockedDecodeErrorZPtr;
4854 * A CResult_FundingLockedDecodeErrorZ represents the result of a fallible operation,
4855 * containing a crate::lightning::ln::msgs::FundingLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
4856 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4858 typedef struct LDKCResult_FundingLockedDecodeErrorZ {
4860 * The contents of this CResult_FundingLockedDecodeErrorZ, accessible via either
4861 * `err` or `result` depending on the state of `result_ok`.
4863 union LDKCResult_FundingLockedDecodeErrorZPtr contents;
4865 * Whether this CResult_FundingLockedDecodeErrorZ represents a success state.
4868 } LDKCResult_FundingLockedDecodeErrorZ;
4873 * An init message to be sent or received from a peer
4875 typedef struct MUST_USE_STRUCT LDKInit {
4877 * A pointer to the opaque Rust object.
4878 * Nearly everywhere, inner must be non-null, however in places where
4879 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4881 LDKnativeInit *inner;
4883 * Indicates that this is the only struct which contains the same pointer.
4884 * Rust functions which take ownership of an object provided via an argument require
4885 * this to be true and invalidate the object pointed to by inner.
4891 * The contents of CResult_InitDecodeErrorZ
4893 typedef union LDKCResult_InitDecodeErrorZPtr {
4895 * A pointer to the contents in the success state.
4896 * Reading from this pointer when `result_ok` is not set is undefined.
4898 struct LDKInit *result;
4900 * A pointer to the contents in the error state.
4901 * Reading from this pointer when `result_ok` is set is undefined.
4903 struct LDKDecodeError *err;
4904 } LDKCResult_InitDecodeErrorZPtr;
4907 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
4908 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
4909 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4911 typedef struct LDKCResult_InitDecodeErrorZ {
4913 * The contents of this CResult_InitDecodeErrorZ, accessible via either
4914 * `err` or `result` depending on the state of `result_ok`.
4916 union LDKCResult_InitDecodeErrorZPtr contents;
4918 * Whether this CResult_InitDecodeErrorZ represents a success state.
4921 } LDKCResult_InitDecodeErrorZ;
4924 * The contents of CResult_OpenChannelDecodeErrorZ
4926 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
4928 * A pointer to the contents in the success state.
4929 * Reading from this pointer when `result_ok` is not set is undefined.
4931 struct LDKOpenChannel *result;
4933 * A pointer to the contents in the error state.
4934 * Reading from this pointer when `result_ok` is set is undefined.
4936 struct LDKDecodeError *err;
4937 } LDKCResult_OpenChannelDecodeErrorZPtr;
4940 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
4941 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
4942 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4944 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
4946 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
4947 * `err` or `result` depending on the state of `result_ok`.
4949 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
4951 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
4954 } LDKCResult_OpenChannelDecodeErrorZ;
4957 * The contents of CResult_RevokeAndACKDecodeErrorZ
4959 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
4961 * A pointer to the contents in the success state.
4962 * Reading from this pointer when `result_ok` is not set is undefined.
4964 struct LDKRevokeAndACK *result;
4966 * A pointer to the contents in the error state.
4967 * Reading from this pointer when `result_ok` is set is undefined.
4969 struct LDKDecodeError *err;
4970 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
4973 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
4974 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
4975 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4977 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
4979 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
4980 * `err` or `result` depending on the state of `result_ok`.
4982 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
4984 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
4987 } LDKCResult_RevokeAndACKDecodeErrorZ;
4990 * The contents of CResult_ShutdownDecodeErrorZ
4992 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
4994 * A pointer to the contents in the success state.
4995 * Reading from this pointer when `result_ok` is not set is undefined.
4997 struct LDKShutdown *result;
4999 * A pointer to the contents in the error state.
5000 * Reading from this pointer when `result_ok` is set is undefined.
5002 struct LDKDecodeError *err;
5003 } LDKCResult_ShutdownDecodeErrorZPtr;
5006 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
5007 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
5008 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5010 typedef struct LDKCResult_ShutdownDecodeErrorZ {
5012 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
5013 * `err` or `result` depending on the state of `result_ok`.
5015 union LDKCResult_ShutdownDecodeErrorZPtr contents;
5017 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
5020 } LDKCResult_ShutdownDecodeErrorZ;
5023 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
5025 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
5027 * A pointer to the contents in the success state.
5028 * Reading from this pointer when `result_ok` is not set is undefined.
5030 struct LDKUpdateFailHTLC *result;
5032 * A pointer to the contents in the error state.
5033 * Reading from this pointer when `result_ok` is set is undefined.
5035 struct LDKDecodeError *err;
5036 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
5039 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
5040 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5041 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5043 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
5045 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
5046 * `err` or `result` depending on the state of `result_ok`.
5048 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
5050 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
5053 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
5056 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
5058 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5060 * A pointer to the contents in the success state.
5061 * Reading from this pointer when `result_ok` is not set is undefined.
5063 struct LDKUpdateFailMalformedHTLC *result;
5065 * A pointer to the contents in the error state.
5066 * Reading from this pointer when `result_ok` is set is undefined.
5068 struct LDKDecodeError *err;
5069 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
5072 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
5073 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5074 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5076 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
5078 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
5079 * `err` or `result` depending on the state of `result_ok`.
5081 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
5083 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
5086 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
5091 * An update_fee message to be sent or received from a peer
5093 typedef struct MUST_USE_STRUCT LDKUpdateFee {
5095 * A pointer to the opaque Rust object.
5096 * Nearly everywhere, inner must be non-null, however in places where
5097 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5099 LDKnativeUpdateFee *inner;
5101 * Indicates that this is the only struct which contains the same pointer.
5102 * Rust functions which take ownership of an object provided via an argument require
5103 * this to be true and invalidate the object pointed to by inner.
5109 * The contents of CResult_UpdateFeeDecodeErrorZ
5111 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
5113 * A pointer to the contents in the success state.
5114 * Reading from this pointer when `result_ok` is not set is undefined.
5116 struct LDKUpdateFee *result;
5118 * A pointer to the contents in the error state.
5119 * Reading from this pointer when `result_ok` is set is undefined.
5121 struct LDKDecodeError *err;
5122 } LDKCResult_UpdateFeeDecodeErrorZPtr;
5125 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
5126 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
5127 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5129 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
5131 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
5132 * `err` or `result` depending on the state of `result_ok`.
5134 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
5136 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
5139 } LDKCResult_UpdateFeeDecodeErrorZ;
5142 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
5144 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
5146 * A pointer to the contents in the success state.
5147 * Reading from this pointer when `result_ok` is not set is undefined.
5149 struct LDKUpdateFulfillHTLC *result;
5151 * A pointer to the contents in the error state.
5152 * Reading from this pointer when `result_ok` is set is undefined.
5154 struct LDKDecodeError *err;
5155 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
5158 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
5159 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5160 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5162 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
5164 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
5165 * `err` or `result` depending on the state of `result_ok`.
5167 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
5169 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
5172 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
5175 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
5177 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
5179 * A pointer to the contents in the success state.
5180 * Reading from this pointer when `result_ok` is not set is undefined.
5182 struct LDKUpdateAddHTLC *result;
5184 * A pointer to the contents in the error state.
5185 * Reading from this pointer when `result_ok` is set is undefined.
5187 struct LDKDecodeError *err;
5188 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
5191 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
5192 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5193 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5195 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
5197 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
5198 * `err` or `result` depending on the state of `result_ok`.
5200 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
5202 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
5205 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
5210 * A ping message to be sent or received from a peer
5212 typedef struct MUST_USE_STRUCT LDKPing {
5214 * A pointer to the opaque Rust object.
5215 * Nearly everywhere, inner must be non-null, however in places where
5216 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5218 LDKnativePing *inner;
5220 * Indicates that this is the only struct which contains the same pointer.
5221 * Rust functions which take ownership of an object provided via an argument require
5222 * this to be true and invalidate the object pointed to by inner.
5228 * The contents of CResult_PingDecodeErrorZ
5230 typedef union LDKCResult_PingDecodeErrorZPtr {
5232 * A pointer to the contents in the success state.
5233 * Reading from this pointer when `result_ok` is not set is undefined.
5235 struct LDKPing *result;
5237 * A pointer to the contents in the error state.
5238 * Reading from this pointer when `result_ok` is set is undefined.
5240 struct LDKDecodeError *err;
5241 } LDKCResult_PingDecodeErrorZPtr;
5244 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
5245 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
5246 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5248 typedef struct LDKCResult_PingDecodeErrorZ {
5250 * The contents of this CResult_PingDecodeErrorZ, accessible via either
5251 * `err` or `result` depending on the state of `result_ok`.
5253 union LDKCResult_PingDecodeErrorZPtr contents;
5255 * Whether this CResult_PingDecodeErrorZ represents a success state.
5258 } LDKCResult_PingDecodeErrorZ;
5263 * A pong message to be sent or received from a peer
5265 typedef struct MUST_USE_STRUCT LDKPong {
5267 * A pointer to the opaque Rust object.
5268 * Nearly everywhere, inner must be non-null, however in places where
5269 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5271 LDKnativePong *inner;
5273 * Indicates that this is the only struct which contains the same pointer.
5274 * Rust functions which take ownership of an object provided via an argument require
5275 * this to be true and invalidate the object pointed to by inner.
5281 * The contents of CResult_PongDecodeErrorZ
5283 typedef union LDKCResult_PongDecodeErrorZPtr {
5285 * A pointer to the contents in the success state.
5286 * Reading from this pointer when `result_ok` is not set is undefined.
5288 struct LDKPong *result;
5290 * A pointer to the contents in the error state.
5291 * Reading from this pointer when `result_ok` is set is undefined.
5293 struct LDKDecodeError *err;
5294 } LDKCResult_PongDecodeErrorZPtr;
5297 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
5298 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
5299 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5301 typedef struct LDKCResult_PongDecodeErrorZ {
5303 * The contents of this CResult_PongDecodeErrorZ, accessible via either
5304 * `err` or `result` depending on the state of `result_ok`.
5306 union LDKCResult_PongDecodeErrorZPtr contents;
5308 * Whether this CResult_PongDecodeErrorZ represents a success state.
5311 } LDKCResult_PongDecodeErrorZ;
5314 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
5316 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
5318 * A pointer to the contents in the success state.
5319 * Reading from this pointer when `result_ok` is not set is undefined.
5321 struct LDKUnsignedChannelAnnouncement *result;
5323 * A pointer to the contents in the error state.
5324 * Reading from this pointer when `result_ok` is set is undefined.
5326 struct LDKDecodeError *err;
5327 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
5330 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
5331 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
5332 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5334 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
5336 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
5337 * `err` or `result` depending on the state of `result_ok`.
5339 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
5341 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
5344 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
5347 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
5349 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
5351 * A pointer to the contents in the success state.
5352 * Reading from this pointer when `result_ok` is not set is undefined.
5354 struct LDKChannelAnnouncement *result;
5356 * A pointer to the contents in the error state.
5357 * Reading from this pointer when `result_ok` is set is undefined.
5359 struct LDKDecodeError *err;
5360 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
5363 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
5364 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
5365 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5367 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
5369 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
5370 * `err` or `result` depending on the state of `result_ok`.
5372 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
5374 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
5377 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
5382 * The unsigned part of a channel_update
5384 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
5386 * A pointer to the opaque Rust object.
5387 * Nearly everywhere, inner must be non-null, however in places where
5388 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5390 LDKnativeUnsignedChannelUpdate *inner;
5392 * Indicates that this is the only struct which contains the same pointer.
5393 * Rust functions which take ownership of an object provided via an argument require
5394 * this to be true and invalidate the object pointed to by inner.
5397 } LDKUnsignedChannelUpdate;
5400 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
5402 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
5404 * A pointer to the contents in the success state.
5405 * Reading from this pointer when `result_ok` is not set is undefined.
5407 struct LDKUnsignedChannelUpdate *result;
5409 * A pointer to the contents in the error state.
5410 * Reading from this pointer when `result_ok` is set is undefined.
5412 struct LDKDecodeError *err;
5413 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
5416 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
5417 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
5418 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5420 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
5422 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
5423 * `err` or `result` depending on the state of `result_ok`.
5425 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
5427 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
5430 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
5433 * The contents of CResult_ChannelUpdateDecodeErrorZ
5435 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
5437 * A pointer to the contents in the success state.
5438 * Reading from this pointer when `result_ok` is not set is undefined.
5440 struct LDKChannelUpdate *result;
5442 * A pointer to the contents in the error state.
5443 * Reading from this pointer when `result_ok` is set is undefined.
5445 struct LDKDecodeError *err;
5446 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
5449 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
5450 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
5451 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5453 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
5455 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
5456 * `err` or `result` depending on the state of `result_ok`.
5458 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
5460 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
5463 } LDKCResult_ChannelUpdateDecodeErrorZ;
5466 * The contents of CResult_ErrorMessageDecodeErrorZ
5468 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
5470 * A pointer to the contents in the success state.
5471 * Reading from this pointer when `result_ok` is not set is undefined.
5473 struct LDKErrorMessage *result;
5475 * A pointer to the contents in the error state.
5476 * Reading from this pointer when `result_ok` is set is undefined.
5478 struct LDKDecodeError *err;
5479 } LDKCResult_ErrorMessageDecodeErrorZPtr;
5482 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
5483 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
5484 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5486 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
5488 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
5489 * `err` or `result` depending on the state of `result_ok`.
5491 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
5493 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
5496 } LDKCResult_ErrorMessageDecodeErrorZ;
5501 * The unsigned part of a node_announcement
5503 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
5505 * A pointer to the opaque Rust object.
5506 * Nearly everywhere, inner must be non-null, however in places where
5507 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5509 LDKnativeUnsignedNodeAnnouncement *inner;
5511 * Indicates that this is the only struct which contains the same pointer.
5512 * Rust functions which take ownership of an object provided via an argument require
5513 * this to be true and invalidate the object pointed to by inner.
5516 } LDKUnsignedNodeAnnouncement;
5519 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
5521 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
5523 * A pointer to the contents in the success state.
5524 * Reading from this pointer when `result_ok` is not set is undefined.
5526 struct LDKUnsignedNodeAnnouncement *result;
5528 * A pointer to the contents in the error state.
5529 * Reading from this pointer when `result_ok` is set is undefined.
5531 struct LDKDecodeError *err;
5532 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
5535 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
5536 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
5537 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5539 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
5541 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
5542 * `err` or `result` depending on the state of `result_ok`.
5544 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
5546 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
5549 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
5552 * The contents of CResult_NodeAnnouncementDecodeErrorZ
5554 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
5556 * A pointer to the contents in the success state.
5557 * Reading from this pointer when `result_ok` is not set is undefined.
5559 struct LDKNodeAnnouncement *result;
5561 * A pointer to the contents in the error state.
5562 * Reading from this pointer when `result_ok` is set is undefined.
5564 struct LDKDecodeError *err;
5565 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
5568 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
5569 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
5570 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5572 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
5574 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
5575 * `err` or `result` depending on the state of `result_ok`.
5577 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
5579 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
5582 } LDKCResult_NodeAnnouncementDecodeErrorZ;
5585 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
5587 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
5589 * A pointer to the contents in the success state.
5590 * Reading from this pointer when `result_ok` is not set is undefined.
5592 struct LDKQueryShortChannelIds *result;
5594 * A pointer to the contents in the error state.
5595 * Reading from this pointer when `result_ok` is set is undefined.
5597 struct LDKDecodeError *err;
5598 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
5601 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
5602 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
5603 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5605 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
5607 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
5608 * `err` or `result` depending on the state of `result_ok`.
5610 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
5612 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
5615 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
5620 * A reply_short_channel_ids_end message is sent as a reply to a
5621 * query_short_channel_ids message. The query recipient makes a best
5622 * effort to respond based on their local network view which may not be
5623 * a perfect view of the network.
5625 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
5627 * A pointer to the opaque Rust object.
5628 * Nearly everywhere, inner must be non-null, however in places where
5629 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5631 LDKnativeReplyShortChannelIdsEnd *inner;
5633 * Indicates that this is the only struct which contains the same pointer.
5634 * Rust functions which take ownership of an object provided via an argument require
5635 * this to be true and invalidate the object pointed to by inner.
5638 } LDKReplyShortChannelIdsEnd;
5641 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
5643 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
5645 * A pointer to the contents in the success state.
5646 * Reading from this pointer when `result_ok` is not set is undefined.
5648 struct LDKReplyShortChannelIdsEnd *result;
5650 * A pointer to the contents in the error state.
5651 * Reading from this pointer when `result_ok` is set is undefined.
5653 struct LDKDecodeError *err;
5654 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
5657 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
5658 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
5659 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5661 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
5663 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
5664 * `err` or `result` depending on the state of `result_ok`.
5666 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
5668 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
5671 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
5674 * The contents of CResult_QueryChannelRangeDecodeErrorZ
5676 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
5678 * A pointer to the contents in the success state.
5679 * Reading from this pointer when `result_ok` is not set is undefined.
5681 struct LDKQueryChannelRange *result;
5683 * A pointer to the contents in the error state.
5684 * Reading from this pointer when `result_ok` is set is undefined.
5686 struct LDKDecodeError *err;
5687 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
5690 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
5691 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
5692 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5694 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
5696 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
5697 * `err` or `result` depending on the state of `result_ok`.
5699 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
5701 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
5704 } LDKCResult_QueryChannelRangeDecodeErrorZ;
5707 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
5709 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
5711 * A pointer to the contents in the success state.
5712 * Reading from this pointer when `result_ok` is not set is undefined.
5714 struct LDKReplyChannelRange *result;
5716 * A pointer to the contents in the error state.
5717 * Reading from this pointer when `result_ok` is set is undefined.
5719 struct LDKDecodeError *err;
5720 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
5723 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
5724 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
5725 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5727 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
5729 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
5730 * `err` or `result` depending on the state of `result_ok`.
5732 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
5734 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
5737 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
5742 * A gossip_timestamp_filter message is used by a node to request
5743 * gossip relay for messages in the requested time range when the
5744 * gossip_queries feature has been negotiated.
5746 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
5748 * A pointer to the opaque Rust object.
5749 * Nearly everywhere, inner must be non-null, however in places where
5750 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5752 LDKnativeGossipTimestampFilter *inner;
5754 * Indicates that this is the only struct which contains the same pointer.
5755 * Rust functions which take ownership of an object provided via an argument require
5756 * this to be true and invalidate the object pointed to by inner.
5759 } LDKGossipTimestampFilter;
5762 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
5764 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
5766 * A pointer to the contents in the success state.
5767 * Reading from this pointer when `result_ok` is not set is undefined.
5769 struct LDKGossipTimestampFilter *result;
5771 * A pointer to the contents in the error state.
5772 * Reading from this pointer when `result_ok` is set is undefined.
5774 struct LDKDecodeError *err;
5775 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
5778 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
5779 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
5780 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5782 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
5784 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
5785 * `err` or `result` depending on the state of `result_ok`.
5787 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
5789 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
5792 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
5795 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
5797 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
5799 * A pointer to the contents in the success state.
5800 * Reading from this pointer when `result_ok` is not set is undefined.
5802 struct LDKSpendableOutputDescriptor *result;
5804 * A pointer to the contents in the error state.
5805 * Reading from this pointer when `result_ok` is set is undefined.
5807 struct LDKDecodeError *err;
5808 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
5811 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
5812 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
5813 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5815 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
5817 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
5818 * `err` or `result` depending on the state of `result_ok`.
5820 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
5822 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
5825 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
5828 * The contents of CResult_SignDecodeErrorZ
5830 typedef union LDKCResult_SignDecodeErrorZPtr {
5832 * A pointer to the contents in the success state.
5833 * Reading from this pointer when `result_ok` is not set is undefined.
5835 struct LDKSign *result;
5837 * A pointer to the contents in the error state.
5838 * Reading from this pointer when `result_ok` is set is undefined.
5840 struct LDKDecodeError *err;
5841 } LDKCResult_SignDecodeErrorZPtr;
5844 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
5845 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
5846 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5848 typedef struct LDKCResult_SignDecodeErrorZ {
5850 * The contents of this CResult_SignDecodeErrorZ, accessible via either
5851 * `err` or `result` depending on the state of `result_ok`.
5853 union LDKCResult_SignDecodeErrorZPtr contents;
5855 * Whether this CResult_SignDecodeErrorZ represents a success state.
5858 } LDKCResult_SignDecodeErrorZ;
5861 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
5862 * This corresponds to std::vector in C++
5864 typedef struct LDKCVec_CVec_u8ZZ {
5866 * The elements in the array.
5867 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5869 struct LDKCVec_u8Z *data;
5871 * The number of elements pointed to by `data`.
5874 } LDKCVec_CVec_u8ZZ;
5877 * The contents of CResult_CVec_CVec_u8ZZNoneZ
5879 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
5881 * A pointer to the contents in the success state.
5882 * Reading from this pointer when `result_ok` is not set is undefined.
5884 struct LDKCVec_CVec_u8ZZ *result;
5886 * Note that this value is always NULL, as there are no contents in the Err variant
5889 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
5892 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
5893 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
5894 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5896 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
5898 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
5899 * `err` or `result` depending on the state of `result_ok`.
5901 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
5903 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
5906 } LDKCResult_CVec_CVec_u8ZZNoneZ;
5911 * A simple implementation of Sign that just keeps the private keys in memory.
5913 * This implementation performs no policy checks and is insufficient by itself as
5914 * a secure external signer.
5916 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
5918 * A pointer to the opaque Rust object.
5919 * Nearly everywhere, inner must be non-null, however in places where
5920 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5922 LDKnativeInMemorySigner *inner;
5924 * Indicates that this is the only struct which contains the same pointer.
5925 * Rust functions which take ownership of an object provided via an argument require
5926 * this to be true and invalidate the object pointed to by inner.
5929 } LDKInMemorySigner;
5932 * The contents of CResult_InMemorySignerDecodeErrorZ
5934 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
5936 * A pointer to the contents in the success state.
5937 * Reading from this pointer when `result_ok` is not set is undefined.
5939 struct LDKInMemorySigner *result;
5941 * A pointer to the contents in the error state.
5942 * Reading from this pointer when `result_ok` is set is undefined.
5944 struct LDKDecodeError *err;
5945 } LDKCResult_InMemorySignerDecodeErrorZPtr;
5948 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
5949 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
5950 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5952 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
5954 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
5955 * `err` or `result` depending on the state of `result_ok`.
5957 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
5959 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
5962 } LDKCResult_InMemorySignerDecodeErrorZ;
5965 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
5966 * This corresponds to std::vector in C++
5968 typedef struct LDKCVec_TxOutZ {
5970 * The elements in the array.
5971 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5973 struct LDKTxOut *data;
5975 * The number of elements pointed to by `data`.
5981 * The contents of CResult_TransactionNoneZ
5983 typedef union LDKCResult_TransactionNoneZPtr {
5985 * A pointer to the contents in the success state.
5986 * Reading from this pointer when `result_ok` is not set is undefined.
5988 struct LDKTransaction *result;
5990 * Note that this value is always NULL, as there are no contents in the Err variant
5993 } LDKCResult_TransactionNoneZPtr;
5996 * A CResult_TransactionNoneZ represents the result of a fallible operation,
5997 * containing a crate::c_types::Transaction on success and a () on failure.
5998 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6000 typedef struct LDKCResult_TransactionNoneZ {
6002 * The contents of this CResult_TransactionNoneZ, accessible via either
6003 * `err` or `result` depending on the state of `result_ok`.
6005 union LDKCResult_TransactionNoneZPtr contents;
6007 * Whether this CResult_TransactionNoneZ represents a success state.
6010 } LDKCResult_TransactionNoneZ;
6013 * The contents of CResult_NoneErrorZ
6015 typedef union LDKCResult_NoneErrorZPtr {
6017 * Note that this value is always NULL, as there are no contents in the OK variant
6021 * A pointer to the contents in the error state.
6022 * Reading from this pointer when `result_ok` is set is undefined.
6024 enum LDKIOError *err;
6025 } LDKCResult_NoneErrorZPtr;
6028 * A CResult_NoneErrorZ represents the result of a fallible operation,
6029 * containing a () on success and a crate::c_types::IOError on failure.
6030 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6032 typedef struct LDKCResult_NoneErrorZ {
6034 * The contents of this CResult_NoneErrorZ, accessible via either
6035 * `err` or `result` depending on the state of `result_ok`.
6037 union LDKCResult_NoneErrorZPtr contents;
6039 * Whether this CResult_NoneErrorZ represents a success state.
6042 } LDKCResult_NoneErrorZ;
6045 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
6046 * This corresponds to std::vector in C++
6048 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
6050 * The elements in the array.
6051 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6053 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
6055 * The number of elements pointed to by `data`.
6058 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
6061 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
6063 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
6065 * A pointer to the contents in the success state.
6066 * Reading from this pointer when `result_ok` is not set is undefined.
6068 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
6070 * A pointer to the contents in the error state.
6071 * Reading from this pointer when `result_ok` is set is undefined.
6073 enum LDKIOError *err;
6074 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
6077 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
6078 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
6079 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6081 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
6083 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
6084 * `err` or `result` depending on the state of `result_ok`.
6086 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
6088 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
6091 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
6094 * A Rust str object, ie a reference to a UTF8-valid string.
6095 * This is *not* null-terminated so cannot be used directly as a C string!
6097 typedef struct LDKStr {
6099 * A pointer to the string's bytes, in UTF8 encoding
6101 const uint8_t *chars;
6103 * The number of bytes (not characters!) pointed to by `chars`
6109 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
6112 typedef enum LDKAPIError_Tag {
6114 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
6115 * are documented, but generally indicates some precondition of a function was violated.
6117 LDKAPIError_APIMisuseError,
6119 * Due to a high feerate, we were unable to complete the request.
6120 * For example, this may be returned if the feerate implies we cannot open a channel at the
6121 * requested value, but opening a larger channel would succeed.
6123 LDKAPIError_FeeRateTooHigh,
6125 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
6126 * too-many-hops, etc).
6128 LDKAPIError_RouteError,
6130 * We were unable to complete the request as the Channel required to do so is unable to
6131 * complete the request (or was not found). This can take many forms, including disconnected
6132 * peer, channel at capacity, channel shutting down, etc.
6134 LDKAPIError_ChannelUnavailable,
6136 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
6137 * attempted action to fail.
6139 LDKAPIError_MonitorUpdateFailed,
6141 * Must be last for serialization purposes
6143 LDKAPIError_Sentinel,
6146 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
6148 * A human-readable error message
6150 struct LDKCVec_u8Z err;
6151 } LDKAPIError_LDKAPIMisuseError_Body;
6153 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
6155 * A human-readable error message
6157 struct LDKCVec_u8Z err;
6159 * The feerate which was too high.
6162 } LDKAPIError_LDKFeeRateTooHigh_Body;
6164 typedef struct LDKAPIError_LDKRouteError_Body {
6166 * A human-readable error message
6169 } LDKAPIError_LDKRouteError_Body;
6171 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
6173 * A human-readable error message
6175 struct LDKCVec_u8Z err;
6176 } LDKAPIError_LDKChannelUnavailable_Body;
6178 typedef struct MUST_USE_STRUCT LDKAPIError {
6179 LDKAPIError_Tag tag;
6181 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
6182 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
6183 LDKAPIError_LDKRouteError_Body route_error;
6184 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
6189 * The contents of CResult_NoneAPIErrorZ
6191 typedef union LDKCResult_NoneAPIErrorZPtr {
6193 * Note that this value is always NULL, as there are no contents in the OK variant
6197 * A pointer to the contents in the error state.
6198 * Reading from this pointer when `result_ok` is set is undefined.
6200 struct LDKAPIError *err;
6201 } LDKCResult_NoneAPIErrorZPtr;
6204 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
6205 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
6206 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6208 typedef struct LDKCResult_NoneAPIErrorZ {
6210 * The contents of this CResult_NoneAPIErrorZ, accessible via either
6211 * `err` or `result` depending on the state of `result_ok`.
6213 union LDKCResult_NoneAPIErrorZPtr contents;
6215 * Whether this CResult_NoneAPIErrorZ represents a success state.
6218 } LDKCResult_NoneAPIErrorZ;
6221 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
6222 * This corresponds to std::vector in C++
6224 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
6226 * The elements in the array.
6227 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6229 struct LDKCResult_NoneAPIErrorZ *data;
6231 * The number of elements pointed to by `data`.
6234 } LDKCVec_CResult_NoneAPIErrorZZ;
6237 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
6238 * This corresponds to std::vector in C++
6240 typedef struct LDKCVec_APIErrorZ {
6242 * The elements in the array.
6243 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6245 struct LDKAPIError *data;
6247 * The number of elements pointed to by `data`.
6250 } LDKCVec_APIErrorZ;
6253 * If a payment fails to send, it can be in one of several states. This enum is returned as the
6254 * Err() type describing which state the payment is in, see the description of individual enum
6257 typedef enum LDKPaymentSendFailure_Tag {
6259 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
6260 * send the payment at all. No channel state has been changed or messages sent to peers, and
6261 * once you've changed the parameter at error, you can freely retry the payment in full.
6263 LDKPaymentSendFailure_ParameterError,
6265 * A parameter in a single path which was passed to send_payment was invalid, preventing us
6266 * from attempting to send the payment at all. No channel state has been changed or messages
6267 * sent to peers, and once you've changed the parameter at error, you can freely retry the
6270 * The results here are ordered the same as the paths in the route object which was passed to
6273 LDKPaymentSendFailure_PathParameterError,
6275 * All paths which were attempted failed to send, with no channel state change taking place.
6276 * You can freely retry the payment in full (though you probably want to do so over different
6277 * paths than the ones selected).
6279 LDKPaymentSendFailure_AllFailedRetrySafe,
6281 * Some paths which were attempted failed to send, though possibly not all. At least some
6282 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
6283 * in over-/re-payment.
6285 * The results here are ordered the same as the paths in the route object which was passed to
6286 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
6287 * retried (though there is currently no API with which to do so).
6289 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
6290 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
6291 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
6292 * with the latest update_id.
6294 LDKPaymentSendFailure_PartialFailure,
6296 * Must be last for serialization purposes
6298 LDKPaymentSendFailure_Sentinel,
6299 } LDKPaymentSendFailure_Tag;
6301 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
6302 LDKPaymentSendFailure_Tag tag;
6305 struct LDKAPIError parameter_error;
6308 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
6311 struct LDKCVec_APIErrorZ all_failed_retry_safe;
6314 struct LDKCVec_CResult_NoneAPIErrorZZ partial_failure;
6317 } LDKPaymentSendFailure;
6320 * The contents of CResult_NonePaymentSendFailureZ
6322 typedef union LDKCResult_NonePaymentSendFailureZPtr {
6324 * Note that this value is always NULL, as there are no contents in the OK variant
6328 * A pointer to the contents in the error state.
6329 * Reading from this pointer when `result_ok` is set is undefined.
6331 struct LDKPaymentSendFailure *err;
6332 } LDKCResult_NonePaymentSendFailureZPtr;
6335 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
6336 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
6337 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6339 typedef struct LDKCResult_NonePaymentSendFailureZ {
6341 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
6342 * `err` or `result` depending on the state of `result_ok`.
6344 union LDKCResult_NonePaymentSendFailureZPtr contents;
6346 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
6349 } LDKCResult_NonePaymentSendFailureZ;
6352 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
6353 * This corresponds to std::vector in C++
6355 typedef struct LDKCVec_ChannelMonitorZ {
6357 * The elements in the array.
6358 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6360 struct LDKChannelMonitor *data;
6362 * The number of elements pointed to by `data`.
6365 } LDKCVec_ChannelMonitorZ;
6368 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
6369 * blocks are connected and disconnected.
6371 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
6372 * responsible for maintaining a set of monitors such that they can be updated accordingly as
6373 * channel state changes and HTLCs are resolved. See method documentation for specific
6376 * Implementations **must** ensure that updates are successfully applied and persisted upon method
6377 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
6378 * without taking any further action such as persisting the current state.
6380 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
6381 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
6382 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
6383 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
6384 * multiple instances.
6386 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
6387 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
6388 * [`PermanentFailure`]: channelmonitor::ChannelMonitorUpdateErr::PermanentFailure
6390 typedef struct LDKWatch {
6392 * An opaque pointer which is passed to your function implementations as an argument.
6393 * This has no meaning in the LDK, and can be NULL or any other value.
6397 * Watches a channel identified by `funding_txo` using `monitor`.
6399 * Implementations are responsible for watching the chain for the funding transaction along
6400 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
6401 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
6403 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
6404 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
6405 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
6407 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
6409 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
6411 * Implementations must call [`update_monitor`] with the given update. See
6412 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
6414 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
6415 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
6417 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
6419 * Returns any monitor events since the last call. Subsequent calls must only return new
6422 struct LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
6424 * Frees any resources associated with this object given its this_arg pointer.
6425 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6427 void (*free)(void *this_arg);
6431 * An interface to send a transaction to the Bitcoin network.
6433 typedef struct LDKBroadcasterInterface {
6435 * An opaque pointer which is passed to your function implementations as an argument.
6436 * This has no meaning in the LDK, and can be NULL or any other value.
6440 * Sends a transaction out to (hopefully) be mined.
6442 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
6444 * Frees any resources associated with this object given its this_arg pointer.
6445 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6447 void (*free)(void *this_arg);
6448 } LDKBroadcasterInterface;
6451 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
6452 * own the memory pointed to by data.
6454 typedef struct LDKu8slice {
6456 * A pointer to the byte buffer
6458 const uint8_t *data;
6460 * The number of bytes pointed to by `data`.
6466 * A trait to describe an object which can get user secrets and key material.
6468 typedef struct LDKKeysInterface {
6470 * An opaque pointer which is passed to your function implementations as an argument.
6471 * This has no meaning in the LDK, and can be NULL or any other value.
6475 * Get node secret key (aka node_id or network_key).
6477 * This method must return the same value each time it is called.
6479 struct LDKSecretKey (*get_node_secret)(const void *this_arg);
6481 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
6483 * This method should return a different value each time it is called, to avoid linking
6484 * on-chain funds across channels as controlled to the same user.
6486 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
6488 * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing
6491 * This method should return a different value each time it is called, to avoid linking
6492 * on-chain funds across channels as controlled to the same user.
6494 struct LDKPublicKey (*get_shutdown_pubkey)(const void *this_arg);
6496 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
6497 * restarted with some stale data!
6499 * This method must return a different value each time it is called.
6501 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
6503 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
6504 * onion packets and for temporary channel IDs. There is no requirement that these be
6505 * persisted anywhere, though they must be unique across restarts.
6507 * This method must return a different value each time it is called.
6509 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
6511 * Reads a `Signer` for this `KeysInterface` from the given input stream.
6512 * This is only called during deserialization of other objects which contain
6513 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
6514 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
6515 * contain no versioning scheme. You may wish to include your own version prefix and ensure
6516 * you've read all of the provided bytes to ensure no corruption occurred.
6518 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
6520 * Frees any resources associated with this object given its this_arg pointer.
6521 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6523 void (*free)(void *this_arg);
6527 * A trait which should be implemented to provide feerate information on a number of time
6530 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
6531 * called from inside the library in response to chain events, P2P events, or timer events).
6533 typedef struct LDKFeeEstimator {
6535 * An opaque pointer which is passed to your function implementations as an argument.
6536 * This has no meaning in the LDK, and can be NULL or any other value.
6540 * Gets estimated satoshis of fee required per 1000 Weight-Units.
6542 * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
6543 * don't put us below 1 satoshi-per-byte).
6545 * This translates to:
6546 * * satoshis-per-byte * 250
6547 * * ceil(satoshis-per-kbyte / 4)
6549 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
6551 * Frees any resources associated with this object given its this_arg pointer.
6552 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6554 void (*free)(void *this_arg);
6558 * A trait encapsulating the operations required of a logger
6560 typedef struct LDKLogger {
6562 * An opaque pointer which is passed to your function implementations as an argument.
6563 * This has no meaning in the LDK, and can be NULL or any other value.
6569 void (*log)(const void *this_arg, const char *record);
6571 * Frees any resources associated with this object given its this_arg pointer.
6572 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6574 void (*free)(void *this_arg);
6580 * Manager which keeps track of a number of channels and sends messages to the appropriate
6581 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
6583 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
6584 * to individual Channels.
6586 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
6587 * all peers during write/read (though does not modify this instance, only the instance being
6588 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
6589 * called funding_transaction_generated for outbound channels).
6591 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
6592 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
6593 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
6594 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
6595 * the serialization process). If the deserialized version is out-of-date compared to the
6596 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
6597 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
6599 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
6600 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
6601 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
6602 * block_connected() to step towards your best block) upon deserialization before using the
6605 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
6606 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
6607 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
6608 * offline for a full minute. In order to track this, you must call
6609 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
6611 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
6612 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
6613 * essentially you should default to using a SimpleRefChannelManager, and use a
6614 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
6615 * you're using lightning-net-tokio.
6617 typedef struct MUST_USE_STRUCT LDKChannelManager {
6619 * A pointer to the opaque Rust object.
6620 * Nearly everywhere, inner must be non-null, however in places where
6621 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6623 LDKnativeChannelManager *inner;
6625 * Indicates that this is the only struct which contains the same pointer.
6626 * Rust functions which take ownership of an object provided via an argument require
6627 * this to be true and invalidate the object pointed to by inner.
6630 } LDKChannelManager;
6633 * A tuple of 2 elements. See the individual fields for the types contained.
6635 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
6637 * The element at position 0
6639 struct LDKThirtyTwoBytes a;
6641 * The element at position 1
6643 struct LDKChannelManager b;
6644 } LDKC2Tuple_BlockHashChannelManagerZ;
6647 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
6649 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
6651 * A pointer to the contents in the success state.
6652 * Reading from this pointer when `result_ok` is not set is undefined.
6654 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
6656 * A pointer to the contents in the error state.
6657 * Reading from this pointer when `result_ok` is set is undefined.
6659 struct LDKDecodeError *err;
6660 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
6663 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
6664 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
6665 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6667 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
6669 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
6670 * `err` or `result` depending on the state of `result_ok`.
6672 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
6674 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
6677 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
6680 * A trait indicating an object may generate message send events
6682 typedef struct LDKMessageSendEventsProvider {
6684 * An opaque pointer which is passed to your function implementations as an argument.
6685 * This has no meaning in the LDK, and can be NULL or any other value.
6689 * Gets the list of pending events which were generated by previous actions, clearing the list
6692 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
6694 * Frees any resources associated with this object given its this_arg pointer.
6695 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6697 void (*free)(void *this_arg);
6698 } LDKMessageSendEventsProvider;
6701 * A trait indicating an object may generate events
6703 typedef struct LDKEventsProvider {
6705 * An opaque pointer which is passed to your function implementations as an argument.
6706 * This has no meaning in the LDK, and can be NULL or any other value.
6710 * Gets the list of pending events which were generated by previous actions, clearing the list
6713 struct LDKCVec_EventZ (*get_and_clear_pending_events)(const void *this_arg);
6715 * Frees any resources associated with this object given its this_arg pointer.
6716 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6718 void (*free)(void *this_arg);
6719 } LDKEventsProvider;
6724 * Configuration we set when applicable.
6726 * Default::default() provides sane defaults.
6728 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
6730 * A pointer to the opaque Rust object.
6731 * Nearly everywhere, inner must be non-null, however in places where
6732 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6734 LDKnativeChannelHandshakeConfig *inner;
6736 * Indicates that this is the only struct which contains the same pointer.
6737 * Rust functions which take ownership of an object provided via an argument require
6738 * this to be true and invalidate the object pointed to by inner.
6741 } LDKChannelHandshakeConfig;
6746 * Optional channel limits which are applied during channel creation.
6748 * These limits are only applied to our counterparty's limits, not our own.
6750 * Use 0/<type>::max_value() as appropriate to skip checking.
6752 * Provides sane defaults for most configurations.
6754 * Most additional limits are disabled except those with which specify a default in individual
6755 * field documentation. Note that this may result in barely-usable channels, but since they
6756 * are applied mostly only to incoming channels that's not much of a problem.
6758 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
6760 * A pointer to the opaque Rust object.
6761 * Nearly everywhere, inner must be non-null, however in places where
6762 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6764 LDKnativeChannelHandshakeLimits *inner;
6766 * Indicates that this is the only struct which contains the same pointer.
6767 * Rust functions which take ownership of an object provided via an argument require
6768 * this to be true and invalidate the object pointed to by inner.
6771 } LDKChannelHandshakeLimits;
6776 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
6778 * Default::default() provides sane defaults for most configurations
6779 * (but currently with 0 relay fees!)
6781 typedef struct MUST_USE_STRUCT LDKUserConfig {
6783 * A pointer to the opaque Rust object.
6784 * Nearly everywhere, inner must be non-null, however in places where
6785 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6787 LDKnativeUserConfig *inner;
6789 * Indicates that this is the only struct which contains the same pointer.
6790 * Rust functions which take ownership of an object provided via an argument require
6791 * this to be true and invalidate the object pointed to by inner.
6797 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
6800 typedef struct LDKAccess {
6802 * An opaque pointer which is passed to your function implementations as an argument.
6803 * This has no meaning in the LDK, and can be NULL or any other value.
6807 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
6808 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
6811 * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
6813 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
6815 * Frees any resources associated with this object given its this_arg pointer.
6816 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6818 void (*free)(void *this_arg);
6822 * The `Listen` trait is used to be notified of when blocks have been connected or disconnected
6825 * Useful when needing to replay chain data upon startup or as new chain events occur.
6827 typedef struct LDKListen {
6829 * An opaque pointer which is passed to your function implementations as an argument.
6830 * This has no meaning in the LDK, and can be NULL or any other value.
6834 * Notifies the listener that a block was added at the given height.
6836 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
6838 * Notifies the listener that a block was removed at the given height.
6840 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
6842 * Frees any resources associated with this object given its this_arg pointer.
6843 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6845 void (*free)(void *this_arg);
6851 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
6853 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
6854 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
6855 * the return value of [`Filter::register_output`].
6857 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
6858 * may have been spent there. See [`Filter::register_output`] for details.
6860 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
6861 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
6863 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
6865 * A pointer to the opaque Rust object.
6866 * Nearly everywhere, inner must be non-null, however in places where
6867 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6869 LDKnativeWatchedOutput *inner;
6871 * Indicates that this is the only struct which contains the same pointer.
6872 * Rust functions which take ownership of an object provided via an argument require
6873 * this to be true and invalidate the object pointed to by inner.
6879 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
6882 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
6883 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
6884 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
6885 * receiving full blocks from a chain source, any further filtering is unnecessary.
6887 * After an output has been registered, subsequent block retrievals from the chain source must not
6888 * exclude any transactions matching the new criteria nor any in-block descendants of such
6891 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
6892 * should not block on I/O. Implementations should instead queue the newly monitored data to be
6893 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
6894 * invocation that has called the `Filter` must return [`TemporaryFailure`].
6896 * [`TemporaryFailure`]: channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure
6897 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
6898 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
6900 typedef struct LDKFilter {
6902 * An opaque pointer which is passed to your function implementations as an argument.
6903 * This has no meaning in the LDK, and can be NULL or any other value.
6907 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
6908 * a spending condition.
6910 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
6912 * Registers interest in spends of a transaction output.
6914 * Optionally, when `output.block_hash` is set, should return any transaction spending the
6915 * output that is found in the corresponding block along with its index.
6917 * This return value is useful for Electrum clients in order to supply in-block descendant
6918 * transactions which otherwise were not included. This is not necessary for other clients if
6919 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
6922 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
6924 * Frees any resources associated with this object given its this_arg pointer.
6925 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6927 void (*free)(void *this_arg);
6931 * `Persist` defines behavior for persisting channel monitors: this could mean
6932 * writing once to disk, and/or uploading to one or more backup services.
6934 * Note that for every new monitor, you **must** persist the new `ChannelMonitor`
6935 * to disk/backups. And, on every update, you **must** persist either the
6936 * `ChannelMonitorUpdate` or the updated monitor itself. Otherwise, there is risk
6937 * of situations such as revoking a transaction, then crashing before this
6938 * revocation can be persisted, then unintentionally broadcasting a revoked
6939 * transaction and losing money. This is a risk because previous channel states
6940 * are toxic, so it's important that whatever channel state is persisted is
6943 typedef struct LDKPersist {
6945 * An opaque pointer which is passed to your function implementations as an argument.
6946 * This has no meaning in the LDK, and can be NULL or any other value.
6950 * Persist a new channel's data. The data can be stored any way you want, but
6951 * the identifier provided by Rust-Lightning is the channel's outpoint (and
6952 * it is up to you to maintain a correct mapping between the outpoint and the
6953 * stored channel data). Note that you **must** persist every new monitor to
6954 * disk. See the `Persist` trait documentation for more details.
6956 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
6957 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
6959 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data);
6961 * Update one channel's data. The provided `ChannelMonitor` has already
6962 * applied the given update.
6964 * Note that on every update, you **must** persist either the
6965 * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See
6966 * the `Persist` trait documentation for more details.
6968 * If an implementer chooses to persist the updates only, they need to make
6969 * sure that all the updates are applied to the `ChannelMonitors` *before*
6970 * the set of channel monitors is given to the `ChannelManager`
6971 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
6972 * applying a monitor update to a monitor. If full `ChannelMonitors` are
6973 * persisted, then there is no need to persist individual updates.
6975 * Note that there could be a performance tradeoff between persisting complete
6976 * channel monitors on every update vs. persisting only updates and applying
6977 * them in batches. The size of each monitor grows `O(number of state updates)`
6978 * whereas updates are small and `O(1)`.
6980 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
6981 * [`ChannelMonitorUpdate::write`] for writing out an update, and
6982 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
6984 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);
6986 * Frees any resources associated with this object given its this_arg pointer.
6987 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6989 void (*free)(void *this_arg);
6995 * An implementation of [`chain::Watch`] for monitoring channels.
6997 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
6998 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
6999 * or used independently to monitor channels remotely. See the [module-level documentation] for
7002 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
7003 * [module-level documentation]: crate::chain::chainmonitor
7005 typedef struct MUST_USE_STRUCT LDKChainMonitor {
7007 * A pointer to the opaque Rust object.
7008 * Nearly everywhere, inner must be non-null, however in places where
7009 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7011 LDKnativeChainMonitor *inner;
7013 * Indicates that this is the only struct which contains the same pointer.
7014 * Rust functions which take ownership of an object provided via an argument require
7015 * this to be true and invalidate the object pointed to by inner.
7023 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
7024 * and derives keys from that.
7026 * Your node_id is seed/0'
7027 * ChannelMonitor closes may use seed/1'
7028 * Cooperative closes may use seed/2'
7029 * The two close keys may be needed to claim on-chain funds!
7031 typedef struct MUST_USE_STRUCT LDKKeysManager {
7033 * A pointer to the opaque Rust object.
7034 * Nearly everywhere, inner must be non-null, however in places where
7035 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7037 LDKnativeKeysManager *inner;
7039 * Indicates that this is the only struct which contains the same pointer.
7040 * Rust functions which take ownership of an object provided via an argument require
7041 * this to be true and invalidate the object pointed to by inner.
7049 * Chain-related parameters used to construct a new `ChannelManager`.
7051 * Typically, the block-specific parameters are derived from the best block hash for the network,
7052 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
7053 * are not needed when deserializing a previously constructed `ChannelManager`.
7055 typedef struct MUST_USE_STRUCT LDKChainParameters {
7057 * A pointer to the opaque Rust object.
7058 * Nearly everywhere, inner must be non-null, however in places where
7059 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7061 LDKnativeChainParameters *inner;
7063 * Indicates that this is the only struct which contains the same pointer.
7064 * Rust functions which take ownership of an object provided via an argument require
7065 * this to be true and invalidate the object pointed to by inner.
7068 } LDKChainParameters;
7073 * The best known block as identified by its hash and height.
7075 typedef struct MUST_USE_STRUCT LDKBestBlock {
7077 * A pointer to the opaque Rust object.
7078 * Nearly everywhere, inner must be non-null, however in places where
7079 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7081 LDKnativeBestBlock *inner;
7083 * Indicates that this is the only struct which contains the same pointer.
7084 * Rust functions which take ownership of an object provided via an argument require
7085 * this to be true and invalidate the object pointed to by inner.
7091 * A 3-byte byte array.
7093 typedef struct LDKThreeBytes {
7101 * A trait to describe an object which can receive channel messages.
7103 * Messages MAY be called in parallel when they originate from different their_node_ids, however
7104 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
7106 typedef struct LDKChannelMessageHandler {
7108 * An opaque pointer which is passed to your function implementations as an argument.
7109 * This has no meaning in the LDK, and can be NULL or any other value.
7113 * Handle an incoming open_channel message from the given peer.
7115 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
7117 * Handle an incoming accept_channel message from the given peer.
7119 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
7121 * Handle an incoming funding_created message from the given peer.
7123 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
7125 * Handle an incoming funding_signed message from the given peer.
7127 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
7129 * Handle an incoming funding_locked message from the given peer.
7131 void (*handle_funding_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg);
7133 * Handle an incoming shutdown message from the given peer.
7135 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);
7137 * Handle an incoming closing_signed message from the given peer.
7139 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
7141 * Handle an incoming update_add_htlc message from the given peer.
7143 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
7145 * Handle an incoming update_fulfill_htlc message from the given peer.
7147 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
7149 * Handle an incoming update_fail_htlc message from the given peer.
7151 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
7153 * Handle an incoming update_fail_malformed_htlc message from the given peer.
7155 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
7157 * Handle an incoming commitment_signed message from the given peer.
7159 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
7161 * Handle an incoming revoke_and_ack message from the given peer.
7163 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
7165 * Handle an incoming update_fee message from the given peer.
7167 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
7169 * Handle an incoming announcement_signatures message from the given peer.
7171 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
7173 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
7174 * is believed to be possible in the future (eg they're sending us messages we don't
7175 * understand or indicate they require unknown feature bits), no_connection_possible is set
7176 * and any outstanding channels should be failed.
7178 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
7180 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
7182 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
7184 * Handle an incoming channel_reestablish message from the given peer.
7186 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
7188 * Handle an incoming channel update from the given peer.
7190 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
7192 * Handle an incoming error message from the given peer.
7194 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
7196 * Implementation of MessageSendEventsProvider for this object.
7198 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
7200 * Frees any resources associated with this object given its this_arg pointer.
7201 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7203 void (*free)(void *this_arg);
7204 } LDKChannelMessageHandler;
7209 * Arguments for the creation of a ChannelManager that are not deserialized.
7211 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
7213 * 1) Deserialize all stored ChannelMonitors.
7214 * 2) Deserialize the ChannelManager by filling in this struct and calling:
7215 * <(BlockHash, ChannelManager)>::read(reader, args)
7216 * This may result in closing some Channels if the ChannelMonitor is newer than the stored
7217 * ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted.
7218 * 3) If you are not fetching full blocks, register all relevant ChannelMonitor outpoints the same
7219 * way you would handle a `chain::Filter` call using ChannelMonitor::get_outputs_to_watch() and
7220 * ChannelMonitor::get_funding_txo().
7221 * 4) Reconnect blocks on your ChannelMonitors.
7222 * 5) Disconnect/connect blocks on the ChannelManager.
7223 * 6) Move the ChannelMonitors into your local chain::Watch.
7225 * Note that the ordering of #4-6 is not of importance, however all three must occur before you
7226 * call any other methods on the newly-deserialized ChannelManager.
7228 * Note that because some channels may be closed during deserialization, it is critical that you
7229 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
7230 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
7231 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
7232 * not force-close the same channels but consider them live), you may end up revoking a state for
7233 * which you've already broadcasted the transaction.
7235 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
7237 * A pointer to the opaque Rust object.
7238 * Nearly everywhere, inner must be non-null, however in places where
7239 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7241 LDKnativeChannelManagerReadArgs *inner;
7243 * Indicates that this is the only struct which contains the same pointer.
7244 * Rust functions which take ownership of an object provided via an argument require
7245 * this to be true and invalidate the object pointed to by inner.
7248 } LDKChannelManagerReadArgs;
7253 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
7254 * This is used to convince the recipient that the channel is at a certain commitment
7255 * number even if they lost that data due to a local failure. Of course, the peer may lie
7256 * and even later commitments may have been revoked.
7258 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
7260 * A pointer to the opaque Rust object.
7261 * Nearly everywhere, inner must be non-null, however in places where
7262 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7264 LDKnativeDataLossProtect *inner;
7266 * Indicates that this is the only struct which contains the same pointer.
7267 * Rust functions which take ownership of an object provided via an argument require
7268 * this to be true and invalidate the object pointed to by inner.
7271 } LDKDataLossProtect;
7274 * A trait to describe an object which can receive routing messages.
7276 * # Implementor DoS Warnings
7278 * For `gossip_queries` messages there are potential DoS vectors when handling
7279 * inbound queries. Implementors using an on-disk network graph should be aware of
7280 * repeated disk I/O for queries accessing different parts of the network graph.
7282 typedef struct LDKRoutingMessageHandler {
7284 * An opaque pointer which is passed to your function implementations as an argument.
7285 * This has no meaning in the LDK, and can be NULL or any other value.
7289 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
7290 * false or returning an Err otherwise.
7292 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
7294 * Handle a channel_announcement message, returning true if it should be forwarded on, false
7295 * or returning an Err otherwise.
7297 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
7299 * Handle an incoming channel_update message, returning true if it should be forwarded on,
7300 * false or returning an Err otherwise.
7302 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
7304 * Handle some updates to the route graph that we learned due to an outbound failed payment.
7306 void (*handle_htlc_fail_channel_update)(const void *this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update);
7308 * Gets a subset of the channel announcements and updates required to dump our routing table
7309 * to a remote node, starting at the short_channel_id indicated by starting_point and
7310 * including the batch_amount entries immediately higher in numerical value than starting_point.
7312 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
7314 * Gets a subset of the node announcements required to dump our routing table to a remote node,
7315 * starting at the node *after* the provided publickey and including batch_amount entries
7316 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
7317 * If None is provided for starting_point, we start at the first node.
7319 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
7321 * Called when a connection is established with a peer. This can be used to
7322 * perform routing table synchronization using a strategy defined by the
7325 void (*sync_routing_table)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
7327 * Handles the reply of a query we initiated to learn about channels
7328 * for a given range of blocks. We can expect to receive one or more
7329 * replies to a single query.
7331 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
7333 * Handles the reply of a query we initiated asking for routing gossip
7334 * messages for a list of channels. We should receive this message when
7335 * a node has completed its best effort to send us the pertaining routing
7338 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
7340 * Handles when a peer asks us to send a list of short_channel_ids
7341 * for the requested range of blocks.
7343 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
7345 * Handles when a peer asks us to send routing gossip messages for a
7346 * list of short_channel_ids.
7348 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
7350 * Implementation of MessageSendEventsProvider for this object.
7352 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
7354 * Frees any resources associated with this object given its this_arg pointer.
7355 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7357 void (*free)(void *this_arg);
7358 } LDKRoutingMessageHandler;
7363 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
7364 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
7366 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
7368 * A pointer to the opaque Rust object.
7369 * Nearly everywhere, inner must be non-null, however in places where
7370 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7372 LDKnativeIgnoringMessageHandler *inner;
7374 * Indicates that this is the only struct which contains the same pointer.
7375 * Rust functions which take ownership of an object provided via an argument require
7376 * this to be true and invalidate the object pointed to by inner.
7379 } LDKIgnoringMessageHandler;
7384 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
7385 * You can provide one of these as the route_handler in a MessageHandler.
7387 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
7389 * A pointer to the opaque Rust object.
7390 * Nearly everywhere, inner must be non-null, however in places where
7391 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7393 LDKnativeErroringMessageHandler *inner;
7395 * Indicates that this is the only struct which contains the same pointer.
7396 * Rust functions which take ownership of an object provided via an argument require
7397 * this to be true and invalidate the object pointed to by inner.
7400 } LDKErroringMessageHandler;
7405 * Provides references to trait impls which handle different types of messages.
7407 typedef struct MUST_USE_STRUCT LDKMessageHandler {
7409 * A pointer to the opaque Rust object.
7410 * Nearly everywhere, inner must be non-null, however in places where
7411 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7413 LDKnativeMessageHandler *inner;
7415 * Indicates that this is the only struct which contains the same pointer.
7416 * Rust functions which take ownership of an object provided via an argument require
7417 * this to be true and invalidate the object pointed to by inner.
7420 } LDKMessageHandler;
7423 * Provides an object which can be used to send data to and which uniquely identifies a connection
7424 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
7425 * implement Hash to meet the PeerManager API.
7427 * For efficiency, Clone should be relatively cheap for this type.
7429 * You probably want to just extend an int and put a file descriptor in a struct and implement
7430 * send_data. Note that if you are using a higher-level net library that may call close() itself,
7431 * be careful to ensure you don't have races whereby you might register a new connection with an
7432 * fd which is the same as a previous one which has yet to be removed via
7433 * PeerManager::socket_disconnected().
7435 typedef struct LDKSocketDescriptor {
7437 * An opaque pointer which is passed to your function implementations as an argument.
7438 * This has no meaning in the LDK, and can be NULL or any other value.
7442 * Attempts to send some data from the given slice to the peer.
7444 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
7445 * Note that in the disconnected case, socket_disconnected must still fire and further write
7446 * attempts may occur until that time.
7448 * If the returned size is smaller than data.len(), a write_available event must
7449 * trigger the next time more data can be written. Additionally, until the a send_data event
7450 * completes fully, no further read_events should trigger on the same peer!
7452 * If a read_event on this descriptor had previously returned true (indicating that read
7453 * events should be paused to prevent DoS in the send buffer), resume_read may be set
7454 * indicating that read events on this descriptor should resume. A resume_read of false does
7455 * *not* imply that further read events should be paused.
7457 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
7459 * Disconnect the socket pointed to by this SocketDescriptor. Once this function returns, no
7460 * more calls to write_buffer_space_avail, read_event or socket_disconnected may be made with
7461 * this descriptor. No socket_disconnected call should be generated as a result of this call,
7462 * though races may occur whereby disconnect_socket is called after a call to
7463 * socket_disconnected but prior to socket_disconnected returning.
7465 void (*disconnect_socket)(void *this_arg);
7467 * Checks if two objects are equal given this object's this_arg pointer and another object.
7469 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
7471 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
7472 * This is used, for example, for inclusion of this object in a hash map.
7474 uint64_t (*hash)(const void *this_arg);
7476 * Creates a copy of the object pointed to by this_arg, for a copy of this SocketDescriptor.
7477 * Note that the ultimate copy of the SocketDescriptor will have all function pointers the same as the original.
7478 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new SocketDescriptor.
7480 void *(*clone)(const void *this_arg);
7482 * Frees any resources associated with this object given its this_arg pointer.
7483 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7485 void (*free)(void *this_arg);
7486 } LDKSocketDescriptor;
7491 * A PeerManager manages a set of peers, described by their SocketDescriptor and marshalls socket
7492 * events into messages which it passes on to its MessageHandlers.
7494 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
7495 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
7496 * essentially you should default to using a SimpleRefPeerManager, and use a
7497 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
7498 * you're using lightning-net-tokio.
7500 typedef struct MUST_USE_STRUCT LDKPeerManager {
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 LDKnativePeerManager *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.
7518 * Static channel fields used to build transactions given per-commitment fields, organized by
7519 * broadcaster/countersignatory.
7521 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
7522 * as_holder_broadcastable and as_counterparty_broadcastable functions.
7524 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
7526 * A pointer to the opaque Rust object.
7527 * Nearly everywhere, inner must be non-null, however in places where
7528 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7530 LDKnativeDirectedChannelTransactionParameters *inner;
7532 * Indicates that this is the only struct which contains the same pointer.
7533 * Rust functions which take ownership of an object provided via an argument require
7534 * this to be true and invalidate the object pointed to by inner.
7537 } LDKDirectedChannelTransactionParameters;
7542 * A simple newtype for RwLockReadGuard<'a, NetworkGraph>.
7543 * This exists only to make accessing a RwLock<NetworkGraph> possible from
7544 * the C bindings, as it can be done directly in Rust code.
7546 typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
7548 * A pointer to the opaque Rust object.
7549 * Nearly everywhere, inner must be non-null, however in places where
7550 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7552 LDKnativeLockedNetworkGraph *inner;
7554 * Indicates that this is the only struct which contains the same pointer.
7555 * Rust functions which take ownership of an object provided via an argument require
7556 * this to be true and invalidate the object pointed to by inner.
7559 } LDKLockedNetworkGraph;
7564 * Receives and validates network updates from peers,
7565 * stores authentic and relevant data as a network graph.
7566 * This network graph is then used for routing payments.
7567 * Provides interface to help with initial routing sync by
7568 * serving historical announcements.
7570 typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
7572 * A pointer to the opaque Rust object.
7573 * Nearly everywhere, inner must be non-null, however in places where
7574 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7576 LDKnativeNetGraphMsgHandler *inner;
7578 * Indicates that this is the only struct which contains the same pointer.
7579 * Rust functions which take ownership of an object provided via an argument require
7580 * this to be true and invalidate the object pointed to by inner.
7583 } LDKNetGraphMsgHandler;
7588 * FilesystemPersister persists channel data on disk, where each channel's
7589 * data is stored in a file named after its funding outpoint.
7591 * Warning: this module does the best it can with calls to persist data, but it
7592 * can only guarantee that the data is passed to the drive. It is up to the
7593 * drive manufacturers to do the actual persistence properly, which they often
7594 * don't (especially on consumer-grade hardware). Therefore, it is up to the
7595 * user to validate their entire storage stack, to ensure the writes are
7597 * Corollary: especially when dealing with larger amounts of money, it is best
7598 * practice to have multiple channel data backups and not rely only on one
7599 * FilesystemPersister.
7601 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
7603 * A pointer to the opaque Rust object.
7604 * Nearly everywhere, inner must be non-null, however in places where
7605 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7607 LDKnativeFilesystemPersister *inner;
7609 * Indicates that this is the only struct which contains the same pointer.
7610 * Rust functions which take ownership of an object provided via an argument require
7611 * this to be true and invalidate the object pointed to by inner.
7614 } LDKFilesystemPersister;
7616 extern const uintptr_t MAX_BUF_SIZE;
7618 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
7620 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
7622 extern const uint16_t BREAKDOWN_TIMEOUT;
7624 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
7626 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
7629 * Frees the data buffer, if data_is_owned is set and datalen > 0.
7631 void Transaction_free(struct LDKTransaction _res);
7634 * Frees the data pointed to by script_pubkey.
7636 void TxOut_free(struct LDKTxOut _res);
7639 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
7641 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
7644 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
7646 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
7649 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
7651 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
7654 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
7656 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
7659 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
7660 * but with all dynamically-allocated buffers duplicated in new buffers.
7662 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
7665 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
7667 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
7670 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
7672 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
7675 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
7677 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
7680 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
7681 * but with all dynamically-allocated buffers duplicated in new buffers.
7683 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
7686 * Creates a new CResult_SecretKeyErrorZ in the success state.
7688 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
7691 * Creates a new CResult_SecretKeyErrorZ in the error state.
7693 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
7696 * Frees any resources used by the CResult_SecretKeyErrorZ.
7698 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
7701 * Creates a new CResult_PublicKeyErrorZ in the success state.
7703 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
7706 * Creates a new CResult_PublicKeyErrorZ in the error state.
7708 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
7711 * Frees any resources used by the CResult_PublicKeyErrorZ.
7713 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
7716 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
7718 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
7721 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
7723 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
7726 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
7728 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
7731 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
7732 * but with all dynamically-allocated buffers duplicated in new buffers.
7734 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
7737 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
7739 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
7742 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
7744 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
7747 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
7749 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
7752 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
7753 * but with all dynamically-allocated buffers duplicated in new buffers.
7755 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
7758 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
7760 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
7763 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
7765 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
7768 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
7770 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
7773 * Constructs a new COption_u32Z containing a u32
7775 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
7778 * Constructs a new COption_u32Z containing nothing
7780 struct LDKCOption_u32Z COption_u32Z_none(void);
7783 * Frees any resources associated with the u32, if we are in the Some state
7785 void COption_u32Z_free(struct LDKCOption_u32Z _res);
7788 * Creates a new COption_u32Z which has the same data as `orig`
7789 * but with all dynamically-allocated buffers duplicated in new buffers.
7791 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
7794 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
7796 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
7799 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
7801 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
7804 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
7806 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
7809 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
7810 * but with all dynamically-allocated buffers duplicated in new buffers.
7812 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
7815 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
7817 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
7820 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
7822 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
7825 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
7827 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
7830 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
7831 * but with all dynamically-allocated buffers duplicated in new buffers.
7833 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
7836 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
7838 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
7841 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
7843 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
7846 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
7848 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
7851 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
7852 * but with all dynamically-allocated buffers duplicated in new buffers.
7854 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
7857 * Frees the buffer pointed to by `data` if `datalen` is non-0.
7859 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
7862 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
7864 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
7867 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
7869 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
7872 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
7874 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
7877 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
7878 * but with all dynamically-allocated buffers duplicated in new buffers.
7880 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
7883 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
7885 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
7888 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
7890 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
7893 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
7895 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
7898 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
7899 * but with all dynamically-allocated buffers duplicated in new buffers.
7901 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
7904 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
7906 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
7909 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
7911 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
7914 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
7916 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
7919 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
7920 * but with all dynamically-allocated buffers duplicated in new buffers.
7922 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
7925 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
7927 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
7930 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
7932 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
7935 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
7937 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
7940 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
7942 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
7945 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
7947 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
7950 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
7952 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
7955 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
7956 * but with all dynamically-allocated buffers duplicated in new buffers.
7958 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
7961 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
7963 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
7966 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
7968 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
7971 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
7973 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
7976 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
7977 * but with all dynamically-allocated buffers duplicated in new buffers.
7979 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
7982 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
7984 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
7987 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
7989 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
7992 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
7994 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
7997 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
7998 * but with all dynamically-allocated buffers duplicated in new buffers.
8000 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
8003 * Creates a new CResult_NoneMonitorUpdateErrorZ in the success state.
8005 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
8008 * Creates a new CResult_NoneMonitorUpdateErrorZ in the error state.
8010 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e);
8013 * Frees any resources used by the CResult_NoneMonitorUpdateErrorZ.
8015 void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res);
8018 * Creates a new CResult_NoneMonitorUpdateErrorZ which has the same data as `orig`
8019 * but with all dynamically-allocated buffers duplicated in new buffers.
8021 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig);
8024 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
8026 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
8029 * Frees any resources used by the C2Tuple_OutPointScriptZ.
8031 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
8034 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
8036 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
8039 * Frees any resources used by the C2Tuple_u32ScriptZ.
8041 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
8044 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8046 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
8049 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
8051 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
8054 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
8056 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
8059 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8061 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
8064 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8066 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
8069 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8071 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
8074 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8076 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
8079 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
8081 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
8084 * Frees any resources used by the C2Tuple_usizeTransactionZ.
8086 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
8089 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8091 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
8094 * Creates a new tuple which has the same data as `orig`
8095 * but with all dynamically-allocated buffers duplicated in new buffers.
8097 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
8100 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
8102 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
8105 * Frees any resources used by the C2Tuple_u32TxOutZ.
8107 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
8110 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8112 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
8115 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
8117 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
8120 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
8122 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
8125 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8127 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
8130 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8132 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
8135 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
8137 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
8140 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
8142 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
8145 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
8147 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
8150 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
8151 * but with all dynamically-allocated buffers duplicated in new buffers.
8153 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
8156 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
8158 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
8161 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
8163 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
8166 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
8168 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
8171 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
8173 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
8176 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
8178 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
8181 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8183 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
8186 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8188 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
8191 * Creates a new CResult_RouteDecodeErrorZ in the success state.
8193 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
8196 * Creates a new CResult_RouteDecodeErrorZ in the error state.
8198 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
8201 * Frees any resources used by the CResult_RouteDecodeErrorZ.
8203 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
8206 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
8207 * but with all dynamically-allocated buffers duplicated in new buffers.
8209 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
8212 * Constructs a new COption_u64Z containing a u64
8214 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
8217 * Constructs a new COption_u64Z containing nothing
8219 struct LDKCOption_u64Z COption_u64Z_none(void);
8222 * Frees any resources associated with the u64, if we are in the Some state
8224 void COption_u64Z_free(struct LDKCOption_u64Z _res);
8227 * Creates a new COption_u64Z which has the same data as `orig`
8228 * but with all dynamically-allocated buffers duplicated in new buffers.
8230 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
8233 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8235 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
8238 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8240 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
8243 * Creates a new CResult_RouteLightningErrorZ in the success state.
8245 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
8248 * Creates a new CResult_RouteLightningErrorZ in the error state.
8250 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
8253 * Frees any resources used by the CResult_RouteLightningErrorZ.
8255 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
8258 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
8259 * but with all dynamically-allocated buffers duplicated in new buffers.
8261 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
8264 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8266 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
8269 * Creates a new CResult_boolLightningErrorZ in the success state.
8271 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
8274 * Creates a new CResult_boolLightningErrorZ in the error state.
8276 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
8279 * Frees any resources used by the CResult_boolLightningErrorZ.
8281 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
8284 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
8285 * but with all dynamically-allocated buffers duplicated in new buffers.
8287 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
8290 * Creates a new tuple which has the same data as `orig`
8291 * but with all dynamically-allocated buffers duplicated in new buffers.
8293 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
8296 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
8298 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
8301 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
8303 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
8306 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8308 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
8311 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8313 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
8316 * Creates a new CResult_NoneLightningErrorZ in the success state.
8318 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
8321 * Creates a new CResult_NoneLightningErrorZ in the error state.
8323 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
8326 * Frees any resources used by the CResult_NoneLightningErrorZ.
8328 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
8331 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
8332 * but with all dynamically-allocated buffers duplicated in new buffers.
8334 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
8337 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8339 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
8342 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8344 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
8347 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
8349 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
8352 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
8354 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
8357 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
8359 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
8362 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
8363 * but with all dynamically-allocated buffers duplicated in new buffers.
8365 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
8368 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
8370 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
8373 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
8375 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
8378 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
8380 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
8383 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
8384 * but with all dynamically-allocated buffers duplicated in new buffers.
8386 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
8389 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
8391 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
8394 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
8396 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
8399 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
8401 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
8404 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
8405 * but with all dynamically-allocated buffers duplicated in new buffers.
8407 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
8410 * Creates a new CResult_TxOutAccessErrorZ in the success state.
8412 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
8415 * Creates a new CResult_TxOutAccessErrorZ in the error state.
8417 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
8420 * Frees any resources used by the CResult_TxOutAccessErrorZ.
8422 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
8425 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
8426 * but with all dynamically-allocated buffers duplicated in new buffers.
8428 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
8431 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ
8433 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
8436 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing
8438 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
8441 * Frees any resources associated with the crate::c_types::derived::C2Tuple_usizeTransactionZ, if we are in the Some state
8443 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
8446 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8448 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
8451 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the success state.
8453 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o);
8456 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the error state.
8458 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
8461 * Frees any resources used by the CResult_DirectionalChannelInfoDecodeErrorZ.
8463 void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res);
8466 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ which has the same data as `orig`
8467 * but with all dynamically-allocated buffers duplicated in new buffers.
8469 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig);
8472 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
8474 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
8477 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
8479 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
8482 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
8484 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
8487 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
8488 * but with all dynamically-allocated buffers duplicated in new buffers.
8490 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
8493 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
8495 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
8498 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
8500 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
8503 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
8505 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
8508 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
8509 * but with all dynamically-allocated buffers duplicated in new buffers.
8511 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
8514 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8516 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
8519 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
8521 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
8524 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
8526 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
8529 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
8531 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
8534 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
8535 * but with all dynamically-allocated buffers duplicated in new buffers.
8537 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
8540 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8542 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
8545 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
8547 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
8550 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
8552 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
8555 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
8557 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
8560 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
8561 * but with all dynamically-allocated buffers duplicated in new buffers.
8563 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
8566 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
8568 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
8571 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
8573 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
8576 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
8578 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
8581 * Creates a new CResult_NetworkGraphDecodeErrorZ which has the same data as `orig`
8582 * but with all dynamically-allocated buffers duplicated in new buffers.
8584 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
8587 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
8589 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
8592 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
8594 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
8597 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
8599 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
8602 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
8604 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
8607 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
8609 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
8612 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
8614 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
8617 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
8619 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
8622 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
8624 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
8627 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
8629 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
8632 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
8634 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
8637 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
8639 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
8642 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
8644 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
8647 * Creates a new CResult_NetAddressu8Z in the success state.
8649 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
8652 * Creates a new CResult_NetAddressu8Z in the error state.
8654 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
8657 * Frees any resources used by the CResult_NetAddressu8Z.
8659 void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
8662 * Creates a new CResult_NetAddressu8Z which has the same data as `orig`
8663 * but with all dynamically-allocated buffers duplicated in new buffers.
8665 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
8668 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the success state.
8670 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
8673 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the error state.
8675 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
8678 * Frees any resources used by the CResult_CResult_NetAddressu8ZDecodeErrorZ.
8680 void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
8683 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ which has the same data as `orig`
8684 * but with all dynamically-allocated buffers duplicated in new buffers.
8686 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
8689 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8691 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
8694 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8696 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
8699 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8701 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
8704 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8706 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
8709 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
8711 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
8714 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
8716 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
8719 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
8721 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
8724 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
8725 * but with all dynamically-allocated buffers duplicated in new buffers.
8727 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
8730 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
8732 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
8735 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
8737 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
8740 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
8742 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
8745 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
8746 * but with all dynamically-allocated buffers duplicated in new buffers.
8748 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
8751 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
8753 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
8756 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
8758 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
8761 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
8763 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
8766 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
8767 * but with all dynamically-allocated buffers duplicated in new buffers.
8769 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
8772 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
8774 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
8777 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
8779 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
8782 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
8784 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
8787 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
8788 * but with all dynamically-allocated buffers duplicated in new buffers.
8790 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
8793 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
8795 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
8798 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
8800 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
8803 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
8805 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
8808 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
8809 * but with all dynamically-allocated buffers duplicated in new buffers.
8811 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
8814 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
8816 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
8819 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
8821 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
8824 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
8826 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
8829 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
8830 * but with all dynamically-allocated buffers duplicated in new buffers.
8832 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
8835 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
8837 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
8840 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
8842 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
8845 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
8847 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
8850 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
8851 * but with all dynamically-allocated buffers duplicated in new buffers.
8853 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
8856 * Creates a new CResult_FundingLockedDecodeErrorZ in the success state.
8858 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o);
8861 * Creates a new CResult_FundingLockedDecodeErrorZ in the error state.
8863 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e);
8866 * Frees any resources used by the CResult_FundingLockedDecodeErrorZ.
8868 void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res);
8871 * Creates a new CResult_FundingLockedDecodeErrorZ which has the same data as `orig`
8872 * but with all dynamically-allocated buffers duplicated in new buffers.
8874 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig);
8877 * Creates a new CResult_InitDecodeErrorZ in the success state.
8879 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
8882 * Creates a new CResult_InitDecodeErrorZ in the error state.
8884 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
8887 * Frees any resources used by the CResult_InitDecodeErrorZ.
8889 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
8892 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
8893 * but with all dynamically-allocated buffers duplicated in new buffers.
8895 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
8898 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
8900 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
8903 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
8905 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
8908 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
8910 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
8913 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
8914 * but with all dynamically-allocated buffers duplicated in new buffers.
8916 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
8919 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
8921 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
8924 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
8926 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
8929 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
8931 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
8934 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
8935 * but with all dynamically-allocated buffers duplicated in new buffers.
8937 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
8940 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
8942 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
8945 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
8947 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
8950 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
8952 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
8955 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
8956 * but with all dynamically-allocated buffers duplicated in new buffers.
8958 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
8961 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
8963 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
8966 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
8968 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
8971 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
8973 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
8976 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
8977 * but with all dynamically-allocated buffers duplicated in new buffers.
8979 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
8982 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
8984 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
8987 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
8989 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
8992 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
8994 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
8997 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
8998 * but with all dynamically-allocated buffers duplicated in new buffers.
9000 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
9003 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
9005 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
9008 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
9010 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
9013 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
9015 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
9018 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
9019 * but with all dynamically-allocated buffers duplicated in new buffers.
9021 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
9024 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
9026 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
9029 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
9031 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
9034 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
9036 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
9039 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
9040 * but with all dynamically-allocated buffers duplicated in new buffers.
9042 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
9045 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
9047 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
9050 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
9052 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
9055 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
9057 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
9060 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
9061 * but with all dynamically-allocated buffers duplicated in new buffers.
9063 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
9066 * Creates a new CResult_PingDecodeErrorZ in the success state.
9068 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
9071 * Creates a new CResult_PingDecodeErrorZ in the error state.
9073 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
9076 * Frees any resources used by the CResult_PingDecodeErrorZ.
9078 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
9081 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
9082 * but with all dynamically-allocated buffers duplicated in new buffers.
9084 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
9087 * Creates a new CResult_PongDecodeErrorZ in the success state.
9089 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
9092 * Creates a new CResult_PongDecodeErrorZ in the error state.
9094 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
9097 * Frees any resources used by the CResult_PongDecodeErrorZ.
9099 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
9102 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
9103 * but with all dynamically-allocated buffers duplicated in new buffers.
9105 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
9108 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
9110 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
9113 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
9115 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
9118 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
9120 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
9123 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
9124 * but with all dynamically-allocated buffers duplicated in new buffers.
9126 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
9129 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
9131 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
9134 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
9136 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
9139 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
9141 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
9144 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
9145 * but with all dynamically-allocated buffers duplicated in new buffers.
9147 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
9150 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
9152 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
9155 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
9157 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
9160 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
9162 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
9165 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
9166 * but with all dynamically-allocated buffers duplicated in new buffers.
9168 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
9171 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
9173 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
9176 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
9178 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
9181 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
9183 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
9186 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
9187 * but with all dynamically-allocated buffers duplicated in new buffers.
9189 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
9192 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
9194 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
9197 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
9199 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
9202 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
9204 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
9207 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
9208 * but with all dynamically-allocated buffers duplicated in new buffers.
9210 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
9213 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
9215 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
9218 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
9220 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
9223 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
9225 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
9228 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
9229 * but with all dynamically-allocated buffers duplicated in new buffers.
9231 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
9234 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
9236 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
9239 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
9241 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
9244 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
9246 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
9249 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
9250 * but with all dynamically-allocated buffers duplicated in new buffers.
9252 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
9255 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
9257 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
9260 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
9262 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
9265 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
9267 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
9270 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
9271 * but with all dynamically-allocated buffers duplicated in new buffers.
9273 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
9276 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
9278 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
9281 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
9283 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
9286 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
9288 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
9291 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
9292 * but with all dynamically-allocated buffers duplicated in new buffers.
9294 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
9297 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
9299 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
9302 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
9304 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
9307 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
9309 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
9312 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
9313 * but with all dynamically-allocated buffers duplicated in new buffers.
9315 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
9318 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
9320 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
9323 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
9325 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
9328 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
9330 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
9333 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
9334 * but with all dynamically-allocated buffers duplicated in new buffers.
9336 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
9339 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
9341 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
9344 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
9346 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
9349 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
9351 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
9354 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
9355 * but with all dynamically-allocated buffers duplicated in new buffers.
9357 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
9360 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
9362 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
9365 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
9367 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
9370 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
9372 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
9375 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
9376 * but with all dynamically-allocated buffers duplicated in new buffers.
9378 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
9381 * Creates a new tuple which has the same data as `orig`
9382 * but with all dynamically-allocated buffers duplicated in new buffers.
9384 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
9387 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
9389 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
9392 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
9394 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
9397 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
9399 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
9402 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
9404 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
9407 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
9409 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
9412 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
9413 * but with all dynamically-allocated buffers duplicated in new buffers.
9415 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
9418 * Creates a new CResult_SignatureNoneZ in the success state.
9420 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
9423 * Creates a new CResult_SignatureNoneZ in the error state.
9425 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
9428 * Frees any resources used by the CResult_SignatureNoneZ.
9430 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
9433 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
9434 * but with all dynamically-allocated buffers duplicated in new buffers.
9436 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
9439 * Creates a new CResult_SignDecodeErrorZ in the success state.
9441 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
9444 * Creates a new CResult_SignDecodeErrorZ in the error state.
9446 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
9449 * Frees any resources used by the CResult_SignDecodeErrorZ.
9451 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
9454 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
9455 * but with all dynamically-allocated buffers duplicated in new buffers.
9457 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
9460 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9462 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
9465 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
9467 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
9470 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
9472 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
9475 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
9477 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
9480 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
9481 * but with all dynamically-allocated buffers duplicated in new buffers.
9483 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
9486 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
9488 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
9491 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
9493 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
9496 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
9498 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
9501 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
9502 * but with all dynamically-allocated buffers duplicated in new buffers.
9504 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
9507 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9509 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
9512 * Creates a new CResult_TransactionNoneZ in the success state.
9514 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
9517 * Creates a new CResult_TransactionNoneZ in the error state.
9519 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
9522 * Frees any resources used by the CResult_TransactionNoneZ.
9524 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
9527 * Creates a new CResult_NoneErrorZ in the success state.
9529 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
9532 * Creates a new CResult_NoneErrorZ in the error state.
9534 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
9537 * Frees any resources used by the CResult_NoneErrorZ.
9539 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
9542 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9544 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
9547 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
9549 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
9552 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
9554 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
9557 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
9559 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
9562 * Creates a new CResult_NoneAPIErrorZ in the success state.
9564 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
9567 * Creates a new CResult_NoneAPIErrorZ in the error state.
9569 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
9572 * Frees any resources used by the CResult_NoneAPIErrorZ.
9574 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
9577 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
9578 * but with all dynamically-allocated buffers duplicated in new buffers.
9580 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
9583 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9585 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
9588 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9590 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
9593 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
9595 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
9598 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
9600 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
9603 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
9605 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
9608 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
9609 * but with all dynamically-allocated buffers duplicated in new buffers.
9611 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
9614 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9616 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
9619 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
9621 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
9624 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
9626 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
9629 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
9631 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
9634 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
9636 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
9639 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
9641 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
9644 * Frees any resources used by the Event
9646 void Event_free(struct LDKEvent this_ptr);
9649 * Creates a copy of the Event
9651 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
9654 * Serialize the Event object into a byte array which can be read by Event_read
9656 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
9659 * Frees any resources used by the MessageSendEvent
9661 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
9664 * Creates a copy of the MessageSendEvent
9666 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
9669 * Calls the free function if one is set
9671 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
9674 * Calls the free function if one is set
9676 void EventsProvider_free(struct LDKEventsProvider this_ptr);
9679 * Frees any resources used by the APIError
9681 void APIError_free(struct LDKAPIError this_ptr);
9684 * Creates a copy of the APIError
9686 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
9689 * Creates a copy of the Level
9691 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
9694 * Returns the most verbose logging level.
9696 MUST_USE_RES enum LDKLevel Level_max(void);
9699 * Calls the free function if one is set
9701 void Logger_free(struct LDKLogger this_ptr);
9704 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
9706 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
9709 * Confirmations we will wait for before considering the channel locked in.
9710 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
9711 * equivalent limit applied to outbound channels).
9715 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
9718 * Confirmations we will wait for before considering the channel locked in.
9719 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
9720 * equivalent limit applied to outbound channels).
9724 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
9727 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
9728 * the number of blocks we have to punish our counterparty if they broadcast a revoked
9731 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
9732 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
9733 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
9734 * possibly with time in between to RBF the spending transaction).
9736 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
9737 * case of an honest unilateral channel close, which implicitly decrease the economic value of
9740 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
9741 * can tweak config to ask for more security, not less.
9743 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
9746 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
9747 * the number of blocks we have to punish our counterparty if they broadcast a revoked
9750 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
9751 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
9752 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
9753 * possibly with time in between to RBF the spending transaction).
9755 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
9756 * case of an honest unilateral channel close, which implicitly decrease the economic value of
9759 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
9760 * can tweak config to ask for more security, not less.
9762 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
9765 * Set to the smallest value HTLC we will accept to process.
9767 * This value is sent to our counterparty on channel-open and we close the channel any time
9768 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
9770 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
9773 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
9776 * Set to the smallest value HTLC we will accept to process.
9778 * This value is sent to our counterparty on channel-open and we close the channel any time
9779 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
9781 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
9784 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
9787 * Constructs a new ChannelHandshakeConfig given each field
9789 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);
9792 * Creates a copy of the ChannelHandshakeConfig
9794 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
9797 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
9799 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
9802 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
9804 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
9807 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
9808 * only applies to inbound channels.
9812 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9815 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
9816 * only applies to inbound channels.
9820 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9823 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
9824 * you to limit the maximum minimum-size they can require.
9826 * Default value: u64::max_value.
9828 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9831 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
9832 * you to limit the maximum minimum-size they can require.
9834 * Default value: u64::max_value.
9836 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9839 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
9840 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
9844 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9847 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
9848 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
9852 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9855 * The remote node will require we keep a certain amount in direct payment to ourselves at all
9856 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
9857 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
9859 * Default value: u64::max_value.
9861 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9864 * The remote node will require we keep a certain amount in direct payment to ourselves at all
9865 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
9866 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
9868 * Default value: u64::max_value.
9870 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9873 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
9874 * time. This allows you to set a minimum such value.
9878 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9881 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
9882 * time. This allows you to set a minimum such value.
9886 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
9889 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
9890 * required to always be higher than this value so this only applies to HTLC outputs (and
9891 * potentially to-self outputs before any payments have been made).
9892 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
9893 * This setting allows you to set a minimum dust limit for their commitment transactions,
9894 * reflecting the reality that tiny outputs are not considered standard transactions and will
9895 * not propagate through the Bitcoin network.
9897 * Default value: 546, the current dust limit on the Bitcoin network.
9899 uint64_t ChannelHandshakeLimits_get_min_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9902 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
9903 * required to always be higher than this value so this only applies to HTLC outputs (and
9904 * potentially to-self outputs before any payments have been made).
9905 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
9906 * This setting allows you to set a minimum dust limit for their commitment transactions,
9907 * reflecting the reality that tiny outputs are not considered standard transactions and will
9908 * not propagate through the Bitcoin network.
9910 * Default value: 546, the current dust limit on the Bitcoin network.
9912 void ChannelHandshakeLimits_set_min_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9915 * Maximum allowed threshold above which outputs will not be generated in their commitment
9917 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
9919 * Default value: u64::max_value.
9921 uint64_t ChannelHandshakeLimits_get_max_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9924 * Maximum allowed threshold above which outputs will not be generated in their commitment
9926 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
9928 * Default value: u64::max_value.
9930 void ChannelHandshakeLimits_set_max_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9933 * Before a channel is usable the funding transaction will need to be confirmed by at least a
9934 * certain number of blocks, specified by the node which is not the funder (as the funder can
9935 * assume they aren't going to double-spend themselves).
9936 * This config allows you to set a limit on the maximum amount of time to wait.
9938 * Default value: 144, or roughly one day and only applies to outbound channels.
9940 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9943 * Before a channel is usable the funding transaction will need to be confirmed by at least a
9944 * certain number of blocks, specified by the node which is not the funder (as the funder can
9945 * assume they aren't going to double-spend themselves).
9946 * This config allows you to set a limit on the maximum amount of time to wait.
9948 * Default value: 144, or roughly one day and only applies to outbound channels.
9950 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
9953 * Set to force the incoming channel to match our announced channel preference in
9956 * Default value: true, to make the default that no announced channels are possible (which is
9957 * appropriate for any nodes which are not online very reliably).
9959 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9962 * Set to force the incoming channel to match our announced channel preference in
9965 * Default value: true, to make the default that no announced channels are possible (which is
9966 * appropriate for any nodes which are not online very reliably).
9968 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
9971 * Set to the amount of time we're willing to wait to claim money back to us.
9973 * Not checking this value would be a security issue, as our peer would be able to set it to
9974 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
9976 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
9977 * reduce the loss of having useless locked funds (if your peer accepts)
9979 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9982 * Set to the amount of time we're willing to wait to claim money back to us.
9984 * Not checking this value would be a security issue, as our peer would be able to set it to
9985 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
9987 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
9988 * reduce the loss of having useless locked funds (if your peer accepts)
9990 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
9993 * Constructs a new ChannelHandshakeLimits given each field
9995 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);
9998 * Creates a copy of the ChannelHandshakeLimits
10000 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
10003 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
10005 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
10008 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
10010 void ChannelConfig_free(struct LDKChannelConfig this_obj);
10013 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
10014 * This may be allowed to change at runtime in a later update, however doing so must result in
10015 * update messages sent to notify all nodes of our updated relay fee.
10017 * Default value: 0.
10019 uint32_t ChannelConfig_get_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
10022 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
10023 * This may be allowed to change at runtime in a later update, however doing so must result in
10024 * update messages sent to notify all nodes of our updated relay fee.
10026 * Default value: 0.
10028 void ChannelConfig_set_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
10031 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
10032 * the channel this config applies to.
10034 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
10035 * HTLC balance when a channel appears on-chain whereas
10036 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
10037 * (non-HTLC-encumbered) balance.
10039 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
10040 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
10041 * commitment transaction at least once per this many blocks (minus some margin to allow us
10042 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
10043 * the spending transaction).
10045 * Default value: 72 (12 hours at an average of 6 blocks/hour).
10046 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
10047 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
10049 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
10051 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
10054 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
10055 * the channel this config applies to.
10057 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
10058 * HTLC balance when a channel appears on-chain whereas
10059 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
10060 * (non-HTLC-encumbered) balance.
10062 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
10063 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
10064 * commitment transaction at least once per this many blocks (minus some margin to allow us
10065 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
10066 * the spending transaction).
10068 * Default value: 72 (12 hours at an average of 6 blocks/hour).
10069 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
10070 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
10072 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
10074 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
10077 * Set to announce the channel publicly and notify all nodes that they can route via this
10080 * This should only be set to true for nodes which expect to be online reliably.
10082 * As the node which funds a channel picks this value this will only apply for new outbound
10083 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
10085 * This cannot be changed after the initial channel handshake.
10087 * Default value: false.
10089 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
10092 * Set to announce the channel publicly and notify all nodes that they can route via this
10095 * This should only be set to true for nodes which expect to be online reliably.
10097 * As the node which funds a channel picks this value this will only apply for new outbound
10098 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
10100 * This cannot be changed after the initial channel handshake.
10102 * Default value: false.
10104 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
10107 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
10108 * supports it, they will then enforce the mutual-close output to us matches what we provided
10109 * at intialization, preventing us from closing to an alternate pubkey.
10111 * This is set to true by default to provide a slight increase in security, though ultimately
10112 * any attacker who is able to take control of a channel can just as easily send the funds via
10113 * lightning payments, so we never require that our counterparties support this option.
10115 * This cannot be changed after a channel has been initialized.
10117 * Default value: true.
10119 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
10122 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
10123 * supports it, they will then enforce the mutual-close output to us matches what we provided
10124 * at intialization, preventing us from closing to an alternate pubkey.
10126 * This is set to true by default to provide a slight increase in security, though ultimately
10127 * any attacker who is able to take control of a channel can just as easily send the funds via
10128 * lightning payments, so we never require that our counterparties support this option.
10130 * This cannot be changed after a channel has been initialized.
10132 * Default value: true.
10134 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
10137 * Constructs a new ChannelConfig given each field
10139 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);
10142 * Creates a copy of the ChannelConfig
10144 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
10147 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
10149 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
10152 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
10154 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
10157 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
10159 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
10162 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
10164 void UserConfig_free(struct LDKUserConfig this_obj);
10167 * Channel config that we propose to our counterparty.
10169 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
10172 * Channel config that we propose to our counterparty.
10174 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
10177 * Limits applied to our counterparty's proposed channel config settings.
10179 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
10182 * Limits applied to our counterparty's proposed channel config settings.
10184 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
10187 * Channel config which affects behavior during channel lifetime.
10189 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
10192 * Channel config which affects behavior during channel lifetime.
10194 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
10197 * Constructs a new UserConfig given each field
10199 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);
10202 * Creates a copy of the UserConfig
10204 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
10207 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
10209 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
10212 * Creates a copy of the AccessError
10214 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
10217 * Calls the free function if one is set
10219 void Access_free(struct LDKAccess this_ptr);
10222 * Calls the free function if one is set
10224 void Listen_free(struct LDKListen this_ptr);
10227 * Calls the free function if one is set
10229 void Watch_free(struct LDKWatch this_ptr);
10232 * Calls the free function if one is set
10234 void Filter_free(struct LDKFilter this_ptr);
10237 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
10239 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
10242 * First block where the transaction output may have been spent.
10244 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
10247 * First block where the transaction output may have been spent.
10249 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10252 * Outpoint identifying the transaction output.
10254 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
10257 * Outpoint identifying the transaction output.
10259 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
10262 * Spending condition of the transaction output.
10264 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
10267 * Spending condition of the transaction output.
10269 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
10272 * Constructs a new WatchedOutput given each field
10274 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
10277 * Calls the free function if one is set
10279 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
10282 * Creates a copy of the ConfirmationTarget
10284 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
10287 * Calls the free function if one is set
10289 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
10292 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
10294 void ChainMonitor_free(struct LDKChainMonitor this_obj);
10297 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
10298 * of a channel and reacting accordingly based on transactions in the connected block. See
10299 * [`ChannelMonitor::block_connected`] for details. Any HTLCs that were resolved on chain will
10300 * be returned by [`chain::Watch::release_pending_monitor_events`].
10302 * Calls back to [`chain::Filter`] if any monitor indicated new outputs to watch. Subsequent
10303 * calls must not exclude any transactions matching the new outputs nor any in-block
10304 * descendants of such transactions. It is not necessary to re-fetch the block to obtain
10305 * updated `txdata`.
10307 void ChainMonitor_block_connected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
10310 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
10311 * of a channel and reacting accordingly to newly confirmed transactions. For details, see
10312 * [`ChannelMonitor::transactions_confirmed`].
10314 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
10315 * blocks. May be called before or after [`update_best_block`] for transactions in the
10316 * corresponding block. See [`update_best_block`] for further calling expectations.
10318 * [`block_connected`]: Self::block_connected
10319 * [`update_best_block`]: Self::update_best_block
10321 void ChainMonitor_transactions_confirmed(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
10324 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
10325 * of a channel and reacting accordingly based on the new chain tip. For details, see
10326 * [`ChannelMonitor::update_best_block`].
10328 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
10329 * blocks. May be called before or after [`transactions_confirmed`] for the corresponding
10332 * Must be called after new blocks become available for the most recent block. Intermediary
10333 * blocks, however, may be safely skipped. In the event of a chain re-organization, this only
10334 * needs to be called for the most recent block assuming `transaction_unconfirmed` is called
10335 * for any affected transactions.
10337 * [`block_connected`]: Self::block_connected
10338 * [`transactions_confirmed`]: Self::transactions_confirmed
10339 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
10341 void ChainMonitor_update_best_block(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height);
10344 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
10345 * of a channel based on the disconnected block. See [`ChannelMonitor::block_disconnected`] for
10348 void ChainMonitor_block_disconnected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t disconnected_height);
10351 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
10352 * of a channel based on transactions unconfirmed as a result of a chain reorganization. See
10353 * [`ChannelMonitor::transaction_unconfirmed`] for details.
10355 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
10356 * than blocks. May be called before or after [`update_best_block`] for transactions in the
10357 * corresponding block. See [`update_best_block`] for further calling expectations.
10359 * [`block_disconnected`]: Self::block_disconnected
10360 * [`update_best_block`]: Self::update_best_block
10362 void ChainMonitor_transaction_unconfirmed(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*txid)[32]);
10365 * Returns the set of txids that should be monitored for re-organization out of the chain.
10367 MUST_USE_RES struct LDKCVec_TxidZ ChainMonitor_get_relevant_txids(const struct LDKChainMonitor *NONNULL_PTR this_arg);
10370 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
10372 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
10373 * will call back to it indicating transactions and outputs of interest. This allows clients to
10374 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
10375 * always need to fetch full blocks absent another means for determining which blocks contain
10376 * transactions relevant to the watched channels.
10378 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
10381 * Constructs a new Watch which calls the relevant methods on this_arg.
10382 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
10384 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
10387 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
10388 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
10390 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
10393 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
10395 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
10398 * The sequence number of this update. Updates *must* be replayed in-order according to this
10399 * sequence number (and updates may panic if they are not). The update_id values are strictly
10400 * increasing and increase by one for each new update, with one exception specified below.
10402 * This sequence number is also used to track up to which points updates which returned
10403 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
10404 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
10406 * The only instance where update_id values are not strictly increasing is the case where we
10407 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
10408 * its docs for more details.
10410 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
10413 * The sequence number of this update. Updates *must* be replayed in-order according to this
10414 * sequence number (and updates may panic if they are not). The update_id values are strictly
10415 * increasing and increase by one for each new update, with one exception specified below.
10417 * This sequence number is also used to track up to which points updates which returned
10418 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
10419 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
10421 * The only instance where update_id values are not strictly increasing is the case where we
10422 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
10423 * its docs for more details.
10425 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
10428 * Creates a copy of the ChannelMonitorUpdate
10430 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
10433 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
10435 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
10438 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
10440 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
10443 * Creates a copy of the ChannelMonitorUpdateErr
10445 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
10448 * Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
10450 void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
10453 * Creates a copy of the MonitorUpdateError
10455 struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
10458 * Frees any resources used by the MonitorEvent
10460 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
10463 * Creates a copy of the MonitorEvent
10465 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
10468 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
10470 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
10473 * Creates a copy of the HTLCUpdate
10475 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
10478 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
10480 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
10483 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
10485 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
10488 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
10490 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
10493 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
10495 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
10498 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
10501 * panics if the given update is not the next update by update_id.
10503 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);
10506 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
10509 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10512 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
10514 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10517 * Gets a list of txids, with their output scripts (in the order they appear in the
10518 * transaction), which we must learn about spends of via block_connected().
10520 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10523 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
10524 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
10525 * have been registered.
10527 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
10530 * Get the list of HTLCs who's status has been updated on chain. This should be called by
10531 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
10533 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10536 * Gets the list of pending events which were generated by previous actions, clearing the list
10539 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
10540 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
10541 * no internal locking in ChannelMonitors.
10543 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10546 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
10547 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
10548 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
10549 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
10550 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
10551 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
10552 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
10553 * out-of-band the other node operator to coordinate with him if option is available to you.
10554 * In any-case, choice is up to the user.
10556 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);
10559 * Processes transactions in a newly connected block, which may result in any of the following:
10560 * - update the monitor's state against resolved HTLCs
10561 * - punish the counterparty in the case of seeing a revoked commitment transaction
10562 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
10563 * - detect settled outputs for later spending
10564 * - schedule and bump any in-flight claims
10566 * Returns any new outputs to watch from `txdata`; after called, these are also included in
10567 * [`get_outputs_to_watch`].
10569 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
10571 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);
10574 * Determines if the disconnected block contained any transactions of interest and updates
10577 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);
10580 * Processes transactions confirmed in a block with the given header and height, returning new
10581 * outputs to watch. See [`block_connected`] for details.
10583 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
10584 * blocks. May be called before or after [`update_best_block`] for transactions in the
10585 * corresponding block. See [`update_best_block`] for further calling expectations.
10587 * [`block_connected`]: Self::block_connected
10588 * [`update_best_block`]: Self::update_best_block
10590 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);
10593 * Processes a transaction that was reorganized out of the chain.
10595 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
10596 * than blocks. May be called before or after [`update_best_block`] for transactions in the
10597 * corresponding block. See [`update_best_block`] for further calling expectations.
10599 * [`block_disconnected`]: Self::block_disconnected
10600 * [`update_best_block`]: Self::update_best_block
10602 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);
10605 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
10606 * [`block_connected`] for details.
10608 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
10609 * blocks. May be called before or after [`transactions_confirmed`] for the corresponding
10612 * Must be called after new blocks become available for the most recent block. Intermediary
10613 * blocks, however, may be safely skipped. In the event of a chain re-organization, this only
10614 * needs to be called for the most recent block assuming `transaction_unconfirmed` is called
10615 * for any affected transactions.
10617 * [`block_connected`]: Self::block_connected
10618 * [`transactions_confirmed`]: Self::transactions_confirmed
10619 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
10621 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_update_best_block(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);
10624 * Returns the set of txids that should be monitored for re-organization out of the chain.
10626 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10629 * Calls the free function if one is set
10631 void Persist_free(struct LDKPersist this_ptr);
10634 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
10636 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
10639 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
10641 void OutPoint_free(struct LDKOutPoint this_obj);
10644 * The referenced transaction's txid.
10646 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
10649 * The referenced transaction's txid.
10651 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10654 * The index of the referenced output in its transaction's vout.
10656 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
10659 * The index of the referenced output in its transaction's vout.
10661 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
10664 * Constructs a new OutPoint given each field
10666 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
10669 * Creates a copy of the OutPoint
10671 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
10674 * Convert an `OutPoint` to a lightning channel id.
10676 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
10679 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
10681 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
10684 * Read a OutPoint from a byte array, created by OutPoint_write
10686 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
10689 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
10691 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
10694 * The outpoint which is spendable
10696 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10699 * The outpoint which is spendable
10701 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
10704 * Per commitment point to derive delayed_payment_key by key holder
10706 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10709 * Per commitment point to derive delayed_payment_key by key holder
10711 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10714 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
10715 * the witness_script.
10717 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10720 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
10721 * the witness_script.
10723 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
10726 * The output which is referenced by the given outpoint
10728 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
10731 * The revocation point specific to the commitment transaction which was broadcast. Used to
10732 * derive the witnessScript for this output.
10734 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10737 * The revocation point specific to the commitment transaction which was broadcast. Used to
10738 * derive the witnessScript for this output.
10740 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10743 * Arbitrary identification information returned by a call to
10744 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
10745 * the channel to spend the output.
10747 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
10750 * Arbitrary identification information returned by a call to
10751 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
10752 * the channel to spend the output.
10754 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10757 * The value of the channel which this output originated from, possibly indirectly.
10759 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10762 * The value of the channel which this output originated from, possibly indirectly.
10764 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
10767 * Constructs a new DelayedPaymentOutputDescriptor given each field
10769 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);
10772 * Creates a copy of the DelayedPaymentOutputDescriptor
10774 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
10777 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
10779 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
10782 * The outpoint which is spendable
10784 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10787 * The outpoint which is spendable
10789 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
10792 * The output which is referenced by the given outpoint
10794 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
10797 * Arbitrary identification information returned by a call to
10798 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
10799 * the channel to spend the output.
10801 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
10804 * Arbitrary identification information returned by a call to
10805 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
10806 * the channel to spend the output.
10808 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10811 * The value of the channel which this transactions spends.
10813 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10816 * The value of the channel which this transactions spends.
10818 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
10821 * Constructs a new StaticPaymentOutputDescriptor given each field
10823 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);
10826 * Creates a copy of the StaticPaymentOutputDescriptor
10828 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
10831 * Frees any resources used by the SpendableOutputDescriptor
10833 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
10836 * Creates a copy of the SpendableOutputDescriptor
10838 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
10841 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
10843 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
10846 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
10848 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
10851 * Calls the free function if one is set
10853 void BaseSign_free(struct LDKBaseSign this_ptr);
10856 * Creates a copy of a Sign
10858 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
10861 * Calls the free function if one is set
10863 void Sign_free(struct LDKSign this_ptr);
10866 * Calls the free function if one is set
10868 void KeysInterface_free(struct LDKKeysInterface this_ptr);
10871 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
10873 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
10876 * Private key of anchor tx
10878 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10881 * Private key of anchor tx
10883 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10886 * Holder secret key for blinded revocation pubkey
10888 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10891 * Holder secret key for blinded revocation pubkey
10893 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10896 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
10898 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10901 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
10903 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10906 * Holder secret key used in HTLC tx
10908 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10911 * Holder secret key used in HTLC tx
10913 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10916 * Holder htlc secret key used in commitment tx htlc outputs
10918 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10921 * Holder htlc secret key used in commitment tx htlc outputs
10923 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10928 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10933 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10936 * Creates a copy of the InMemorySigner
10938 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
10941 * Create a new InMemorySigner
10943 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);
10946 * Counterparty pubkeys.
10947 * Will panic if ready_channel wasn't called.
10949 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10952 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
10953 * transactions, ie the amount of time that we have to wait to recover our funds if we
10954 * broadcast a transaction.
10955 * Will panic if ready_channel wasn't called.
10957 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10960 * The contest_delay value specified by us and applied on transactions broadcastable
10961 * by our counterparty, ie the amount of time that they have to wait to recover their funds
10962 * if they broadcast a transaction.
10963 * Will panic if ready_channel wasn't called.
10965 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10968 * Whether the holder is the initiator
10969 * Will panic if ready_channel wasn't called.
10971 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10975 * Will panic if ready_channel wasn't called.
10977 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10980 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
10981 * building transactions.
10983 * Will panic if ready_channel wasn't called.
10985 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10988 * Sign the single input of spend_tx at index `input_idx` which spends the output
10989 * described by descriptor, returning the witness stack for the input.
10991 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
10992 * or is not spending the outpoint described by `descriptor.outpoint`.
10994 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);
10997 * Sign the single input of spend_tx at index `input_idx` which spends the output
10998 * described by descriptor, returning the witness stack for the input.
11000 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
11001 * is not spending the outpoint described by `descriptor.outpoint`, or does not have a
11002 * sequence set to `descriptor.to_self_delay`.
11004 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);
11007 * Constructs a new BaseSign which calls the relevant methods on this_arg.
11008 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
11010 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
11013 * Constructs a new Sign which calls the relevant methods on this_arg.
11014 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
11016 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
11019 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
11021 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
11024 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
11026 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
11029 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
11031 void KeysManager_free(struct LDKKeysManager this_obj);
11034 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
11035 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
11036 * starting_time isn't strictly required to actually be a time, but it must absolutely,
11037 * without a doubt, be unique to this instance. ie if you start multiple times with the same
11038 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
11039 * simply use the current time (with very high precision).
11041 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
11042 * obviously, starting_time should be unique every time you reload the library - it is only
11043 * used to generate new ephemeral key data (which will be stored by the individual channel if
11046 * Note that the seed is required to recover certain on-chain funds independent of
11047 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
11048 * channel, and some on-chain during-closing funds.
11050 * Note that until the 0.1 release there is no guarantee of backward compatibility between
11051 * versions. Once the library is more fully supported, the docs will be updated to include a
11052 * detailed description of the guarantee.
11054 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
11057 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
11059 * Key derivation parameters are accessible through a per-channel secrets
11060 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
11061 * onchain output detection for which a corresponding delayed_payment_key must be derived.
11063 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]);
11066 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
11067 * output to the given change destination (if sufficient change value remains). The
11068 * transaction will have a feerate, at least, of the given value.
11070 * Returns `Err(())` if the output value is greater than the input value minus required fee or
11071 * if a descriptor was duplicated.
11073 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
11075 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
11076 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
11078 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);
11081 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
11082 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
11084 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
11087 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
11089 void ChannelManager_free(struct LDKChannelManager this_obj);
11092 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
11094 void ChainParameters_free(struct LDKChainParameters this_obj);
11097 * The network for determining the `chain_hash` in Lightning messages.
11099 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
11102 * The network for determining the `chain_hash` in Lightning messages.
11104 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
11107 * The hash and height of the latest block successfully connected.
11109 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
11111 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
11114 * The hash and height of the latest block successfully connected.
11116 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
11118 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
11121 * Constructs a new ChainParameters given each field
11123 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
11126 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
11128 void BestBlock_free(struct LDKBestBlock this_obj);
11131 * Creates a copy of the BestBlock
11133 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
11136 * Returns the best block from the genesis of the given network.
11138 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
11141 * Returns the best block as identified by the given block hash and height.
11143 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
11146 * Returns the best block hash.
11148 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
11151 * Returns the best block height.
11153 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
11156 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
11158 void ChannelDetails_free(struct LDKChannelDetails this_obj);
11161 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
11162 * thereafter this is the txid of the funding transaction xor the funding transaction output).
11163 * Note that this means this value is *not* persistent - it can change once during the
11164 * lifetime of the channel.
11166 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
11169 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
11170 * thereafter this is the txid of the funding transaction xor the funding transaction output).
11171 * Note that this means this value is *not* persistent - it can change once during the
11172 * lifetime of the channel.
11174 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11177 * The position of the funding transaction in the chain. None if the funding transaction has
11178 * not yet been confirmed and the channel fully opened.
11180 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11183 * The position of the funding transaction in the chain. None if the funding transaction has
11184 * not yet been confirmed and the channel fully opened.
11186 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
11189 * The node_id of our counterparty
11191 struct LDKPublicKey ChannelDetails_get_remote_network_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11194 * The node_id of our counterparty
11196 void ChannelDetails_set_remote_network_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11199 * The Features the channel counterparty provided upon last connection.
11200 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
11201 * many routing-relevant features are present in the init context.
11203 struct LDKInitFeatures ChannelDetails_get_counterparty_features(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11206 * The Features the channel counterparty provided upon last connection.
11207 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
11208 * many routing-relevant features are present in the init context.
11210 void ChannelDetails_set_counterparty_features(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
11213 * The value, in satoshis, of this channel as appears in the funding output
11215 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11218 * The value, in satoshis, of this channel as appears in the funding output
11220 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
11223 * The user_id passed in to create_channel, or 0 if the channel was inbound.
11225 uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11228 * The user_id passed in to create_channel, or 0 if the channel was inbound.
11230 void ChannelDetails_set_user_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
11233 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
11234 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
11235 * available for inclusion in new outbound HTLCs). This further does not include any pending
11236 * outgoing HTLCs which are awaiting some other resolution to be sent.
11238 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11241 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
11242 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
11243 * available for inclusion in new outbound HTLCs). This further does not include any pending
11244 * outgoing HTLCs which are awaiting some other resolution to be sent.
11246 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
11249 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
11250 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
11251 * available for inclusion in new inbound HTLCs).
11252 * Note that there are some corner cases not fully handled here, so the actual available
11253 * inbound capacity may be slightly higher than this.
11255 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11258 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
11259 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
11260 * available for inclusion in new inbound HTLCs).
11261 * Note that there are some corner cases not fully handled here, so the actual available
11262 * inbound capacity may be slightly higher than this.
11264 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
11267 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
11268 * the peer is connected, and (c) no monitor update failure is pending resolution.
11270 bool ChannelDetails_get_is_live(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11273 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
11274 * the peer is connected, and (c) no monitor update failure is pending resolution.
11276 void ChannelDetails_set_is_live(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
11279 * Creates a copy of the ChannelDetails
11281 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
11284 * Frees any resources used by the PaymentSendFailure
11286 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
11289 * Creates a copy of the PaymentSendFailure
11291 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
11294 * Constructs a new ChannelManager to hold several channels and route between them.
11296 * This is the main \"logic hub\" for all channel-related actions, and implements
11297 * ChannelMessageHandler.
11299 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
11301 * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
11303 * Users need to notify the new ChannelManager when a new block is connected or
11304 * disconnected using its `block_connected` and `block_disconnected` methods, starting
11305 * from after `params.latest_hash`.
11307 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);
11310 * Gets the current configuration applied to all new channels, as
11312 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
11315 * Creates a new outbound channel to the given remote node and with the given value.
11317 * user_id will be provided back as user_channel_id in FundingGenerationReady events to allow
11318 * tracking of which events correspond with which create_channel call. Note that the
11319 * user_channel_id defaults to 0 for inbound channels, so you may wish to avoid using 0 for
11320 * user_id here. user_id has no meaning inside of LDK, it is simply copied to events and
11321 * otherwise ignored.
11323 * If successful, will generate a SendOpenChannel message event, so you should probably poll
11324 * PeerManager::process_events afterwards.
11326 * Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
11327 * greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
11329 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);
11332 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
11333 * more information.
11335 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
11338 * Gets the list of usable channels, in random order. Useful as an argument to
11339 * get_route to ensure non-announced channels are used.
11341 * These are guaranteed to have their is_live value set to true, see the documentation for
11342 * ChannelDetails::is_live for more info on exactly what the criteria are.
11344 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
11347 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
11348 * will be accepted on the given channel, and after additional timeout/the closing of all
11349 * pending HTLCs, the channel will be closed on chain.
11351 * May generate a SendShutdown message event on success, which should be relayed.
11353 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
11356 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
11357 * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
11359 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
11362 * Force close all channels, immediately broadcasting the latest local commitment transaction
11363 * for each to the chain and rejecting new HTLCs on each.
11365 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
11368 * Sends a payment along a given route.
11370 * Value parameters are provided via the last hop in route, see documentation for RouteHop
11371 * fields for more info.
11373 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
11374 * payment), we don't do anything to stop you! We always try to ensure that if the provided
11375 * next hop knows the preimage to payment_hash they can claim an additional amount as
11376 * specified in the last hop in the route! Thus, you should probably do your own
11377 * payment_preimage tracking (which you should already be doing as they represent \"proof of
11378 * payment\") and prevent double-sends yourself.
11380 * May generate SendHTLCs message(s) event on success, which should be relayed.
11382 * Each path may have a different return value, and PaymentSendValue may return a Vec with
11383 * each entry matching the corresponding-index entry in the route paths, see
11384 * PaymentSendFailure for more info.
11386 * In general, a path may raise:
11387 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
11388 * node public key) is specified.
11389 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
11390 * (including due to previous monitor update failure or new permanent monitor update
11392 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
11393 * relevant updates.
11395 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
11396 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
11397 * different route unless you intend to pay twice!
11399 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
11400 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
11401 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
11402 * must not contain multiple paths as multi-path payments require a recipient-provided
11404 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
11405 * bit set (either as required or as available). If multiple paths are present in the Route,
11406 * we assume the invoice had the basic_mpp feature set.
11408 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);
11411 * Call this upon creation of a funding transaction for the given channel.
11413 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
11414 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
11416 * Panics if a funding transaction has already been provided for this channel.
11418 * May panic if the output found in the funding transaction is duplicative with some other
11419 * channel (note that this should be trivially prevented by using unique funding transaction
11420 * keys per-channel).
11422 * Do NOT broadcast the funding transaction yourself. When we have safely received our
11423 * counterparty's signature the funding transaction will automatically be broadcast via the
11424 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
11426 * Note that this includes RBF or similar transaction replacement strategies - lightning does
11427 * not currently support replacing a funding transaction on an existing channel. Instead,
11428 * create a new channel with a conflicting funding transaction.
11430 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);
11433 * Generates a signed node_announcement from the given arguments and creates a
11434 * BroadcastNodeAnnouncement event. Note that such messages will be ignored unless peers have
11435 * seen a channel_announcement from us (ie unless we have public channels open).
11437 * RGB is a node \"color\" and alias is a printable human-readable string to describe this node
11438 * to humans. They carry no in-protocol meaning.
11440 * addresses represent the set (possibly empty) of socket addresses on which this node accepts
11441 * incoming connections. These will be broadcast to the network, publicly tying these
11442 * addresses together. If you wish to preserve user privacy, addresses should likely contain
11443 * only Tor Onion addresses.
11445 * Panics if addresses is absurdly large (more than 500).
11447 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
11450 * Processes HTLCs which are pending waiting on random forward delay.
11452 * Should only really ever be called in response to a PendingHTLCsForwardable event.
11453 * Will likely generate further events.
11455 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
11458 * If a peer is disconnected we mark any channels with that peer as 'disabled'.
11459 * After some time, if channels are still disabled we need to broadcast a ChannelUpdate
11460 * to inform the network about the uselessness of these channels.
11462 * This method handles all the details, and must be called roughly once per minute.
11464 * Note that in some rare cases this may generate a `chain::Watch::update_channel` call.
11466 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
11469 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
11470 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
11471 * along the path (including in our own channel on which we received it).
11472 * Returns false if no payment was found to fail backwards, true if the process of failing the
11473 * HTLC backwards has been started.
11475 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);
11478 * Provides a payment preimage in response to a PaymentReceived event, returning true and
11479 * generating message events for the net layer to claim the payment, if possible. Thus, you
11480 * should probably kick the net layer to go send messages if this returns true!
11482 * You must specify the expected amounts for this HTLC, and we will only claim HTLCs
11483 * available within a few percent of the expected amount. This is critical for several
11484 * reasons : a) it avoids providing senders with `proof-of-payment` (in the form of the
11485 * payment_preimage without having provided the full value and b) it avoids certain
11486 * privacy-breaking recipient-probing attacks which may reveal payment activity to
11487 * motivated attackers.
11489 * Note that the privacy concerns in (b) are not relevant in payments with a payment_secret
11490 * set. Thus, for such payments we will claim any payments which do not under-pay.
11492 * May panic if called except in response to a PaymentReceived event.
11494 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);
11497 * Gets the node_id held by this ChannelManager
11499 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
11502 * Restores a single, given channel to normal operation after a
11503 * ChannelMonitorUpdateErr::TemporaryFailure was returned from a channel monitor update
11506 * All ChannelMonitor updates up to and including highest_applied_update_id must have been
11507 * fully committed in every copy of the given channels' ChannelMonitors.
11509 * Note that there is no effect to calling with a highest_applied_update_id other than the
11510 * current latest ChannelMonitorUpdate and one call to this function after multiple
11511 * ChannelMonitorUpdateErr::TemporaryFailures is fine. The highest_applied_update_id field
11512 * exists largely only to prevent races between this and concurrent update_monitor calls.
11514 * Thus, the anticipated use is, at a high level:
11515 * 1) You register a chain::Watch with this ChannelManager,
11516 * 2) it stores each update to disk, and begins updating any remote (eg watchtower) copies of
11517 * said ChannelMonitors as it can, returning ChannelMonitorUpdateErr::TemporaryFailures
11518 * any time it cannot do so instantly,
11519 * 3) update(s) are applied to each remote copy of a ChannelMonitor,
11520 * 4) once all remote copies are updated, you call this function with the update_id that
11521 * completed, and once it is the latest the Channel will be re-enabled.
11523 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);
11526 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
11527 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
11529 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
11532 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
11533 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
11535 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
11538 * Constructs a new Listen which calls the relevant methods on this_arg.
11539 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
11541 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
11544 * Updates channel state to take note of transactions which were confirmed in the given block
11545 * at the given height.
11547 * Note that you must still call (or have called) [`update_best_block`] with the block
11548 * information which is included here.
11550 * This method may be called before or after [`update_best_block`] for a given block's
11551 * transaction data and may be called multiple times with additional transaction data for a
11554 * This method may be called for a previous block after an [`update_best_block`] call has
11555 * been made for a later block, however it must *not* be called with transaction data from a
11556 * block which is no longer in the best chain (ie where [`update_best_block`] has already
11557 * been informed about a blockchain reorganization which no longer includes the block which
11558 * corresponds to `header`).
11560 * [`update_best_block`]: `Self::update_best_block`
11562 void ChannelManager_transactions_confirmed(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKCVec_C2Tuple_usizeTransactionZZ txdata);
11565 * Updates channel state with the current best blockchain tip. You should attempt to call this
11566 * quickly after a new block becomes available, however if multiple new blocks become
11567 * available at the same time, only a single `update_best_block()` call needs to be made.
11569 * This method should also be called immediately after any block disconnections, once at the
11570 * reorganization fork point, and once with the new chain tip. Calling this method at the
11571 * blockchain reorganization fork point ensures we learn when a funding transaction which was
11572 * previously confirmed is reorganized out of the blockchain, ensuring we do not continue to
11573 * accept payments which cannot be enforced on-chain.
11575 * In both the block-connection and block-disconnection case, this method may be called either
11576 * once per block connected or disconnected, or simply at the fork point and new tip(s),
11577 * skipping any intermediary blocks.
11579 void ChannelManager_update_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height);
11582 * Gets the set of txids which should be monitored for their confirmation state.
11584 * If you're providing information about reorganizations via [`transaction_unconfirmed`], this
11585 * is the set of transactions which you may need to call [`transaction_unconfirmed`] for.
11587 * This may be useful to poll to determine the set of transactions which must be registered
11588 * with an Electrum server or for which an Electrum server needs to be polled to determine
11589 * transaction confirmation state.
11591 * This may update after any [`transactions_confirmed`] or [`block_connected`] call.
11593 * Note that this is NOT the set of transactions which must be included in calls to
11594 * [`transactions_confirmed`] if they are confirmed, but a small subset of it.
11596 * [`transactions_confirmed`]: Self::transactions_confirmed
11597 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
11598 * [`block_connected`]: chain::Listen::block_connected
11600 MUST_USE_RES struct LDKCVec_TxidZ ChannelManager_get_relevant_txids(const struct LDKChannelManager *NONNULL_PTR this_arg);
11603 * Marks a transaction as having been reorganized out of the blockchain.
11605 * If a transaction is included in [`get_relevant_txids`], and is no longer in the main branch
11606 * of the blockchain, this function should be called to indicate that the transaction should
11607 * be considered reorganized out.
11609 * Once this is called, the given transaction will no longer appear on [`get_relevant_txids`],
11610 * though this may be called repeatedly for a given transaction without issue.
11612 * Note that if the transaction is confirmed on the main chain in a different block (indicated
11613 * via a call to [`transactions_confirmed`]), it may re-appear in [`get_relevant_txids`], thus
11614 * be very wary of race-conditions wherein the final state of a transaction indicated via
11615 * these APIs is not the same as its state on the blockchain.
11617 * [`transactions_confirmed`]: Self::transactions_confirmed
11618 * [`get_relevant_txids`]: Self::get_relevant_txids
11620 void ChannelManager_transaction_unconfirmed(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*txid)[32]);
11623 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
11624 * indicating whether persistence is necessary. Only one listener on
11625 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
11627 * Note that the feature `allow_wallclock_use` must be enabled to use this function.
11629 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
11632 * Blocks until ChannelManager needs to be persisted. Only one listener on
11633 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
11636 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
11639 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
11640 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
11642 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
11645 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
11647 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
11650 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
11652 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
11655 * The keys provider which will give us relevant keys. Some keys will be loaded during
11656 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
11659 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11662 * The keys provider which will give us relevant keys. Some keys will be loaded during
11663 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
11666 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
11669 * The fee_estimator for use in the ChannelManager in the future.
11671 * No calls to the FeeEstimator will be made during deserialization.
11673 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11676 * The fee_estimator for use in the ChannelManager in the future.
11678 * No calls to the FeeEstimator will be made during deserialization.
11680 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
11683 * The chain::Watch for use in the ChannelManager in the future.
11685 * No calls to the chain::Watch will be made during deserialization. It is assumed that
11686 * you have deserialized ChannelMonitors separately and will add them to your
11687 * chain::Watch after deserializing this ChannelManager.
11689 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11692 * The chain::Watch for use in the ChannelManager in the future.
11694 * No calls to the chain::Watch will be made during deserialization. It is assumed that
11695 * you have deserialized ChannelMonitors separately and will add them to your
11696 * chain::Watch after deserializing this ChannelManager.
11698 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
11701 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
11702 * used to broadcast the latest local commitment transactions of channels which must be
11703 * force-closed during deserialization.
11705 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11708 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
11709 * used to broadcast the latest local commitment transactions of channels which must be
11710 * force-closed during deserialization.
11712 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
11715 * The Logger for use in the ChannelManager and which may be used to log information during
11718 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11721 * The Logger for use in the ChannelManager and which may be used to log information during
11724 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
11727 * Default settings used for new channels. Any existing channels will continue to use the
11728 * runtime settings which were stored when the ChannelManager was serialized.
11730 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11733 * Default settings used for new channels. Any existing channels will continue to use the
11734 * runtime settings which were stored when the ChannelManager was serialized.
11736 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
11739 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
11740 * HashMap for you. This is primarily useful for C bindings where it is not practical to
11741 * populate a HashMap directly from C.
11743 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);
11746 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
11748 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
11751 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
11753 void DecodeError_free(struct LDKDecodeError this_obj);
11756 * Creates a copy of the DecodeError
11758 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
11761 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
11763 void Init_free(struct LDKInit this_obj);
11766 * The relevant features which the sender supports
11768 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
11771 * The relevant features which the sender supports
11773 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
11776 * Constructs a new Init given each field
11778 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
11781 * Creates a copy of the Init
11783 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
11786 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
11788 void ErrorMessage_free(struct LDKErrorMessage this_obj);
11791 * The channel ID involved in the error
11793 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
11796 * The channel ID involved in the error
11798 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11801 * A possibly human-readable error description.
11802 * The string should be sanitized before it is used (e.g. emitted to logs
11803 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
11804 * vulnerability in the terminal emulator or the logging subsystem.
11806 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
11809 * A possibly human-readable error description.
11810 * The string should be sanitized before it is used (e.g. emitted to logs
11811 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
11812 * vulnerability in the terminal emulator or the logging subsystem.
11814 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
11817 * Constructs a new ErrorMessage given each field
11819 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg);
11822 * Creates a copy of the ErrorMessage
11824 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
11827 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
11829 void Ping_free(struct LDKPing this_obj);
11832 * The desired response length
11834 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
11837 * The desired response length
11839 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
11842 * The ping packet size.
11843 * This field is not sent on the wire. byteslen zeros are sent.
11845 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
11848 * The ping packet size.
11849 * This field is not sent on the wire. byteslen zeros are sent.
11851 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
11854 * Constructs a new Ping given each field
11856 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
11859 * Creates a copy of the Ping
11861 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
11864 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
11866 void Pong_free(struct LDKPong this_obj);
11869 * The pong packet size.
11870 * This field is not sent on the wire. byteslen zeros are sent.
11872 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
11875 * The pong packet size.
11876 * This field is not sent on the wire. byteslen zeros are sent.
11878 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
11881 * Constructs a new Pong given each field
11883 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
11886 * Creates a copy of the Pong
11888 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
11891 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
11893 void OpenChannel_free(struct LDKOpenChannel this_obj);
11896 * The genesis hash of the blockchain where the channel is to be opened
11898 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
11901 * The genesis hash of the blockchain where the channel is to be opened
11903 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11906 * A temporary channel ID, until the funding outpoint is announced
11908 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
11911 * A temporary channel ID, until the funding outpoint is announced
11913 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11916 * The channel value
11918 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11921 * The channel value
11923 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11926 * The amount to push to the counterparty as part of the open, in milli-satoshi
11928 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11931 * The amount to push to the counterparty as part of the open, in milli-satoshi
11933 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11936 * The threshold below which outputs on transactions broadcast by sender will be omitted
11938 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11941 * The threshold below which outputs on transactions broadcast by sender will be omitted
11943 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11946 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
11948 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11951 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
11953 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11956 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
11958 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11961 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
11963 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11966 * The minimum HTLC size incoming to sender, in milli-satoshi
11968 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11971 * The minimum HTLC size incoming to sender, in milli-satoshi
11973 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11976 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
11978 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11981 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
11983 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
11986 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
11988 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11991 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
11993 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
11996 * The maximum number of inbound HTLCs towards sender
11998 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12001 * The maximum number of inbound HTLCs towards sender
12003 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
12006 * The sender's key controlling the funding transaction
12008 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12011 * The sender's key controlling the funding transaction
12013 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12016 * Used to derive a revocation key for transactions broadcast by counterparty
12018 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12021 * Used to derive a revocation key for transactions broadcast by counterparty
12023 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12026 * A payment key to sender for transactions broadcast by counterparty
12028 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12031 * A payment key to sender for transactions broadcast by counterparty
12033 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12036 * Used to derive a payment key to sender for transactions broadcast by sender
12038 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12041 * Used to derive a payment key to sender for transactions broadcast by sender
12043 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12046 * Used to derive an HTLC payment key to sender
12048 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12051 * Used to derive an HTLC payment key to sender
12053 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12056 * The first to-be-broadcast-by-sender transaction's per commitment point
12058 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12061 * The first to-be-broadcast-by-sender transaction's per commitment point
12063 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12068 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
12073 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
12076 * Creates a copy of the OpenChannel
12078 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
12081 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
12083 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
12086 * A temporary channel ID, until the funding outpoint is announced
12088 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
12091 * A temporary channel ID, until the funding outpoint is announced
12093 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12096 * The threshold below which outputs on transactions broadcast by sender will be omitted
12098 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12101 * The threshold below which outputs on transactions broadcast by sender will be omitted
12103 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
12106 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
12108 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12111 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
12113 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
12116 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
12118 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12121 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
12123 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
12126 * The minimum HTLC size incoming to sender, in milli-satoshi
12128 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12131 * The minimum HTLC size incoming to sender, in milli-satoshi
12133 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
12136 * Minimum depth of the funding transaction before the channel is considered open
12138 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12141 * Minimum depth of the funding transaction before the channel is considered open
12143 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
12146 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
12148 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12151 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
12153 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
12156 * The maximum number of inbound HTLCs towards sender
12158 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12161 * The maximum number of inbound HTLCs towards sender
12163 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
12166 * The sender's key controlling the funding transaction
12168 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12171 * The sender's key controlling the funding transaction
12173 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12176 * Used to derive a revocation key for transactions broadcast by counterparty
12178 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12181 * Used to derive a revocation key for transactions broadcast by counterparty
12183 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12186 * A payment key to sender for transactions broadcast by counterparty
12188 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12191 * A payment key to sender for transactions broadcast by counterparty
12193 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12196 * Used to derive a payment key to sender for transactions broadcast by sender
12198 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12201 * Used to derive a payment key to sender for transactions broadcast by sender
12203 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12206 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
12208 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12211 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
12213 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12216 * The first to-be-broadcast-by-sender transaction's per commitment point
12218 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12221 * The first to-be-broadcast-by-sender transaction's per commitment point
12223 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12226 * Creates a copy of the AcceptChannel
12228 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
12231 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
12233 void FundingCreated_free(struct LDKFundingCreated this_obj);
12236 * A temporary channel ID, until the funding is established
12238 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
12241 * A temporary channel ID, until the funding is established
12243 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12246 * The funding transaction ID
12248 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
12251 * The funding transaction ID
12253 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12256 * The specific output index funding this channel
12258 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
12261 * The specific output index funding this channel
12263 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
12266 * The signature of the channel initiator (funder) on the funding transaction
12268 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
12271 * The signature of the channel initiator (funder) on the funding transaction
12273 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
12276 * Constructs a new FundingCreated given each field
12278 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);
12281 * Creates a copy of the FundingCreated
12283 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
12286 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
12288 void FundingSigned_free(struct LDKFundingSigned this_obj);
12293 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
12298 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12301 * The signature of the channel acceptor (fundee) on the funding transaction
12303 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
12306 * The signature of the channel acceptor (fundee) on the funding transaction
12308 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
12311 * Constructs a new FundingSigned given each field
12313 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
12316 * Creates a copy of the FundingSigned
12318 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
12321 * Frees any resources used by the FundingLocked, if is_owned is set and inner is non-NULL.
12323 void FundingLocked_free(struct LDKFundingLocked this_obj);
12328 const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32];
12333 void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12336 * The per-commitment point of the second commitment transaction
12338 struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr);
12341 * The per-commitment point of the second commitment transaction
12343 void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12346 * Constructs a new FundingLocked given each field
12348 MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
12351 * Creates a copy of the FundingLocked
12353 struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
12356 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
12358 void Shutdown_free(struct LDKShutdown this_obj);
12363 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
12368 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12371 * The destination of this peer's funds on closing.
12372 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
12374 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
12377 * The destination of this peer's funds on closing.
12378 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
12380 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
12383 * Constructs a new Shutdown given each field
12385 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
12388 * Creates a copy of the Shutdown
12390 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
12393 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
12395 void ClosingSigned_free(struct LDKClosingSigned this_obj);
12400 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
12405 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12408 * The proposed total fee for the closing transaction
12410 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
12413 * The proposed total fee for the closing transaction
12415 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
12418 * A signature on the closing transaction
12420 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
12423 * A signature on the closing transaction
12425 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
12428 * Constructs a new ClosingSigned given each field
12430 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg);
12433 * Creates a copy of the ClosingSigned
12435 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
12438 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
12440 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
12445 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
12450 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12455 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
12460 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
12463 * The HTLC value in milli-satoshi
12465 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
12468 * The HTLC value in milli-satoshi
12470 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
12473 * The payment hash, the pre-image of which controls HTLC redemption
12475 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
12478 * The payment hash, the pre-image of which controls HTLC redemption
12480 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12483 * The expiry height of the HTLC
12485 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
12488 * The expiry height of the HTLC
12490 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
12493 * Creates a copy of the UpdateAddHTLC
12495 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
12498 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
12500 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
12505 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
12510 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12515 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
12520 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
12523 * The pre-image of the payment hash, allowing HTLC redemption
12525 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
12528 * The pre-image of the payment hash, allowing HTLC redemption
12530 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12533 * Constructs a new UpdateFulfillHTLC given each field
12535 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
12538 * Creates a copy of the UpdateFulfillHTLC
12540 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
12543 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
12545 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
12550 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
12555 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12560 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
12565 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
12568 * Creates a copy of the UpdateFailHTLC
12570 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
12573 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
12575 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
12580 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
12585 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12590 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
12595 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
12600 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
12605 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
12608 * Creates a copy of the UpdateFailMalformedHTLC
12610 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
12613 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
12615 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
12620 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
12625 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12628 * A signature on the commitment transaction
12630 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
12633 * A signature on the commitment transaction
12635 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
12638 * Signatures on the HTLC transactions
12640 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
12643 * Constructs a new CommitmentSigned given each field
12645 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
12648 * Creates a copy of the CommitmentSigned
12650 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
12653 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
12655 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
12660 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
12665 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12668 * The secret corresponding to the per-commitment point
12670 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
12673 * The secret corresponding to the per-commitment point
12675 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12678 * The next sender-broadcast commitment transaction's per-commitment point
12680 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
12683 * The next sender-broadcast commitment transaction's per-commitment point
12685 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12688 * Constructs a new RevokeAndACK given each field
12690 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);
12693 * Creates a copy of the RevokeAndACK
12695 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
12698 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
12700 void UpdateFee_free(struct LDKUpdateFee this_obj);
12705 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
12710 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12713 * Fee rate per 1000-weight of the transaction
12715 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
12718 * Fee rate per 1000-weight of the transaction
12720 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
12723 * Constructs a new UpdateFee given each field
12725 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
12728 * Creates a copy of the UpdateFee
12730 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
12733 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
12735 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
12738 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
12739 * belonging to the recipient
12741 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
12744 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
12745 * belonging to the recipient
12747 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12750 * The sender's per-commitment point for their current commitment transaction
12752 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
12755 * The sender's per-commitment point for their current commitment transaction
12757 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12760 * Constructs a new DataLossProtect given each field
12762 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
12765 * Creates a copy of the DataLossProtect
12767 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
12770 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
12772 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
12777 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
12782 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12785 * The next commitment number for the sender
12787 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
12790 * The next commitment number for the sender
12792 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
12795 * The next commitment number for the recipient
12797 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
12800 * The next commitment number for the recipient
12802 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
12805 * Creates a copy of the ChannelReestablish
12807 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
12810 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
12812 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
12817 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
12822 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12825 * The short channel ID
12827 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
12830 * The short channel ID
12832 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
12835 * A signature by the node key
12837 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
12840 * A signature by the node key
12842 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
12845 * A signature by the funding key
12847 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
12850 * A signature by the funding key
12852 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
12855 * Constructs a new AnnouncementSignatures given each field
12857 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);
12860 * Creates a copy of the AnnouncementSignatures
12862 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
12865 * Frees any resources used by the NetAddress
12867 void NetAddress_free(struct LDKNetAddress this_ptr);
12870 * Creates a copy of the NetAddress
12872 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
12875 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
12877 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
12880 * Read a Result from a byte array, created by Result_write
12882 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
12885 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
12887 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
12890 * The advertised features
12892 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
12895 * The advertised features
12897 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
12900 * A strictly monotonic announcement counter, with gaps allowed
12902 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
12905 * A strictly monotonic announcement counter, with gaps allowed
12907 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
12910 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
12913 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
12916 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
12919 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12922 * An RGB color for UI purposes
12924 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
12927 * An RGB color for UI purposes
12929 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
12932 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
12935 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
12938 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
12941 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12944 * List of addresses on which this node is reachable
12946 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
12949 * Creates a copy of the UnsignedNodeAnnouncement
12951 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
12954 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
12956 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
12959 * The signature by the node key
12961 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
12964 * The signature by the node key
12966 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
12969 * The actual content of the announcement
12971 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
12974 * The actual content of the announcement
12976 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
12979 * Constructs a new NodeAnnouncement given each field
12981 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
12984 * Creates a copy of the NodeAnnouncement
12986 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
12989 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
12991 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
12994 * The advertised channel features
12996 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
12999 * The advertised channel features
13001 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
13004 * The genesis hash of the blockchain where the channel is to be opened
13006 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
13009 * The genesis hash of the blockchain where the channel is to be opened
13011 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13014 * The short channel ID
13016 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
13019 * The short channel ID
13021 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
13024 * One of the two node_ids which are endpoints of this channel
13026 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
13029 * One of the two node_ids which are endpoints of this channel
13031 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13034 * The other of the two node_ids which are endpoints of this channel
13036 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
13039 * The other of the two node_ids which are endpoints of this channel
13041 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13044 * The funding key for the first node
13046 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
13049 * The funding key for the first node
13051 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13054 * The funding key for the second node
13056 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
13059 * The funding key for the second node
13061 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13064 * Creates a copy of the UnsignedChannelAnnouncement
13066 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
13069 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
13071 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
13074 * Authentication of the announcement by the first public node
13076 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
13079 * Authentication of the announcement by the first public node
13081 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
13084 * Authentication of the announcement by the second public node
13086 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
13089 * Authentication of the announcement by the second public node
13091 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
13094 * Proof of funding UTXO ownership by the first public node
13096 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
13099 * Proof of funding UTXO ownership by the first public node
13101 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
13104 * Proof of funding UTXO ownership by the second public node
13106 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
13109 * Proof of funding UTXO ownership by the second public node
13111 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
13114 * The actual announcement
13116 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
13119 * The actual announcement
13121 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
13124 * Constructs a new ChannelAnnouncement given each field
13126 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);
13129 * Creates a copy of the ChannelAnnouncement
13131 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
13134 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
13136 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
13139 * The genesis hash of the blockchain where the channel is to be opened
13141 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
13144 * The genesis hash of the blockchain where the channel is to be opened
13146 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13149 * The short channel ID
13151 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13154 * The short channel ID
13156 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
13159 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
13161 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13164 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
13166 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
13171 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13176 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
13179 * The number of blocks such that if:
13180 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
13181 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
13182 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
13183 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
13184 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
13185 * forwarding. Note that the HTLC sender is the one who originally sets this value when
13186 * constructing the route.
13188 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13191 * The number of blocks such that if:
13192 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
13193 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
13194 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
13195 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
13196 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
13197 * forwarding. Note that the HTLC sender is the one who originally sets this value when
13198 * constructing the route.
13200 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
13203 * The minimum HTLC size incoming to sender, in milli-satoshi
13205 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13208 * The minimum HTLC size incoming to sender, in milli-satoshi
13210 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
13213 * The base HTLC fee charged by sender, in milli-satoshi
13215 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13218 * The base HTLC fee charged by sender, in milli-satoshi
13220 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
13223 * The amount to fee multiplier, in micro-satoshi
13225 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13228 * The amount to fee multiplier, in micro-satoshi
13230 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
13233 * Creates a copy of the UnsignedChannelUpdate
13235 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
13238 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
13240 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
13243 * A signature of the channel update
13245 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
13248 * A signature of the channel update
13250 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
13253 * The actual channel update
13255 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
13258 * The actual channel update
13260 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
13263 * Constructs a new ChannelUpdate given each field
13265 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
13268 * Creates a copy of the ChannelUpdate
13270 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
13273 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
13275 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
13278 * The genesis hash of the blockchain being queried
13280 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
13283 * The genesis hash of the blockchain being queried
13285 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13288 * The height of the first block for the channel UTXOs being queried
13290 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
13293 * The height of the first block for the channel UTXOs being queried
13295 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
13298 * The number of blocks to include in the query results
13300 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
13303 * The number of blocks to include in the query results
13305 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
13308 * Constructs a new QueryChannelRange given each field
13310 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
13313 * Creates a copy of the QueryChannelRange
13315 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
13318 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
13320 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
13323 * The genesis hash of the blockchain being queried
13325 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
13328 * The genesis hash of the blockchain being queried
13330 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13333 * The height of the first block in the range of the reply
13335 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
13338 * The height of the first block in the range of the reply
13340 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
13343 * The number of blocks included in the range of the reply
13345 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
13348 * The number of blocks included in the range of the reply
13350 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
13353 * True when this is the final reply for a query
13355 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
13358 * True when this is the final reply for a query
13360 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
13363 * The short_channel_ids in the channel range
13365 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
13368 * Constructs a new ReplyChannelRange given each field
13370 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);
13373 * Creates a copy of the ReplyChannelRange
13375 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
13378 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
13380 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
13383 * The genesis hash of the blockchain being queried
13385 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
13388 * The genesis hash of the blockchain being queried
13390 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13393 * The short_channel_ids that are being queried
13395 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
13398 * Constructs a new QueryShortChannelIds given each field
13400 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
13403 * Creates a copy of the QueryShortChannelIds
13405 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
13408 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
13410 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
13413 * The genesis hash of the blockchain that was queried
13415 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
13418 * The genesis hash of the blockchain that was queried
13420 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13423 * Indicates if the query recipient maintains up-to-date channel
13424 * information for the chain_hash
13426 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
13429 * Indicates if the query recipient maintains up-to-date channel
13430 * information for the chain_hash
13432 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
13435 * Constructs a new ReplyShortChannelIdsEnd given each field
13437 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
13440 * Creates a copy of the ReplyShortChannelIdsEnd
13442 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
13445 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
13447 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
13450 * The genesis hash of the blockchain for channel and node information
13452 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
13455 * The genesis hash of the blockchain for channel and node information
13457 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13460 * The starting unix timestamp
13462 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
13465 * The starting unix timestamp
13467 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
13470 * The range of information in seconds
13472 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
13475 * The range of information in seconds
13477 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
13480 * Constructs a new GossipTimestampFilter given each field
13482 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
13485 * Creates a copy of the GossipTimestampFilter
13487 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
13490 * Frees any resources used by the ErrorAction
13492 void ErrorAction_free(struct LDKErrorAction this_ptr);
13495 * Creates a copy of the ErrorAction
13497 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
13500 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
13502 void LightningError_free(struct LDKLightningError this_obj);
13505 * A human-readable message describing the error
13507 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
13510 * A human-readable message describing the error
13512 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
13515 * The action which should be taken against the offending peer.
13517 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
13520 * The action which should be taken against the offending peer.
13522 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
13525 * Constructs a new LightningError given each field
13527 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKCVec_u8Z err_arg, struct LDKErrorAction action_arg);
13530 * Creates a copy of the LightningError
13532 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
13535 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
13537 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
13540 * update_add_htlc messages which should be sent
13542 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
13545 * update_fulfill_htlc messages which should be sent
13547 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
13550 * update_fail_htlc messages which should be sent
13552 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
13555 * update_fail_malformed_htlc messages which should be sent
13557 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
13560 * An update_fee message which should be sent
13562 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
13565 * An update_fee message which should be sent
13567 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
13570 * Finally, the commitment_signed message which should be sent
13572 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
13575 * Finally, the commitment_signed message which should be sent
13577 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
13580 * Constructs a new CommitmentUpdate given each field
13582 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);
13585 * Creates a copy of the CommitmentUpdate
13587 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
13590 * Frees any resources used by the HTLCFailChannelUpdate
13592 void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr);
13595 * Creates a copy of the HTLCFailChannelUpdate
13597 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig);
13600 * Calls the free function if one is set
13602 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
13605 * Calls the free function if one is set
13607 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
13610 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
13612 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
13615 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
13617 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
13620 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
13622 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
13625 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
13627 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
13630 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
13632 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
13635 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
13637 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
13640 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
13642 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
13645 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
13647 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
13650 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
13652 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
13655 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
13657 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
13660 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
13662 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
13665 * Read a FundingCreated from a byte array, created by FundingCreated_write
13667 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
13670 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
13672 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
13675 * Read a FundingSigned from a byte array, created by FundingSigned_write
13677 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
13680 * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
13682 struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
13685 * Read a FundingLocked from a byte array, created by FundingLocked_write
13687 struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
13690 * Serialize the Init object into a byte array which can be read by Init_read
13692 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
13695 * Read a Init from a byte array, created by Init_write
13697 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
13700 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
13702 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
13705 * Read a OpenChannel from a byte array, created by OpenChannel_write
13707 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
13710 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
13712 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
13715 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
13717 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
13720 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
13722 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
13725 * Read a Shutdown from a byte array, created by Shutdown_write
13727 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
13730 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
13732 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
13735 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
13737 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
13740 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
13742 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
13745 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
13747 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
13750 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
13752 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
13755 * Read a UpdateFee from a byte array, created by UpdateFee_write
13757 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
13760 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
13762 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
13765 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
13767 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
13770 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
13772 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
13775 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
13777 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
13780 * Serialize the Ping object into a byte array which can be read by Ping_read
13782 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
13785 * Read a Ping from a byte array, created by Ping_write
13787 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
13790 * Serialize the Pong object into a byte array which can be read by Pong_read
13792 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
13795 * Read a Pong from a byte array, created by Pong_write
13797 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
13800 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
13802 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
13805 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
13807 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
13810 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
13812 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
13815 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
13817 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
13820 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
13822 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
13825 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
13827 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
13830 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
13832 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
13835 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
13837 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
13840 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
13842 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
13845 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
13847 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
13850 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
13852 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
13855 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
13857 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
13860 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
13862 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
13865 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
13867 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
13870 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
13872 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
13875 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
13877 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
13880 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
13882 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
13885 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
13887 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
13890 *\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
13892 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
13895 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
13897 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
13900 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
13902 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
13905 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
13907 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
13910 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
13912 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
13915 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
13917 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
13920 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
13922 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
13925 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
13927 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
13930 * Constructs a new IgnoringMessageHandler given each field
13932 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
13935 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
13936 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
13938 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
13941 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
13942 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
13944 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
13947 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
13949 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
13952 * Constructs a new ErroringMessageHandler
13954 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
13957 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
13958 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
13960 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
13963 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
13964 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
13966 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
13969 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
13971 void MessageHandler_free(struct LDKMessageHandler this_obj);
13974 * A message handler which handles messages specific to channels. Usually this is just a
13975 * ChannelManager object or a ErroringMessageHandler.
13977 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
13980 * A message handler which handles messages specific to channels. Usually this is just a
13981 * ChannelManager object or a ErroringMessageHandler.
13983 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
13986 * A message handler which handles messages updating our knowledge of the network channel
13987 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
13989 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
13992 * A message handler which handles messages updating our knowledge of the network channel
13993 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
13995 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
13998 * Constructs a new MessageHandler given each field
14000 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
14003 * Creates a copy of a SocketDescriptor
14005 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
14008 * Calls the free function if one is set
14010 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
14013 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
14015 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
14018 * Used to indicate that we probably can't make any future connections to this peer, implying
14019 * we should go ahead and force-close any channels we have with it.
14021 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
14024 * Used to indicate that we probably can't make any future connections to this peer, implying
14025 * we should go ahead and force-close any channels we have with it.
14027 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
14030 * Constructs a new PeerHandleError given each field
14032 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
14035 * Creates a copy of the PeerHandleError
14037 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
14040 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
14042 void PeerManager_free(struct LDKPeerManager this_obj);
14045 * Constructs a new PeerManager with the given message handlers and node_id secret key
14046 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
14047 * cryptographically secure random bytes.
14049 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);
14052 * Get the list of node ids for peers which have completed the initial handshake.
14054 * For outbound connections, this will be the same as the their_node_id parameter passed in to
14055 * new_outbound_connection, however entries will only appear once the initial handshake has
14056 * completed and we are sure the remote peer has the private key for the given node_id.
14058 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
14061 * Indicates a new outbound connection has been established to a node with the given node_id.
14062 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
14063 * descriptor but must disconnect the connection immediately.
14065 * Returns a small number of bytes to send to the remote node (currently always 50).
14067 * Panics if descriptor is duplicative with some other descriptor which has not yet had a
14068 * socket_disconnected().
14070 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);
14073 * Indicates a new inbound connection has been established.
14075 * May refuse the connection by returning an Err, but will never write bytes to the remote end
14076 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
14077 * call socket_disconnected for the new descriptor but must disconnect the connection
14080 * Panics if descriptor is duplicative with some other descriptor which has not yet had
14081 * socket_disconnected called.
14083 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor);
14086 * Indicates that there is room to write data to the given socket descriptor.
14088 * May return an Err to indicate that the connection should be closed.
14090 * Will most likely call send_data on the descriptor passed in (or the descriptor handed into
14091 * new_*\\_connection) before returning. Thus, be very careful with reentrancy issues! The
14092 * invariants around calling write_buffer_space_avail in case a write did not fully complete
14093 * must still hold - be ready to call write_buffer_space_avail again if a write call generated
14094 * here isn't sufficient! Panics if the descriptor was not previously registered in a
14095 * new_\\*_connection event.
14097 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
14100 * Indicates that data was read from the given socket descriptor.
14102 * May return an Err to indicate that the connection should be closed.
14104 * Will *not* call back into send_data on any descriptors to avoid reentrancy complexity.
14105 * Thus, however, you almost certainly want to call process_events() after any read_event to
14106 * generate send_data calls to handle responses.
14108 * If Ok(true) is returned, further read_events should not be triggered until a send_data call
14109 * on this file descriptor has resume_read set (preventing DoS issues in the send buffer).
14111 * Panics if the descriptor was not previously registered in a new_*_connection event.
14113 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);
14116 * Checks for any events generated by our handlers and processes them. Includes sending most
14117 * response messages as well as messages generated by calls to handler functions directly (eg
14118 * functions like ChannelManager::process_pending_htlc_forward or send_payment).
14120 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
14123 * Indicates that the given socket descriptor's connection is now closed.
14125 * This must only be called if the socket has been disconnected by the peer or your own
14126 * decision to disconnect it and must NOT be called in any case where other parts of this
14127 * library (eg PeerHandleError, explicit disconnect_socket calls) instruct you to disconnect
14130 * Panics if the descriptor was not previously registered in a successful new_*_connection event.
14132 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
14135 * Disconnect a peer given its node id.
14137 * Set no_connection_possible to true to prevent any further connection with this peer,
14138 * force-closing any channels we have with it.
14140 * If a peer is connected, this will call `disconnect_socket` on the descriptor for the peer,
14141 * so be careful about reentrancy issues.
14143 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
14146 * This function should be called roughly once every 30 seconds.
14147 * It will send pings to each peer and disconnect those which did not respond to the last round of pings.
14148 * Will most likely call send_data on all of the registered descriptors, thus, be very careful with reentrancy issues!
14150 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
14153 * Build the commitment secret from the seed and the commitment number
14155 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
14158 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
14159 * from the base secret and the per_commitment_point.
14161 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
14162 * generated (ie our own).
14164 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
14167 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
14168 * from the base point and the per_commitment_key. This is the public equivalent of
14169 * derive_private_key - using only public keys to derive a public key instead of private keys.
14171 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
14172 * generated (ie our own).
14174 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
14177 * Derives a per-commitment-transaction revocation key from its constituent parts.
14179 * Only the cheating participant owns a valid witness to propagate a revoked
14180 * commitment transaction, thus per_commitment_secret always come from cheater
14181 * and revocation_base_secret always come from punisher, which is the broadcaster
14182 * of the transaction spending with this key knowledge.
14184 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
14185 * generated (ie our own).
14187 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
14190 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
14191 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
14192 * public key instead of private keys.
14194 * Only the cheating participant owns a valid witness to propagate a revoked
14195 * commitment transaction, thus per_commitment_point always come from cheater
14196 * and revocation_base_point always come from punisher, which is the broadcaster
14197 * of the transaction spending with this key knowledge.
14199 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
14200 * generated (ie our own).
14202 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
14205 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
14207 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
14210 * The broadcaster's per-commitment public key which was used to derive the other keys.
14212 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
14215 * The broadcaster's per-commitment public key which was used to derive the other keys.
14217 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14220 * The revocation key which is used to allow the broadcaster of the commitment
14221 * transaction to provide their counterparty the ability to punish them if they broadcast
14224 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
14227 * The revocation key which is used to allow the broadcaster of the commitment
14228 * transaction to provide their counterparty the ability to punish them if they broadcast
14231 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14234 * Broadcaster's HTLC Key
14236 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
14239 * Broadcaster's HTLC Key
14241 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14244 * Countersignatory's HTLC Key
14246 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
14249 * Countersignatory's HTLC Key
14251 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14254 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
14256 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
14259 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
14261 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14264 * Constructs a new TxCreationKeys given each field
14266 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);
14269 * Creates a copy of the TxCreationKeys
14271 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
14274 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
14276 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
14279 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
14281 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
14284 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
14286 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
14289 * The public key which is used to sign all commitment transactions, as it appears in the
14290 * on-chain channel lock-in 2-of-2 multisig output.
14292 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
14295 * The public key which is used to sign all commitment transactions, as it appears in the
14296 * on-chain channel lock-in 2-of-2 multisig output.
14298 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14301 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
14302 * revocation keys. This is combined with the per-commitment-secret generated by the
14303 * counterparty to create a secret which the counterparty can reveal to revoke previous
14306 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
14309 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
14310 * revocation keys. This is combined with the per-commitment-secret generated by the
14311 * counterparty to create a secret which the counterparty can reveal to revoke previous
14314 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14317 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
14318 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
14319 * static across every commitment transaction.
14321 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
14324 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
14325 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
14326 * static across every commitment transaction.
14328 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14331 * The base point which is used (with derive_public_key) to derive a per-commitment payment
14332 * public key which receives non-HTLC-encumbered funds which are only available for spending
14333 * after some delay (or can be claimed via the revocation path).
14335 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
14338 * The base point which is used (with derive_public_key) to derive a per-commitment payment
14339 * public key which receives non-HTLC-encumbered funds which are only available for spending
14340 * after some delay (or can be claimed via the revocation path).
14342 void ChannelPublicKeys_set_delayed_payment_basepoint(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 public key
14346 * which is used to encumber HTLC-in-flight outputs.
14348 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
14351 * The base point which is used (with derive_public_key) to derive a per-commitment public key
14352 * which is used to encumber HTLC-in-flight outputs.
14354 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14357 * Constructs a new ChannelPublicKeys given each field
14359 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);
14362 * Creates a copy of the ChannelPublicKeys
14364 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
14367 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
14369 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
14372 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
14374 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
14377 * Create per-state keys from channel base points and the per-commitment point.
14378 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
14380 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);
14383 * Generate per-state keys from channel static keys.
14384 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
14386 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);
14389 * A script either spendable by the revocation
14390 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
14391 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
14393 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
14396 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
14398 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
14401 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
14402 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
14403 * need to compare this value to whether the commitment transaction in question is that of
14404 * the counterparty or our own.
14406 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
14409 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
14410 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
14411 * need to compare this value to whether the commitment transaction in question is that of
14412 * the counterparty or our own.
14414 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
14417 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
14418 * this divided by 1000.
14420 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
14423 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
14424 * this divided by 1000.
14426 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
14429 * The CLTV lock-time at which this HTLC expires.
14431 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
14434 * The CLTV lock-time at which this HTLC expires.
14436 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
14439 * The hash of the preimage which unlocks this HTLC.
14441 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
14444 * The hash of the preimage which unlocks this HTLC.
14446 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14449 * The position within the commitment transactions' outputs. This may be None if the value is
14450 * below the dust limit (in which case no output appears in the commitment transaction and the
14451 * value is spent to additional transaction fees).
14453 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
14456 * The position within the commitment transactions' outputs. This may be None if the value is
14457 * below the dust limit (in which case no output appears in the commitment transaction and the
14458 * value is spent to additional transaction fees).
14460 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
14463 * Constructs a new HTLCOutputInCommitment given each field
14465 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);
14468 * Creates a copy of the HTLCOutputInCommitment
14470 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
14473 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
14475 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
14478 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
14480 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
14483 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
14484 * does not need to have its previous_output_index filled.
14486 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys);
14489 * Gets the redeemscript for a funding output from the two funding public keys.
14490 * Note that the order of funding public keys does not matter.
14492 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
14495 * panics if htlc.transaction_output_index.is_none()!
14497 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);
14500 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
14502 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
14505 * Holder public keys
14507 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14510 * Holder public keys
14512 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
14515 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
14517 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14520 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
14522 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
14525 * Whether the holder is the initiator of this channel.
14526 * This is an input to the commitment number obscure factor computation.
14528 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14531 * Whether the holder is the initiator of this channel.
14532 * This is an input to the commitment number obscure factor computation.
14534 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
14537 * The late-bound counterparty channel transaction parameters.
14538 * These parameters are populated at the point in the protocol where the counterparty provides them.
14540 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14543 * The late-bound counterparty channel transaction parameters.
14544 * These parameters are populated at the point in the protocol where the counterparty provides them.
14546 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
14549 * The late-bound funding outpoint
14551 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14554 * The late-bound funding outpoint
14556 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
14559 * Constructs a new ChannelTransactionParameters given each field
14561 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);
14564 * Creates a copy of the ChannelTransactionParameters
14566 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
14569 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
14571 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
14574 * Counter-party public keys
14576 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
14579 * Counter-party public keys
14581 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
14584 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
14586 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
14589 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
14591 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
14594 * Constructs a new CounterpartyChannelTransactionParameters given each field
14596 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
14599 * Creates a copy of the CounterpartyChannelTransactionParameters
14601 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
14604 * Whether the late bound parameters are populated.
14606 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
14609 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
14610 * given that the holder is the broadcaster.
14612 * self.is_populated() must be true before calling this function.
14614 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
14617 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
14618 * given that the counterparty is the broadcaster.
14620 * self.is_populated() must be true before calling this function.
14622 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
14625 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
14627 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
14630 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
14632 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
14635 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
14637 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
14640 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
14642 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
14645 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
14647 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
14650 * Get the channel pubkeys for the broadcaster
14652 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14655 * Get the channel pubkeys for the countersignatory
14657 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14660 * Get the contest delay applicable to the transactions.
14661 * Note that the contest delay was selected by the countersignatory.
14663 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14666 * Whether the channel is outbound from the broadcaster.
14668 * The boolean representing the side that initiated the channel is
14669 * an input to the commitment number obscure factor computation.
14671 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14674 * The funding outpoint
14676 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14679 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
14681 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
14684 * Our counterparty's signature for the transaction
14686 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
14689 * Our counterparty's signature for the transaction
14691 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
14694 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
14696 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
14699 * Creates a copy of the HolderCommitmentTransaction
14701 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
14704 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
14706 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
14709 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
14711 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
14714 * Create a new holder transaction with the given counterparty signatures.
14715 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
14717 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);
14720 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
14722 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
14725 * The commitment transaction
14727 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
14730 * The commitment transaction
14732 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
14735 * The txid for the commitment transaction.
14737 * This is provided as a performance optimization, instead of calling transaction.txid()
14740 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
14743 * The txid for the commitment transaction.
14745 * This is provided as a performance optimization, instead of calling transaction.txid()
14748 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14751 * Constructs a new BuiltCommitmentTransaction given each field
14753 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
14756 * Creates a copy of the BuiltCommitmentTransaction
14758 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
14761 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
14763 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
14766 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
14768 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
14771 * Get the SIGHASH_ALL sighash value of the transaction.
14773 * This can be used to verify a signature.
14775 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);
14778 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
14779 * because we are about to broadcast a holder transaction.
14781 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);
14784 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
14786 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
14789 * Creates a copy of the CommitmentTransaction
14791 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
14794 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
14796 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
14799 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
14801 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
14804 * The backwards-counting commitment number
14806 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14809 * The value to be sent to the broadcaster
14811 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14814 * The value to be sent to the counterparty
14816 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14819 * The feerate paid per 1000-weight-unit in this commitment transaction.
14821 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14824 * Trust our pre-built transaction and derived transaction creation public keys.
14826 * Applies a wrapper which allows access to these fields.
14828 * This should only be used if you fully trust the builder of this object. It should not
14829 *\tbe used by an external signer - instead use the verify function.
14831 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14834 * Verify our pre-built transaction and derived transaction creation public keys.
14836 * Applies a wrapper which allows access to these fields.
14838 * An external validating signer must call this method before signing
14839 * or using the built transaction.
14841 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);
14844 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
14846 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
14849 * The transaction ID of the built Bitcoin transaction
14851 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
14854 * The pre-built Bitcoin commitment transaction
14856 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
14859 * The pre-calculated transaction creation public keys.
14861 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
14864 * Get a signature for each HTLC which was included in the commitment transaction (ie for
14865 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
14867 * The returned Vec has one entry for each HTLC, and in the same order.
14869 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);
14872 * Get the transaction number obscure factor
14874 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
14877 * Creates a copy of the InitFeatures
14879 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
14882 * Creates a copy of the NodeFeatures
14884 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
14887 * Creates a copy of the ChannelFeatures
14889 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
14892 * Creates a copy of the InvoiceFeatures
14894 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
14897 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
14899 void InitFeatures_free(struct LDKInitFeatures this_obj);
14902 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
14904 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
14907 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
14909 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
14912 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
14914 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
14917 * Create a blank Features with no features set
14919 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
14922 * Creates a Features with the bits set which are known by the implementation
14924 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
14927 * Create a blank Features with no features set
14929 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
14932 * Creates a Features with the bits set which are known by the implementation
14934 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
14937 * Create a blank Features with no features set
14939 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
14942 * Creates a Features with the bits set which are known by the implementation
14944 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
14947 * Create a blank Features with no features set
14949 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
14952 * Creates a Features with the bits set which are known by the implementation
14954 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
14957 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
14959 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
14962 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
14964 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
14967 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
14969 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
14972 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
14974 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
14977 * Read a InitFeatures from a byte array, created by InitFeatures_write
14979 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
14982 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
14984 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
14987 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
14989 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
14992 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
14994 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
14997 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
14999 void RouteHop_free(struct LDKRouteHop this_obj);
15002 * The node_id of the node at this hop.
15004 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
15007 * The node_id of the node at this hop.
15009 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15012 * The node_announcement features of the node at this hop. For the last hop, these may be
15013 * amended to match the features present in the invoice this node generated.
15015 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
15018 * The node_announcement features of the node at this hop. For the last hop, these may be
15019 * amended to match the features present in the invoice this node generated.
15021 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
15024 * The channel that should be used from the previous hop to reach this node.
15026 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
15029 * The channel that should be used from the previous hop to reach this node.
15031 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
15034 * The channel_announcement features of the channel that should be used from the previous hop
15035 * to reach this node.
15037 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
15040 * The channel_announcement features of the channel that should be used from the previous hop
15041 * to reach this node.
15043 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
15046 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
15047 * For the last hop, this should be the full value of the payment (might be more than
15048 * requested if we had to match htlc_minimum_msat).
15050 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
15053 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
15054 * For the last hop, this should be the full value of the payment (might be more than
15055 * requested if we had to match htlc_minimum_msat).
15057 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
15060 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
15061 * expected at the destination, in excess of the current block height.
15063 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
15066 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
15067 * expected at the destination, in excess of the current block height.
15069 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
15072 * Constructs a new RouteHop given each field
15074 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);
15077 * Creates a copy of the RouteHop
15079 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
15082 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
15084 void Route_free(struct LDKRoute this_obj);
15087 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
15088 * last RouteHop in each path must be the same.
15089 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
15090 * destination. Thus, this must always be at least length one. While the maximum length of any
15091 * given path is variable, keeping the length of any path to less than 20 should currently
15092 * ensure it is viable.
15094 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
15097 * Constructs a new Route given each field
15099 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
15102 * Creates a copy of the Route
15104 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
15107 * Serialize the Route object into a byte array which can be read by Route_read
15109 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
15112 * Read a Route from a byte array, created by Route_write
15114 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
15117 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
15119 void RouteHint_free(struct LDKRouteHint this_obj);
15122 * The node_id of the non-target end of the route
15124 struct LDKPublicKey RouteHint_get_src_node_id(const struct LDKRouteHint *NONNULL_PTR this_ptr);
15127 * The node_id of the non-target end of the route
15129 void RouteHint_set_src_node_id(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15132 * The short_channel_id of this channel
15134 uint64_t RouteHint_get_short_channel_id(const struct LDKRouteHint *NONNULL_PTR this_ptr);
15137 * The short_channel_id of this channel
15139 void RouteHint_set_short_channel_id(struct LDKRouteHint *NONNULL_PTR this_ptr, uint64_t val);
15142 * The fees which must be paid to use this channel
15144 struct LDKRoutingFees RouteHint_get_fees(const struct LDKRouteHint *NONNULL_PTR this_ptr);
15147 * The fees which must be paid to use this channel
15149 void RouteHint_set_fees(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
15152 * The difference in CLTV values between this node and the next node.
15154 uint16_t RouteHint_get_cltv_expiry_delta(const struct LDKRouteHint *NONNULL_PTR this_ptr);
15157 * The difference in CLTV values between this node and the next node.
15159 void RouteHint_set_cltv_expiry_delta(struct LDKRouteHint *NONNULL_PTR this_ptr, uint16_t val);
15162 * The minimum value, in msat, which must be relayed to the next hop.
15164 struct LDKCOption_u64Z RouteHint_get_htlc_minimum_msat(const struct LDKRouteHint *NONNULL_PTR this_ptr);
15167 * The minimum value, in msat, which must be relayed to the next hop.
15169 void RouteHint_set_htlc_minimum_msat(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
15172 * The maximum value in msat available for routing with a single HTLC.
15174 struct LDKCOption_u64Z RouteHint_get_htlc_maximum_msat(const struct LDKRouteHint *NONNULL_PTR this_ptr);
15177 * The maximum value in msat available for routing with a single HTLC.
15179 void RouteHint_set_htlc_maximum_msat(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
15182 * Constructs a new RouteHint given each field
15184 MUST_USE_RES struct LDKRouteHint RouteHint_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);
15187 * Creates a copy of the RouteHint
15189 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
15192 * Gets a route from us (payer) to the given target node (payee).
15194 * If the payee provided features in their invoice, they should be provided via payee_features.
15195 * Without this, MPP will only be used if the payee's features are available in the network graph.
15197 * Extra routing hops between known nodes and the target will be used if they are included in
15200 * If some channels aren't announced, it may be useful to fill in a first_hops with the
15201 * results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
15202 * view of our local channels (from net_graph_msg_handler) will be ignored, and only those
15203 * in first_hops will be used.
15205 * Panics if first_hops contains channels without short_channel_ids
15206 * (ChannelManager::list_usable_channels will never include such channels).
15208 * The fees on channels from us to next-hops are ignored (as they are assumed to all be
15209 * equal), however the enabled/disabled bit on such channels as well as the
15210 * htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
15212 struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKInvoiceFeatures payee_features, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
15215 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
15217 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
15220 * Creates a copy of the NetworkGraph
15222 struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
15225 * Frees any resources used by the LockedNetworkGraph, if is_owned is set and inner is non-NULL.
15227 void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj);
15230 * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
15232 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
15235 * Creates a new tracker of the actual state of the network of channels and nodes,
15236 * assuming a fresh network graph.
15237 * Chain monitor is used to make sure announced channels exist on-chain,
15238 * channel data is correct, and that the announcement is signed with
15239 * channel owners' keys.
15241 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger);
15244 * Creates a new tracker of the actual state of the network of channels and nodes,
15245 * assuming an existing Network Graph.
15247 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph);
15250 * Adds a provider used to check new announcements. Does not affect
15251 * existing announcements unless they are updated.
15252 * Add, update or remove the provider would replace the current one.
15254 void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKAccess *chain_access);
15257 * Take a read lock on the network_graph and return it in the C-bindings
15258 * newtype helper. This is likely only useful when called via the C
15259 * bindings as you can call `self.network_graph.read().unwrap()` in Rust
15262 MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
15265 * Get a reference to the NetworkGraph which this read-lock contains.
15267 MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg);
15270 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
15271 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
15273 struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
15276 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
15277 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
15279 struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
15282 * Frees any resources used by the DirectionalChannelInfo, if is_owned is set and inner is non-NULL.
15284 void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_obj);
15287 * When the last update to the channel direction was issued.
15288 * Value is opaque, as set in the announcement.
15290 uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15293 * When the last update to the channel direction was issued.
15294 * Value is opaque, as set in the announcement.
15296 void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val);
15299 * Whether the channel can be currently used for payments (in this one direction).
15301 bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15304 * Whether the channel can be currently used for payments (in this one direction).
15306 void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, bool val);
15309 * The difference in CLTV values that you must have when routing through this channel.
15311 uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15314 * The difference in CLTV values that you must have when routing through this channel.
15316 void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint16_t val);
15319 * The minimum value, which must be relayed to the next hop via the channel
15321 uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15324 * The minimum value, which must be relayed to the next hop via the channel
15326 void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val);
15329 * The maximum value which may be relayed to the next hop via the channel.
15331 struct LDKCOption_u64Z DirectionalChannelInfo_get_htlc_maximum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15334 * The maximum value which may be relayed to the next hop via the channel.
15336 void DirectionalChannelInfo_set_htlc_maximum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
15339 * Fees charged when the channel is used for routing
15341 struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15344 * Fees charged when the channel is used for routing
15346 void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
15349 * Most recent update for the channel received from the network
15350 * Mostly redundant with the data we store in fields explicitly.
15351 * Everything else is useful only for sending out for initial routing sync.
15352 * Not stored if contains excess data to prevent DoS.
15354 struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15357 * Most recent update for the channel received from the network
15358 * Mostly redundant with the data we store in fields explicitly.
15359 * Everything else is useful only for sending out for initial routing sync.
15360 * Not stored if contains excess data to prevent DoS.
15362 void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
15365 * Constructs a new DirectionalChannelInfo given each field
15367 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);
15370 * Creates a copy of the DirectionalChannelInfo
15372 struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig);
15375 * Serialize the DirectionalChannelInfo object into a byte array which can be read by DirectionalChannelInfo_read
15377 struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj);
15380 * Read a DirectionalChannelInfo from a byte array, created by DirectionalChannelInfo_write
15382 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser);
15385 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
15387 void ChannelInfo_free(struct LDKChannelInfo this_obj);
15390 * Protocol features of a channel communicated during its announcement
15392 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15395 * Protocol features of a channel communicated during its announcement
15397 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
15400 * Source node of the first direction of a channel
15402 struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15405 * Source node of the first direction of a channel
15407 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15410 * Details about the first direction of a channel
15412 struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15415 * Details about the first direction of a channel
15417 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
15420 * Source node of the second direction of a channel
15422 struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15425 * Source node of the second direction of a channel
15427 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15430 * Details about the second direction of a channel
15432 struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15435 * Details about the second direction of a channel
15437 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
15440 * The channel capacity as seen on-chain, if chain lookup is available.
15442 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15445 * The channel capacity as seen on-chain, if chain lookup is available.
15447 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
15450 * An initial announcement of the channel
15451 * Mostly redundant with the data we store in fields explicitly.
15452 * Everything else is useful only for sending out for initial routing sync.
15453 * Not stored if contains excess data to prevent DoS.
15455 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15458 * An initial announcement of the channel
15459 * Mostly redundant with the data we store in fields explicitly.
15460 * Everything else is useful only for sending out for initial routing sync.
15461 * Not stored if contains excess data to prevent DoS.
15463 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
15466 * Constructs a new ChannelInfo given each field
15468 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);
15471 * Creates a copy of the ChannelInfo
15473 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
15476 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
15478 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
15481 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
15483 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
15486 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
15488 void RoutingFees_free(struct LDKRoutingFees this_obj);
15491 * Flat routing fee in satoshis
15493 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
15496 * Flat routing fee in satoshis
15498 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
15501 * Liquidity-based routing fee in millionths of a routed amount.
15502 * In other words, 10000 is 1%.
15504 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
15507 * Liquidity-based routing fee in millionths of a routed amount.
15508 * In other words, 10000 is 1%.
15510 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
15513 * Constructs a new RoutingFees given each field
15515 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
15518 * Creates a copy of the RoutingFees
15520 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
15523 * Read a RoutingFees from a byte array, created by RoutingFees_write
15525 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
15528 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
15530 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
15533 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
15535 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
15538 * Protocol features the node announced support for
15540 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
15543 * Protocol features the node announced support for
15545 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
15548 * When the last known update to the node state was issued.
15549 * Value is opaque, as set in the announcement.
15551 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
15554 * When the last known update to the node state was issued.
15555 * Value is opaque, as set in the announcement.
15557 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
15560 * Color assigned to the node
15562 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
15565 * Color assigned to the node
15567 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
15570 * Moniker assigned to the node.
15571 * May be invalid or malicious (eg control chars),
15572 * should not be exposed to the user.
15574 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
15577 * Moniker assigned to the node.
15578 * May be invalid or malicious (eg control chars),
15579 * should not be exposed to the user.
15581 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15584 * Internet-level addresses via which one can connect to the node
15586 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
15589 * An initial announcement of the node
15590 * Mostly redundant with the data we store in fields explicitly.
15591 * Everything else is useful only for sending out for initial routing sync.
15592 * Not stored if contains excess data to prevent DoS.
15594 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
15597 * An initial announcement of the node
15598 * Mostly redundant with the data we store in fields explicitly.
15599 * Everything else is useful only for sending out for initial routing sync.
15600 * Not stored if contains excess data to prevent DoS.
15602 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
15605 * Constructs a new NodeAnnouncementInfo given each field
15607 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);
15610 * Creates a copy of the NodeAnnouncementInfo
15612 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
15615 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
15617 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
15620 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
15622 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
15625 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
15627 void NodeInfo_free(struct LDKNodeInfo this_obj);
15630 * All valid channels a node has announced
15632 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
15635 * Lowest fees enabling routing via any of the enabled, known channels to a node.
15636 * The two fields (flat and proportional fee) are independent,
15637 * meaning they don't have to refer to the same channel.
15639 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
15642 * Lowest fees enabling routing via any of the enabled, known channels to a node.
15643 * The two fields (flat and proportional fee) are independent,
15644 * meaning they don't have to refer to the same channel.
15646 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
15649 * More information about a node from node_announcement.
15650 * Optional because we store a Node entry after learning about it from
15651 * a channel announcement, but before receiving a node announcement.
15653 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
15656 * More information about a node from node_announcement.
15657 * Optional because we store a Node entry after learning about it from
15658 * a channel announcement, but before receiving a node announcement.
15660 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
15663 * Constructs a new NodeInfo given each field
15665 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
15668 * Creates a copy of the NodeInfo
15670 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
15673 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
15675 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
15678 * Read a NodeInfo from a byte array, created by NodeInfo_write
15680 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
15683 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
15685 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
15688 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
15690 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
15693 * Creates a new, empty, network graph.
15695 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
15698 * For an already known node (from channel announcements), update its stored properties from a
15699 * given node announcement.
15701 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
15702 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
15703 * routing messages from a source using a protocol other than the lightning P2P protocol.
15705 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
15708 * For an already known node (from channel announcements), update its stored properties from a
15709 * given node announcement without verifying the associated signatures. Because we aren't
15710 * given the associated signatures here we cannot relay the node announcement to any of our
15713 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
15716 * Store or update channel info from a channel announcement.
15718 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
15719 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
15720 * routing messages from a source using a protocol other than the lightning P2P protocol.
15722 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
15723 * the corresponding UTXO exists on chain and is correctly-formatted.
15725 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);
15728 * Store or update channel info from a channel announcement without verifying the associated
15729 * signatures. Because we aren't given the associated signatures here we cannot relay the
15730 * channel announcement to any of our peers.
15732 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
15733 * the corresponding UTXO exists on chain and is correctly-formatted.
15735 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);
15738 * Close a channel if a corresponding HTLC fail was sent.
15739 * If permanent, removes a channel from the local storage.
15740 * May cause the removal of nodes too, if this was their last channel.
15741 * If not permanent, makes channels unavailable for routing.
15743 void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
15746 * For an already known (from announcement) channel, update info about one of the directions
15749 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
15750 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
15751 * routing messages from a source using a protocol other than the lightning P2P protocol.
15753 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
15756 * For an already known (from announcement) channel, update info about one of the directions
15757 * of the channel without verifying the associated signatures. Because we aren't given the
15758 * associated signatures here we cannot relay the channel update to any of our peers.
15760 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
15763 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
15765 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
15768 * Initialize a new FilesystemPersister and set the path to the individual channels'
15771 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKCVec_u8Z path_to_channel_data);
15774 * Get the directory which was provided when this persister was initialized.
15776 MUST_USE_RES struct LDKCVec_u8Z FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
15779 * Writes the provided `ChannelManager` to the path provided at `FilesystemPersister`
15780 * initialization, within a file called \"manager\".
15782 MUST_USE_RES struct LDKCResult_NoneErrorZ FilesystemPersister_persist_manager(struct LDKCVec_u8Z data_dir, const struct LDKChannelManager *NONNULL_PTR manager);
15785 * Read `ChannelMonitor`s from disk.
15787 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
15790 * Constructs a new Persist which calls the relevant methods on this_arg.
15791 * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
15793 struct LDKPersist FilesystemPersister_as_Persist(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
15795 /* Text to put at the end of the generated file */