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 * An enum representing the available verbosity levels of the logger.
126 typedef enum LDKLevel {
128 *Designates logger being silent
132 * Designates very serious errors
136 * Designates hazardous situations
140 * Designates useful information
144 * Designates lower priority information
148 * Designates very low priority, often extremely verbose, information
152 * Must be last for serialization purposes
158 * An enum representing the possible Bitcoin or test networks which we can run on
160 typedef enum LDKNetwork {
162 * The main Bitcoin blockchain.
166 * The testnet3 blockchain.
170 * A local test blockchain.
174 * A blockchain on which blocks are signed instead of mined.
178 * Must be last for serialization purposes
184 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
186 typedef enum LDKSecp256k1Error {
188 * Signature failed verification
190 LDKSecp256k1Error_IncorrectSignature,
192 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
194 LDKSecp256k1Error_InvalidMessage,
198 LDKSecp256k1Error_InvalidPublicKey,
202 LDKSecp256k1Error_InvalidSignature,
206 LDKSecp256k1Error_InvalidSecretKey,
210 LDKSecp256k1Error_InvalidRecoveryId,
212 * Invalid tweak for add_assign or mul_assign
214 LDKSecp256k1Error_InvalidTweak,
216 * tweak_add_check failed on an xonly public key
218 LDKSecp256k1Error_TweakCheckFailed,
220 * Didn't pass enough memory to context creation with preallocated memory
222 LDKSecp256k1Error_NotEnoughMemory,
224 * Must be last for serialization purposes
226 LDKSecp256k1Error_Sentinel,
230 * A serialized transaction, in (pointer, length) form.
232 * This type optionally owns its own memory, and thus the semantics around access change based on
233 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
234 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
235 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
236 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
237 * you would be invalid.
239 * Note that, while it may change in the future, because transactions on the Rust side are stored
240 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
241 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
242 * `data_is_owned` either set or unset at your discretion.
244 typedef struct LDKTransaction {
246 * The serialized transaction data.
248 * This is non-const for your convenience, an object passed to Rust is never written to.
252 * The length of the serialized transaction
256 * Whether the data pointed to by `data` should be freed or not.
262 * A dynamically-allocated array of u8s of arbitrary size.
263 * This corresponds to std::vector in C++
265 typedef struct LDKCVec_u8Z {
267 * The elements in the array.
268 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
272 * The number of elements pointed to by `data`.
278 * A transaction output including a scriptPubKey and value.
279 * This type *does* own its own memory, so must be free'd appropriately.
281 typedef struct LDKTxOut {
283 * The script_pubkey in this output
285 struct LDKCVec_u8Z script_pubkey;
287 * The value, in satoshis, of this output
295 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
296 * with our counterparty.
298 typedef struct MUST_USE_STRUCT LDKChannelConfig {
300 * A pointer to the opaque Rust object.
301 * Nearly everywhere, inner must be non-null, however in places where
302 * the Rust equivalent takes an Option, it may be set to null to indicate None.
304 LDKnativeChannelConfig *inner;
306 * Indicates that this is the only struct which contains the same pointer.
307 * Rust functions which take ownership of an object provided via an argument require
308 * this to be true and invalidate the object pointed to by inner.
316 * An error in decoding a message or struct.
318 typedef struct MUST_USE_STRUCT LDKDecodeError {
320 * A pointer to the opaque Rust object.
321 * Nearly everywhere, inner must be non-null, however in places where
322 * the Rust equivalent takes an Option, it may be set to null to indicate None.
324 LDKnativeDecodeError *inner;
326 * Indicates that this is the only struct which contains the same pointer.
327 * Rust functions which take ownership of an object provided via an argument require
328 * this to be true and invalidate the object pointed to by inner.
334 * The contents of CResult_ChannelConfigDecodeErrorZ
336 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
338 * A pointer to the contents in the success state.
339 * Reading from this pointer when `result_ok` is not set is undefined.
341 struct LDKChannelConfig *result;
343 * A pointer to the contents in the error state.
344 * Reading from this pointer when `result_ok` is set is undefined.
346 struct LDKDecodeError *err;
347 } LDKCResult_ChannelConfigDecodeErrorZPtr;
350 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
351 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
352 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
354 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
356 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
357 * `err` or `result` depending on the state of `result_ok`.
359 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
361 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
364 } LDKCResult_ChannelConfigDecodeErrorZ;
369 * A reference to a transaction output.
371 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
372 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
374 typedef struct MUST_USE_STRUCT LDKOutPoint {
376 * A pointer to the opaque Rust object.
377 * Nearly everywhere, inner must be non-null, however in places where
378 * the Rust equivalent takes an Option, it may be set to null to indicate None.
380 LDKnativeOutPoint *inner;
382 * Indicates that this is the only struct which contains the same pointer.
383 * Rust functions which take ownership of an object provided via an argument require
384 * this to be true and invalidate the object pointed to by inner.
390 * The contents of CResult_OutPointDecodeErrorZ
392 typedef union LDKCResult_OutPointDecodeErrorZPtr {
394 * A pointer to the contents in the success state.
395 * Reading from this pointer when `result_ok` is not set is undefined.
397 struct LDKOutPoint *result;
399 * A pointer to the contents in the error state.
400 * Reading from this pointer when `result_ok` is set is undefined.
402 struct LDKDecodeError *err;
403 } LDKCResult_OutPointDecodeErrorZPtr;
406 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
407 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
408 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
410 typedef struct LDKCResult_OutPointDecodeErrorZ {
412 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
413 * `err` or `result` depending on the state of `result_ok`.
415 union LDKCResult_OutPointDecodeErrorZPtr contents;
417 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
420 } LDKCResult_OutPointDecodeErrorZ;
423 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
425 typedef struct LDKSecretKey {
427 * The bytes of the secret key
433 * The contents of CResult_SecretKeyErrorZ
435 typedef union LDKCResult_SecretKeyErrorZPtr {
437 * A pointer to the contents in the success state.
438 * Reading from this pointer when `result_ok` is not set is undefined.
440 struct LDKSecretKey *result;
442 * A pointer to the contents in the error state.
443 * Reading from this pointer when `result_ok` is set is undefined.
445 enum LDKSecp256k1Error *err;
446 } LDKCResult_SecretKeyErrorZPtr;
449 * A CResult_SecretKeyErrorZ represents the result of a fallible operation,
450 * containing a crate::c_types::SecretKey on success and a crate::c_types::Secp256k1Error on failure.
451 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
453 typedef struct LDKCResult_SecretKeyErrorZ {
455 * The contents of this CResult_SecretKeyErrorZ, accessible via either
456 * `err` or `result` depending on the state of `result_ok`.
458 union LDKCResult_SecretKeyErrorZPtr contents;
460 * Whether this CResult_SecretKeyErrorZ represents a success state.
463 } LDKCResult_SecretKeyErrorZ;
466 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
468 typedef struct LDKPublicKey {
470 * The bytes of the public key
472 uint8_t compressed_form[33];
476 * The contents of CResult_PublicKeyErrorZ
478 typedef union LDKCResult_PublicKeyErrorZPtr {
480 * A pointer to the contents in the success state.
481 * Reading from this pointer when `result_ok` is not set is undefined.
483 struct LDKPublicKey *result;
485 * A pointer to the contents in the error state.
486 * Reading from this pointer when `result_ok` is set is undefined.
488 enum LDKSecp256k1Error *err;
489 } LDKCResult_PublicKeyErrorZPtr;
492 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
493 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
494 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
496 typedef struct LDKCResult_PublicKeyErrorZ {
498 * The contents of this CResult_PublicKeyErrorZ, accessible via either
499 * `err` or `result` depending on the state of `result_ok`.
501 union LDKCResult_PublicKeyErrorZPtr contents;
503 * Whether this CResult_PublicKeyErrorZ represents a success state.
506 } LDKCResult_PublicKeyErrorZ;
511 * The set of public keys which are used in the creation of one commitment transaction.
512 * These are derived from the channel base keys and per-commitment data.
514 * A broadcaster key is provided from potential broadcaster of the computed transaction.
515 * A countersignatory key is coming from a protocol participant unable to broadcast the
518 * These keys are assumed to be good, either because the code derived them from
519 * channel basepoints via the new function, or they were obtained via
520 * CommitmentTransaction.trust().keys() because we trusted the source of the
521 * pre-calculated keys.
523 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
525 * A pointer to the opaque Rust object.
526 * Nearly everywhere, inner must be non-null, however in places where
527 * the Rust equivalent takes an Option, it may be set to null to indicate None.
529 LDKnativeTxCreationKeys *inner;
531 * Indicates that this is the only struct which contains the same pointer.
532 * Rust functions which take ownership of an object provided via an argument require
533 * this to be true and invalidate the object pointed to by inner.
539 * The contents of CResult_TxCreationKeysDecodeErrorZ
541 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
543 * A pointer to the contents in the success state.
544 * Reading from this pointer when `result_ok` is not set is undefined.
546 struct LDKTxCreationKeys *result;
548 * A pointer to the contents in the error state.
549 * Reading from this pointer when `result_ok` is set is undefined.
551 struct LDKDecodeError *err;
552 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
555 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
556 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
557 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
559 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
561 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
562 * `err` or `result` depending on the state of `result_ok`.
564 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
566 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
569 } LDKCResult_TxCreationKeysDecodeErrorZ;
574 * One counterparty's public keys which do not change over the life of a channel.
576 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
578 * A pointer to the opaque Rust object.
579 * Nearly everywhere, inner must be non-null, however in places where
580 * the Rust equivalent takes an Option, it may be set to null to indicate None.
582 LDKnativeChannelPublicKeys *inner;
584 * Indicates that this is the only struct which contains the same pointer.
585 * Rust functions which take ownership of an object provided via an argument require
586 * this to be true and invalidate the object pointed to by inner.
589 } LDKChannelPublicKeys;
592 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
594 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
596 * A pointer to the contents in the success state.
597 * Reading from this pointer when `result_ok` is not set is undefined.
599 struct LDKChannelPublicKeys *result;
601 * A pointer to the contents in the error state.
602 * Reading from this pointer when `result_ok` is set is undefined.
604 struct LDKDecodeError *err;
605 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
608 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
609 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
610 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
612 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
614 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
615 * `err` or `result` depending on the state of `result_ok`.
617 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
619 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
622 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
625 * The contents of CResult_TxCreationKeysErrorZ
627 typedef union LDKCResult_TxCreationKeysErrorZPtr {
629 * A pointer to the contents in the success state.
630 * Reading from this pointer when `result_ok` is not set is undefined.
632 struct LDKTxCreationKeys *result;
634 * A pointer to the contents in the error state.
635 * Reading from this pointer when `result_ok` is set is undefined.
637 enum LDKSecp256k1Error *err;
638 } LDKCResult_TxCreationKeysErrorZPtr;
641 * A CResult_TxCreationKeysErrorZ represents the result of a fallible operation,
642 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::c_types::Secp256k1Error on failure.
643 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
645 typedef struct LDKCResult_TxCreationKeysErrorZ {
647 * The contents of this CResult_TxCreationKeysErrorZ, accessible via either
648 * `err` or `result` depending on the state of `result_ok`.
650 union LDKCResult_TxCreationKeysErrorZPtr contents;
652 * Whether this CResult_TxCreationKeysErrorZ represents a success state.
655 } LDKCResult_TxCreationKeysErrorZ;
658 * An enum which can either contain a u32 or not
660 typedef enum LDKCOption_u32Z_Tag {
662 * When we're in this state, this COption_u32Z contains a u32
664 LDKCOption_u32Z_Some,
666 * When we're in this state, this COption_u32Z contains nothing
668 LDKCOption_u32Z_None,
670 * Must be last for serialization purposes
672 LDKCOption_u32Z_Sentinel,
673 } LDKCOption_u32Z_Tag;
675 typedef struct LDKCOption_u32Z {
676 LDKCOption_u32Z_Tag tag;
687 * Information about an HTLC as it appears in a commitment transaction
689 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
691 * A pointer to the opaque Rust object.
692 * Nearly everywhere, inner must be non-null, however in places where
693 * the Rust equivalent takes an Option, it may be set to null to indicate None.
695 LDKnativeHTLCOutputInCommitment *inner;
697 * Indicates that this is the only struct which contains the same pointer.
698 * Rust functions which take ownership of an object provided via an argument require
699 * this to be true and invalidate the object pointed to by inner.
702 } LDKHTLCOutputInCommitment;
705 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
707 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
709 * A pointer to the contents in the success state.
710 * Reading from this pointer when `result_ok` is not set is undefined.
712 struct LDKHTLCOutputInCommitment *result;
714 * A pointer to the contents in the error state.
715 * Reading from this pointer when `result_ok` is set is undefined.
717 struct LDKDecodeError *err;
718 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
721 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
722 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
723 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
725 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
727 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
728 * `err` or `result` depending on the state of `result_ok`.
730 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
732 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
735 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
740 * Late-bound per-channel counterparty data used to build transactions.
742 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
744 * A pointer to the opaque Rust object.
745 * Nearly everywhere, inner must be non-null, however in places where
746 * the Rust equivalent takes an Option, it may be set to null to indicate None.
748 LDKnativeCounterpartyChannelTransactionParameters *inner;
750 * Indicates that this is the only struct which contains the same pointer.
751 * Rust functions which take ownership of an object provided via an argument require
752 * this to be true and invalidate the object pointed to by inner.
755 } LDKCounterpartyChannelTransactionParameters;
758 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
760 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
762 * A pointer to the contents in the success state.
763 * Reading from this pointer when `result_ok` is not set is undefined.
765 struct LDKCounterpartyChannelTransactionParameters *result;
767 * A pointer to the contents in the error state.
768 * Reading from this pointer when `result_ok` is set is undefined.
770 struct LDKDecodeError *err;
771 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
774 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
775 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
776 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
778 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
780 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
781 * `err` or `result` depending on the state of `result_ok`.
783 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
785 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
788 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
793 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
794 * The fields are organized by holder/counterparty.
796 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
797 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
799 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
801 * A pointer to the opaque Rust object.
802 * Nearly everywhere, inner must be non-null, however in places where
803 * the Rust equivalent takes an Option, it may be set to null to indicate None.
805 LDKnativeChannelTransactionParameters *inner;
807 * Indicates that this is the only struct which contains the same pointer.
808 * Rust functions which take ownership of an object provided via an argument require
809 * this to be true and invalidate the object pointed to by inner.
812 } LDKChannelTransactionParameters;
815 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
817 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
819 * A pointer to the contents in the success state.
820 * Reading from this pointer when `result_ok` is not set is undefined.
822 struct LDKChannelTransactionParameters *result;
824 * A pointer to the contents in the error state.
825 * Reading from this pointer when `result_ok` is set is undefined.
827 struct LDKDecodeError *err;
828 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
831 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
832 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
833 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
835 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
837 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
838 * `err` or `result` depending on the state of `result_ok`.
840 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
842 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
845 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
848 * Represents a secp256k1 signature serialized as two 32-byte numbers
850 typedef struct LDKSignature {
852 * The bytes of the signature in "compact" form
854 uint8_t compact_form[64];
858 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
859 * This corresponds to std::vector in C++
861 typedef struct LDKCVec_SignatureZ {
863 * The elements in the array.
864 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
866 struct LDKSignature *data;
868 * The number of elements pointed to by `data`.
871 } LDKCVec_SignatureZ;
876 * Information needed to build and sign a holder's commitment transaction.
878 * The transaction is only signed once we are ready to broadcast.
880 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
882 * A pointer to the opaque Rust object.
883 * Nearly everywhere, inner must be non-null, however in places where
884 * the Rust equivalent takes an Option, it may be set to null to indicate None.
886 LDKnativeHolderCommitmentTransaction *inner;
888 * Indicates that this is the only struct which contains the same pointer.
889 * Rust functions which take ownership of an object provided via an argument require
890 * this to be true and invalidate the object pointed to by inner.
893 } LDKHolderCommitmentTransaction;
896 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
898 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
900 * A pointer to the contents in the success state.
901 * Reading from this pointer when `result_ok` is not set is undefined.
903 struct LDKHolderCommitmentTransaction *result;
905 * A pointer to the contents in the error state.
906 * Reading from this pointer when `result_ok` is set is undefined.
908 struct LDKDecodeError *err;
909 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
912 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
913 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
914 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
916 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
918 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
919 * `err` or `result` depending on the state of `result_ok`.
921 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
923 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
926 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
931 * A pre-built Bitcoin commitment transaction and its txid.
933 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
935 * A pointer to the opaque Rust object.
936 * Nearly everywhere, inner must be non-null, however in places where
937 * the Rust equivalent takes an Option, it may be set to null to indicate None.
939 LDKnativeBuiltCommitmentTransaction *inner;
941 * Indicates that this is the only struct which contains the same pointer.
942 * Rust functions which take ownership of an object provided via an argument require
943 * this to be true and invalidate the object pointed to by inner.
946 } LDKBuiltCommitmentTransaction;
949 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
951 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
953 * A pointer to the contents in the success state.
954 * Reading from this pointer when `result_ok` is not set is undefined.
956 struct LDKBuiltCommitmentTransaction *result;
958 * A pointer to the contents in the error state.
959 * Reading from this pointer when `result_ok` is set is undefined.
961 struct LDKDecodeError *err;
962 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
965 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
966 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
967 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
969 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
971 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
972 * `err` or `result` depending on the state of `result_ok`.
974 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
976 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
979 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
984 * This class tracks the per-transaction information needed to build a commitment transaction and to
985 * actually build it and sign. It is used for holder transactions that we sign only when needed
986 * and for transactions we sign for the counterparty.
988 * This class can be used inside a signer implementation to generate a signature given the relevant
991 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
993 * A pointer to the opaque Rust object.
994 * Nearly everywhere, inner must be non-null, however in places where
995 * the Rust equivalent takes an Option, it may be set to null to indicate None.
997 LDKnativeCommitmentTransaction *inner;
999 * Indicates that this is the only struct which contains the same pointer.
1000 * Rust functions which take ownership of an object provided via an argument require
1001 * this to be true and invalidate the object pointed to by inner.
1004 } LDKCommitmentTransaction;
1007 * The contents of CResult_CommitmentTransactionDecodeErrorZ
1009 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
1011 * A pointer to the contents in the success state.
1012 * Reading from this pointer when `result_ok` is not set is undefined.
1014 struct LDKCommitmentTransaction *result;
1016 * A pointer to the contents in the error state.
1017 * Reading from this pointer when `result_ok` is set is undefined.
1019 struct LDKDecodeError *err;
1020 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
1023 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1024 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1025 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1027 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
1029 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
1030 * `err` or `result` depending on the state of `result_ok`.
1032 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
1034 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
1037 } LDKCResult_CommitmentTransactionDecodeErrorZ;
1042 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
1043 * transaction and the transaction creation keys) are trusted.
1045 * See trust() and verify() functions on CommitmentTransaction.
1047 * This structure implements Deref.
1049 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
1051 * A pointer to the opaque Rust object.
1052 * Nearly everywhere, inner must be non-null, however in places where
1053 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1055 LDKnativeTrustedCommitmentTransaction *inner;
1057 * Indicates that this is the only struct which contains the same pointer.
1058 * Rust functions which take ownership of an object provided via an argument require
1059 * this to be true and invalidate the object pointed to by inner.
1062 } LDKTrustedCommitmentTransaction;
1065 * The contents of CResult_TrustedCommitmentTransactionNoneZ
1067 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
1069 * A pointer to the contents in the success state.
1070 * Reading from this pointer when `result_ok` is not set is undefined.
1072 struct LDKTrustedCommitmentTransaction *result;
1074 * Note that this value is always NULL, as there are no contents in the Err variant
1077 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
1080 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
1081 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
1082 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1084 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
1086 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
1087 * `err` or `result` depending on the state of `result_ok`.
1089 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
1091 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
1094 } LDKCResult_TrustedCommitmentTransactionNoneZ;
1097 * The contents of CResult_CVec_SignatureZNoneZ
1099 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
1101 * A pointer to the contents in the success state.
1102 * Reading from this pointer when `result_ok` is not set is undefined.
1104 struct LDKCVec_SignatureZ *result;
1106 * Note that this value is always NULL, as there are no contents in the Err variant
1109 } LDKCResult_CVec_SignatureZNoneZPtr;
1112 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
1113 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
1114 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1116 typedef struct LDKCResult_CVec_SignatureZNoneZ {
1118 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
1119 * `err` or `result` depending on the state of `result_ok`.
1121 union LDKCResult_CVec_SignatureZNoneZPtr contents;
1123 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
1126 } LDKCResult_CVec_SignatureZNoneZ;
1131 * An update generated by the underlying Channel itself which contains some new information the
1132 * ChannelMonitor should be made aware of.
1134 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
1136 * A pointer to the opaque Rust object.
1137 * Nearly everywhere, inner must be non-null, however in places where
1138 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1140 LDKnativeChannelMonitorUpdate *inner;
1142 * Indicates that this is the only struct which contains the same pointer.
1143 * Rust functions which take ownership of an object provided via an argument require
1144 * this to be true and invalidate the object pointed to by inner.
1147 } LDKChannelMonitorUpdate;
1150 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
1152 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
1154 * A pointer to the contents in the success state.
1155 * Reading from this pointer when `result_ok` is not set is undefined.
1157 struct LDKChannelMonitorUpdate *result;
1159 * A pointer to the contents in the error state.
1160 * Reading from this pointer when `result_ok` is set is undefined.
1162 struct LDKDecodeError *err;
1163 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
1166 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
1167 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
1168 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1170 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
1172 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
1173 * `err` or `result` depending on the state of `result_ok`.
1175 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
1177 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
1180 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
1185 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
1186 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
1187 * preimage claim backward will lead to loss of funds.
1189 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
1191 * A pointer to the opaque Rust object.
1192 * Nearly everywhere, inner must be non-null, however in places where
1193 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1195 LDKnativeHTLCUpdate *inner;
1197 * Indicates that this is the only struct which contains the same pointer.
1198 * Rust functions which take ownership of an object provided via an argument require
1199 * this to be true and invalidate the object pointed to by inner.
1205 * The contents of CResult_HTLCUpdateDecodeErrorZ
1207 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
1209 * A pointer to the contents in the success state.
1210 * Reading from this pointer when `result_ok` is not set is undefined.
1212 struct LDKHTLCUpdate *result;
1214 * A pointer to the contents in the error state.
1215 * Reading from this pointer when `result_ok` is set is undefined.
1217 struct LDKDecodeError *err;
1218 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
1221 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
1222 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
1223 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1225 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
1227 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
1228 * `err` or `result` depending on the state of `result_ok`.
1230 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
1232 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
1235 } LDKCResult_HTLCUpdateDecodeErrorZ;
1240 * General Err type for ChannelMonitor actions. Generally, this implies that the data provided is
1241 * inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this
1242 * means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was
1244 * Contains a developer-readable error message.
1246 typedef struct MUST_USE_STRUCT LDKMonitorUpdateError {
1248 * A pointer to the opaque Rust object.
1249 * Nearly everywhere, inner must be non-null, however in places where
1250 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1252 LDKnativeMonitorUpdateError *inner;
1254 * Indicates that this is the only struct which contains the same pointer.
1255 * Rust functions which take ownership of an object provided via an argument require
1256 * this to be true and invalidate the object pointed to by inner.
1259 } LDKMonitorUpdateError;
1262 * The contents of CResult_NoneMonitorUpdateErrorZ
1264 typedef union LDKCResult_NoneMonitorUpdateErrorZPtr {
1266 * Note that this value is always NULL, as there are no contents in the OK variant
1270 * A pointer to the contents in the error state.
1271 * Reading from this pointer when `result_ok` is set is undefined.
1273 struct LDKMonitorUpdateError *err;
1274 } LDKCResult_NoneMonitorUpdateErrorZPtr;
1277 * A CResult_NoneMonitorUpdateErrorZ represents the result of a fallible operation,
1278 * containing a () on success and a crate::lightning::chain::channelmonitor::MonitorUpdateError on failure.
1279 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1281 typedef struct LDKCResult_NoneMonitorUpdateErrorZ {
1283 * The contents of this CResult_NoneMonitorUpdateErrorZ, accessible via either
1284 * `err` or `result` depending on the state of `result_ok`.
1286 union LDKCResult_NoneMonitorUpdateErrorZPtr contents;
1288 * Whether this CResult_NoneMonitorUpdateErrorZ represents a success state.
1291 } LDKCResult_NoneMonitorUpdateErrorZ;
1294 * A tuple of 2 elements. See the individual fields for the types contained.
1296 typedef struct LDKC2Tuple_OutPointScriptZ {
1298 * The element at position 0
1300 struct LDKOutPoint a;
1302 * The element at position 1
1304 struct LDKCVec_u8Z b;
1305 } LDKC2Tuple_OutPointScriptZ;
1308 * A tuple of 2 elements. See the individual fields for the types contained.
1310 typedef struct LDKC2Tuple_u32ScriptZ {
1312 * The element at position 0
1316 * The element at position 1
1318 struct LDKCVec_u8Z b;
1319 } LDKC2Tuple_u32ScriptZ;
1322 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
1323 * This corresponds to std::vector in C++
1325 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
1327 * The elements in the array.
1328 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1330 struct LDKC2Tuple_u32ScriptZ *data;
1332 * The number of elements pointed to by `data`.
1335 } LDKCVec_C2Tuple_u32ScriptZZ;
1338 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
1339 * look up the corresponding function in rust-lightning's docs.
1341 typedef struct LDKThirtyTwoBytes {
1343 * The thirty-two bytes
1346 } LDKThirtyTwoBytes;
1349 * A tuple of 2 elements. See the individual fields for the types contained.
1351 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
1353 * The element at position 0
1355 struct LDKThirtyTwoBytes a;
1357 * The element at position 1
1359 struct LDKCVec_C2Tuple_u32ScriptZZ b;
1360 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
1363 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
1364 * This corresponds to std::vector in C++
1366 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
1368 * The elements in the array.
1369 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1371 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
1373 * The number of elements pointed to by `data`.
1376 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
1379 * An event to be processed by the ChannelManager.
1381 typedef enum LDKMonitorEvent_Tag {
1383 * A monitor event containing an HTLCUpdate.
1385 LDKMonitorEvent_HTLCEvent,
1387 * A monitor event that the Channel's commitment transaction was broadcasted.
1389 LDKMonitorEvent_CommitmentTxBroadcasted,
1391 * Must be last for serialization purposes
1393 LDKMonitorEvent_Sentinel,
1394 } LDKMonitorEvent_Tag;
1396 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
1397 LDKMonitorEvent_Tag tag;
1400 struct LDKHTLCUpdate htlc_event;
1403 struct LDKOutPoint commitment_tx_broadcasted;
1409 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
1410 * This corresponds to std::vector in C++
1412 typedef struct LDKCVec_MonitorEventZ {
1414 * The elements in the array.
1415 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1417 struct LDKMonitorEvent *data;
1419 * The number of elements pointed to by `data`.
1422 } LDKCVec_MonitorEventZ;
1427 * Information about a spendable output to a P2WSH script. See
1428 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
1430 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
1432 * A pointer to the opaque Rust object.
1433 * Nearly everywhere, inner must be non-null, however in places where
1434 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1436 LDKnativeDelayedPaymentOutputDescriptor *inner;
1438 * Indicates that this is the only struct which contains the same pointer.
1439 * Rust functions which take ownership of an object provided via an argument require
1440 * this to be true and invalidate the object pointed to by inner.
1443 } LDKDelayedPaymentOutputDescriptor;
1448 * Information about a spendable output to our \"payment key\". See
1449 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
1451 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
1453 * A pointer to the opaque Rust object.
1454 * Nearly everywhere, inner must be non-null, however in places where
1455 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1457 LDKnativeStaticPaymentOutputDescriptor *inner;
1459 * Indicates that this is the only struct which contains the same pointer.
1460 * Rust functions which take ownership of an object provided via an argument require
1461 * this to be true and invalidate the object pointed to by inner.
1464 } LDKStaticPaymentOutputDescriptor;
1467 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
1468 * claim at any point in the future) an event is generated which you must track and be able to
1469 * spend on-chain. The information needed to do this is provided in this enum, including the
1470 * outpoint describing which txid and output index is available, the full output which exists at
1471 * that txid/index, and any keys or other information required to sign.
1473 typedef enum LDKSpendableOutputDescriptor_Tag {
1475 * An output to a script which was provided via KeysInterface directly, either from
1476 * `get_destination_script()` or `get_shutdown_pubkey()`, thus you should already know how to
1477 * spend it. No secret keys are provided as rust-lightning was never given any key.
1478 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
1479 * on-chain using the payment preimage or after it has timed out.
1481 LDKSpendableOutputDescriptor_StaticOutput,
1483 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
1485 * The witness in the spending input should be:
1486 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
1488 * Note that the nSequence field in the spending input must be set to to_self_delay
1489 * (which means the transaction is not broadcastable until at least to_self_delay
1490 * blocks after the outpoint confirms).
1492 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
1493 * it is an output from an old state which we broadcast (which should never happen).
1495 * To derive the delayed_payment key which is used to sign for this input, you must pass the
1496 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
1497 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
1498 * chan_utils::derive_private_key. The public key can be generated without the secret key
1499 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
1502 * To derive the revocation_pubkey provided here (which is used in the witness
1503 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
1504 * call to Sign::ready_channel) and the provided per_commitment point
1505 * to chan_utils::derive_public_revocation_key.
1507 * The witness script which is hashed and included in the output script_pubkey may be
1508 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
1509 * (derived as above), and the to_self_delay contained here to
1510 * chan_utils::get_revokeable_redeemscript.
1512 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
1514 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
1515 * corresponds to the public key in Sign::pubkeys().payment_point).
1516 * The witness in the spending input, is, thus, simply:
1517 * <BIP 143 signature> <payment key>
1519 * These are generally the result of our counterparty having broadcast the current state,
1520 * allowing us to claim the non-HTLC-encumbered outputs immediately.
1522 LDKSpendableOutputDescriptor_StaticPaymentOutput,
1524 * Must be last for serialization purposes
1526 LDKSpendableOutputDescriptor_Sentinel,
1527 } LDKSpendableOutputDescriptor_Tag;
1529 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
1531 * The outpoint which is spendable
1533 struct LDKOutPoint outpoint;
1535 * The output which is referenced by the given outpoint.
1537 struct LDKTxOut output;
1538 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
1540 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
1541 LDKSpendableOutputDescriptor_Tag tag;
1543 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
1545 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
1548 struct LDKStaticPaymentOutputDescriptor static_payment_output;
1551 } LDKSpendableOutputDescriptor;
1554 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
1555 * This corresponds to std::vector in C++
1557 typedef struct LDKCVec_SpendableOutputDescriptorZ {
1559 * The elements in the array.
1560 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1562 struct LDKSpendableOutputDescriptor *data;
1564 * The number of elements pointed to by `data`.
1567 } LDKCVec_SpendableOutputDescriptorZ;
1570 * An Event which you should probably take some action in response to.
1572 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
1573 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
1574 * written as it makes no sense to respond to it after reconnecting to peers).
1576 typedef enum LDKEvent_Tag {
1578 * Used to indicate that the client should generate a funding transaction with the given
1579 * parameters and then call ChannelManager::funding_transaction_generated.
1580 * Generated in ChannelManager message handling.
1581 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
1582 * counterparty can steal your funds!
1584 LDKEvent_FundingGenerationReady,
1586 * Indicates we've received money! Just gotta dig out that payment preimage and feed it to
1587 * ChannelManager::claim_funds to get it....
1588 * Note that if the preimage is not known or the amount paid is incorrect, you should call
1589 * ChannelManager::fail_htlc_backwards to free up resources for this HTLC and avoid
1590 * network congestion.
1591 * The amount paid should be considered 'incorrect' when it is less than or more than twice
1592 * the amount expected.
1593 * If you fail to call either ChannelManager::claim_funds or
1594 * ChannelManager::fail_htlc_backwards within the HTLC's timeout, the HTLC will be
1595 * automatically failed.
1597 LDKEvent_PaymentReceived,
1599 * Indicates an outbound payment we made succeeded (ie it made it all the way to its target
1600 * and we got back the payment preimage for it).
1601 * Note that duplicative PaymentSent Events may be generated - it is your responsibility to
1602 * deduplicate them by payment_preimage (which MUST be unique)!
1604 LDKEvent_PaymentSent,
1606 * Indicates an outbound payment we made failed. Probably some intermediary node dropped
1607 * something. You may wish to retry with a different route.
1608 * Note that duplicative PaymentFailed Events may be generated - it is your responsibility to
1609 * deduplicate them by payment_hash (which MUST be unique)!
1611 LDKEvent_PaymentFailed,
1613 * Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
1614 * time in the future.
1616 LDKEvent_PendingHTLCsForwardable,
1618 * Used to indicate that an output was generated on-chain which you should know how to spend.
1619 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
1620 * counterparty spending them due to some kind of timeout. Thus, you need to store them
1621 * somewhere and spend them when you create on-chain transactions.
1623 LDKEvent_SpendableOutputs,
1625 * Must be last for serialization purposes
1630 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
1632 * The random channel_id we picked which you'll need to pass into
1633 * ChannelManager::funding_transaction_generated.
1635 struct LDKThirtyTwoBytes temporary_channel_id;
1637 * The value, in satoshis, that the output should have.
1639 uint64_t channel_value_satoshis;
1641 * The script which should be used in the transaction output.
1643 struct LDKCVec_u8Z output_script;
1645 * The value passed in to ChannelManager::create_channel
1647 uint64_t user_channel_id;
1648 } LDKEvent_LDKFundingGenerationReady_Body;
1650 typedef struct LDKEvent_LDKPaymentReceived_Body {
1652 * The hash for which the preimage should be handed to the ChannelManager.
1654 struct LDKThirtyTwoBytes payment_hash;
1656 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
1657 * number of deanonymization attacks during the routing process.
1658 * As nodes upgrade, the invoices you provide should likely migrate to setting the
1659 * payment_secret feature to required, at which point you should fail_backwards any HTLCs
1660 * which have a None here.
1661 * Until then, however, values of None should be ignored, and only incorrect Some values
1662 * should result in an HTLC fail_backwards.
1663 * Note that, in any case, this value must be passed as-is to any fail or claim calls as
1664 * the HTLC index includes this value.
1666 struct LDKThirtyTwoBytes payment_secret;
1668 * The value, in thousandths of a satoshi, that this payment is for. Note that you must
1669 * compare this to the expected value before accepting the payment (as otherwise you are
1670 * providing proof-of-payment for less than the value you expected!).
1673 } LDKEvent_LDKPaymentReceived_Body;
1675 typedef struct LDKEvent_LDKPaymentSent_Body {
1677 * The preimage to the hash given to ChannelManager::send_payment.
1678 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
1681 struct LDKThirtyTwoBytes payment_preimage;
1682 } LDKEvent_LDKPaymentSent_Body;
1684 typedef struct LDKEvent_LDKPaymentFailed_Body {
1686 * The hash which was given to ChannelManager::send_payment.
1688 struct LDKThirtyTwoBytes payment_hash;
1690 * Indicates the payment was rejected for some reason by the recipient. This implies that
1691 * the payment has failed, not just the route in question. If this is not set, you may
1692 * retry the payment via a different route.
1694 bool rejected_by_dest;
1695 } LDKEvent_LDKPaymentFailed_Body;
1697 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
1699 * The minimum amount of time that should be waited prior to calling
1700 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
1701 * you should wait a random amount of time in roughly the range (now + time_forwardable,
1702 * now + 5*time_forwardable).
1704 uint64_t time_forwardable;
1705 } LDKEvent_LDKPendingHTLCsForwardable_Body;
1707 typedef struct LDKEvent_LDKSpendableOutputs_Body {
1709 * The outputs which you should store as spendable by you.
1711 struct LDKCVec_SpendableOutputDescriptorZ outputs;
1712 } LDKEvent_LDKSpendableOutputs_Body;
1714 typedef struct MUST_USE_STRUCT LDKEvent {
1717 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
1718 LDKEvent_LDKPaymentReceived_Body payment_received;
1719 LDKEvent_LDKPaymentSent_Body payment_sent;
1720 LDKEvent_LDKPaymentFailed_Body payment_failed;
1721 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
1722 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
1727 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
1728 * This corresponds to std::vector in C++
1730 typedef struct LDKCVec_EventZ {
1732 * The elements in the array.
1733 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1735 struct LDKEvent *data;
1737 * The number of elements pointed to by `data`.
1743 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
1744 * This corresponds to std::vector in C++
1746 typedef struct LDKCVec_TransactionZ {
1748 * The elements in the array.
1749 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1751 struct LDKTransaction *data;
1753 * The number of elements pointed to by `data`.
1756 } LDKCVec_TransactionZ;
1759 * A tuple of 2 elements. See the individual fields for the types contained.
1761 typedef struct LDKC2Tuple_usizeTransactionZ {
1763 * The element at position 0
1767 * The element at position 1
1769 struct LDKTransaction b;
1770 } LDKC2Tuple_usizeTransactionZ;
1773 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
1774 * This corresponds to std::vector in C++
1776 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
1778 * The elements in the array.
1779 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1781 struct LDKC2Tuple_usizeTransactionZ *data;
1783 * The number of elements pointed to by `data`.
1786 } LDKCVec_C2Tuple_usizeTransactionZZ;
1789 * A tuple of 2 elements. See the individual fields for the types contained.
1791 typedef struct LDKC2Tuple_u32TxOutZ {
1793 * The element at position 0
1797 * The element at position 1
1800 } LDKC2Tuple_u32TxOutZ;
1803 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
1804 * This corresponds to std::vector in C++
1806 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
1808 * The elements in the array.
1809 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1811 struct LDKC2Tuple_u32TxOutZ *data;
1813 * The number of elements pointed to by `data`.
1816 } LDKCVec_C2Tuple_u32TxOutZZ;
1819 * A tuple of 2 elements. See the individual fields for the types contained.
1821 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
1823 * The element at position 0
1825 struct LDKThirtyTwoBytes a;
1827 * The element at position 1
1829 struct LDKCVec_C2Tuple_u32TxOutZZ b;
1830 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
1833 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
1834 * This corresponds to std::vector in C++
1836 typedef struct LDKCVec_TransactionOutputsZ {
1838 * The elements in the array.
1839 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1841 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
1843 * The number of elements pointed to by `data`.
1846 } LDKCVec_TransactionOutputsZ;
1849 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
1850 * This corresponds to std::vector in C++
1852 typedef struct LDKCVec_TxidZ {
1854 * The elements in the array.
1855 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1857 struct LDKThirtyTwoBytes *data;
1859 * The number of elements pointed to by `data`.
1865 * The contents of CResult_NoneChannelMonitorUpdateErrZ
1867 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
1869 * Note that this value is always NULL, as there are no contents in the OK variant
1873 * A pointer to the contents in the error state.
1874 * Reading from this pointer when `result_ok` is set is undefined.
1876 enum LDKChannelMonitorUpdateErr *err;
1877 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
1880 * A CResult_NoneChannelMonitorUpdateErrZ represents the result of a fallible operation,
1881 * containing a () on success and a crate::lightning::chain::channelmonitor::ChannelMonitorUpdateErr on failure.
1882 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1884 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
1886 * The contents of this CResult_NoneChannelMonitorUpdateErrZ, accessible via either
1887 * `err` or `result` depending on the state of `result_ok`.
1889 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
1891 * Whether this CResult_NoneChannelMonitorUpdateErrZ represents a success state.
1894 } LDKCResult_NoneChannelMonitorUpdateErrZ;
1897 * A tuple of 2 elements. See the individual fields for the types contained.
1899 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
1901 * The element at position 0
1903 struct LDKSignature a;
1905 * The element at position 1
1907 struct LDKCVec_SignatureZ b;
1908 } LDKC2Tuple_SignatureCVec_SignatureZZ;
1911 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
1913 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
1915 * A pointer to the contents in the success state.
1916 * Reading from this pointer when `result_ok` is not set is undefined.
1918 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
1920 * Note that this value is always NULL, as there are no contents in the Err variant
1923 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
1926 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
1927 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
1928 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1930 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
1932 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
1933 * `err` or `result` depending on the state of `result_ok`.
1935 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
1937 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
1940 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
1943 * The contents of CResult_SignatureNoneZ
1945 typedef union LDKCResult_SignatureNoneZPtr {
1947 * A pointer to the contents in the success state.
1948 * Reading from this pointer when `result_ok` is not set is undefined.
1950 struct LDKSignature *result;
1952 * Note that this value is always NULL, as there are no contents in the Err variant
1955 } LDKCResult_SignatureNoneZPtr;
1958 * A CResult_SignatureNoneZ represents the result of a fallible operation,
1959 * containing a crate::c_types::Signature on success and a () on failure.
1960 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1962 typedef struct LDKCResult_SignatureNoneZ {
1964 * The contents of this CResult_SignatureNoneZ, accessible via either
1965 * `err` or `result` depending on the state of `result_ok`.
1967 union LDKCResult_SignatureNoneZPtr contents;
1969 * Whether this CResult_SignatureNoneZ represents a success state.
1972 } LDKCResult_SignatureNoneZ;
1977 * The unsigned part of a channel_announcement
1979 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
1981 * A pointer to the opaque Rust object.
1982 * Nearly everywhere, inner must be non-null, however in places where
1983 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1985 LDKnativeUnsignedChannelAnnouncement *inner;
1987 * Indicates that this is the only struct which contains the same pointer.
1988 * Rust functions which take ownership of an object provided via an argument require
1989 * this to be true and invalidate the object pointed to by inner.
1992 } LDKUnsignedChannelAnnouncement;
1995 * A trait to sign lightning channel transactions as described in BOLT 3.
1997 * Signing services could be implemented on a hardware wallet. In this case,
1998 * the current Sign would be a front-end on top of a communication
1999 * channel connected to your secure device and lightning key material wouldn't
2000 * reside on a hot server. Nevertheless, a this deployment would still need
2001 * to trust the ChannelManager to avoid loss of funds as this latest component
2002 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
2004 * A more secure iteration would be to use hashlock (or payment points) to pair
2005 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
2006 * at the price of more state and computation on the hardware wallet side. In the future,
2007 * we are looking forward to design such interface.
2009 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
2010 * to act, as liveness and breach reply correctness are always going to be hard requirements
2011 * of LN security model, orthogonal of key management issues.
2013 typedef struct LDKBaseSign {
2015 * An opaque pointer which is passed to your function implementations as an argument.
2016 * This has no meaning in the LDK, and can be NULL or any other value.
2020 * Gets the per-commitment point for a specific commitment number
2022 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
2024 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
2026 * Gets the commitment secret for a specific commitment number as part of the revocation process
2028 * An external signer implementation should error here if the commitment was already signed
2029 * and should refuse to sign it in the future.
2031 * May be called more than once for the same index.
2033 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
2035 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
2037 * Gets the holder's channel public keys and basepoints
2039 struct LDKChannelPublicKeys pubkeys;
2041 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
2042 * Note that this takes a pointer to this object, not the this_ptr like other methods do
2043 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
2045 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
2047 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
2048 * some SpendableOutputDescriptor types. This should be sufficient to identify this
2049 * Sign object uniquely and lookup or re-derive its keys.
2051 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
2053 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
2055 * Note that if signing fails or is rejected, the channel will be force-closed.
2057 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx);
2059 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
2060 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
2061 * latest commitment_tx when we initiate a force-close.
2062 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
2063 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
2065 * This may be called multiple times for the same transaction.
2067 * An external signer implementation should check that the commitment has not been revoked.
2069 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
2071 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
2073 * Create a signature for the given input in a transaction spending an HTLC or commitment
2074 * transaction output when our counterparty broadcasts an old state.
2076 * A justice transaction may claim multiples outputs at the same time if timelocks are
2077 * similar, but only a signature for the input at index `input` should be signed for here.
2078 * It may be called multiples time for same output(s) if a fee-bump is needed with regards
2079 * to an upcoming timelock expiration.
2081 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2083 * per_commitment_key is revocation secret which was provided by our counterparty when they
2084 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2085 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
2088 * htlc holds HTLC elements (hash, timelock) if the output being spent is a HTLC output, thus
2089 * changing the format of the witness script (which is committed to in the BIP 143
2092 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);
2094 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
2095 * transaction, either offered or received.
2097 * Such a transaction may claim multiples offered outputs at same time if we know the
2098 * preimage for each when we create it, but only the input at index `input` should be
2099 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
2100 * needed with regards to an upcoming timelock expiration.
2102 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
2105 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2107 * Per_commitment_point is the dynamic point corresponding to the channel state
2108 * detected onchain. It has been generated by our counterparty and is used to derive
2109 * channel state keys, which are then included in the witness script and committed to in the
2110 * BIP 143 signature.
2112 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);
2114 * Create a signature for a (proposed) closing transaction.
2116 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
2117 * chosen to forgo their output as dust.
2119 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, struct LDKTransaction closing_tx);
2121 * Signs a channel announcement message with our funding key, proving it comes from one
2122 * of the channel participants.
2124 * Note that if this fails or is rejected, the channel will not be publicly announced and
2125 * our counterparty may (though likely will not) close the channel on us for violating the
2128 struct LDKCResult_SignatureNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
2130 * Set the counterparty static channel data, including basepoints,
2131 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
2132 * This is done as soon as the funding outpoint is known. Since these are static channel data,
2133 * they MUST NOT be allowed to change to different values once set.
2135 * channel_parameters.is_populated() MUST be true.
2137 * We bind holder_selected_contest_delay late here for API convenience.
2139 * Will be called before any signatures are applied.
2141 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
2143 * Frees any resources associated with this object given its this_arg pointer.
2144 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2146 void (*free)(void *this_arg);
2150 * A cloneable signer.
2152 * Although we require signers to be cloneable, it may be useful for developers to be able to use
2153 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
2154 * which implies Sized, into this derived trait.
2156 typedef struct LDKSign {
2158 * An opaque pointer which is passed to your function implementations as an argument.
2159 * This has no meaning in the LDK, and can be NULL or any other value.
2163 * Implementation of BaseSign for this object.
2165 struct LDKBaseSign BaseSign;
2167 * Creates a copy of the BaseSign, for a copy of this Sign.
2168 * Because BaseSign doesn't natively support copying itself, you have to provide a full copy implementation here.
2170 struct LDKBaseSign (*BaseSign_clone)(const struct LDKBaseSign *NONNULL_PTR orig_BaseSign);
2172 * Serialize the object into a byte array
2174 struct LDKCVec_u8Z (*write)(const void *this_arg);
2176 * Creates a copy of the object pointed to by this_arg, for a copy of this Sign.
2177 * Note that the ultimate copy of the Sign will have all function pointers the same as the original.
2178 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new Sign.
2180 void *(*clone)(const void *this_arg);
2182 * Frees any resources associated with this object given its this_arg pointer.
2183 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2185 void (*free)(void *this_arg);
2191 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
2192 * on-chain transactions to ensure no loss of funds occurs.
2194 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
2195 * information and are actively monitoring the chain.
2197 * Pending Events or updated HTLCs which have not yet been read out by
2198 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
2199 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
2200 * gotten are fully handled before re-serializing the new state.
2202 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
2203 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
2204 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
2205 * returned block hash and the the current chain and then reconnecting blocks to get to the
2206 * best chain) upon deserializing the object!
2208 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
2210 * A pointer to the opaque Rust object.
2211 * Nearly everywhere, inner must be non-null, however in places where
2212 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2214 LDKnativeChannelMonitor *inner;
2216 * Indicates that this is the only struct which contains the same pointer.
2217 * Rust functions which take ownership of an object provided via an argument require
2218 * this to be true and invalidate the object pointed to by inner.
2221 } LDKChannelMonitor;
2224 * A tuple of 2 elements. See the individual fields for the types contained.
2226 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
2228 * The element at position 0
2230 struct LDKThirtyTwoBytes a;
2232 * The element at position 1
2234 struct LDKChannelMonitor b;
2235 } LDKC2Tuple_BlockHashChannelMonitorZ;
2238 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
2240 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
2242 * A pointer to the contents in the success state.
2243 * Reading from this pointer when `result_ok` is not set is undefined.
2245 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
2247 * A pointer to the contents in the error state.
2248 * Reading from this pointer when `result_ok` is set is undefined.
2250 struct LDKDecodeError *err;
2251 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
2254 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
2255 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
2256 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2258 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
2260 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
2261 * `err` or `result` depending on the state of `result_ok`.
2263 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
2265 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
2268 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
2275 typedef struct MUST_USE_STRUCT LDKRouteHop {
2277 * A pointer to the opaque Rust object.
2278 * Nearly everywhere, inner must be non-null, however in places where
2279 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2281 LDKnativeRouteHop *inner;
2283 * Indicates that this is the only struct which contains the same pointer.
2284 * Rust functions which take ownership of an object provided via an argument require
2285 * this to be true and invalidate the object pointed to by inner.
2291 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
2292 * This corresponds to std::vector in C++
2294 typedef struct LDKCVec_RouteHopZ {
2296 * The elements in the array.
2297 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2299 struct LDKRouteHop *data;
2301 * The number of elements pointed to by `data`.
2304 } LDKCVec_RouteHopZ;
2307 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
2308 * This corresponds to std::vector in C++
2310 typedef struct LDKCVec_CVec_RouteHopZZ {
2312 * The elements in the array.
2313 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2315 struct LDKCVec_RouteHopZ *data;
2317 * The number of elements pointed to by `data`.
2320 } LDKCVec_CVec_RouteHopZZ;
2325 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
2326 * it can take multiple paths. Each path is composed of one or more hops through the network.
2328 typedef struct MUST_USE_STRUCT LDKRoute {
2330 * A pointer to the opaque Rust object.
2331 * Nearly everywhere, inner must be non-null, however in places where
2332 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2334 LDKnativeRoute *inner;
2336 * Indicates that this is the only struct which contains the same pointer.
2337 * Rust functions which take ownership of an object provided via an argument require
2338 * this to be true and invalidate the object pointed to by inner.
2344 * The contents of CResult_RouteDecodeErrorZ
2346 typedef union LDKCResult_RouteDecodeErrorZPtr {
2348 * A pointer to the contents in the success state.
2349 * Reading from this pointer when `result_ok` is not set is undefined.
2351 struct LDKRoute *result;
2353 * A pointer to the contents in the error state.
2354 * Reading from this pointer when `result_ok` is set is undefined.
2356 struct LDKDecodeError *err;
2357 } LDKCResult_RouteDecodeErrorZPtr;
2360 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
2361 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
2362 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2364 typedef struct LDKCResult_RouteDecodeErrorZ {
2366 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
2367 * `err` or `result` depending on the state of `result_ok`.
2369 union LDKCResult_RouteDecodeErrorZPtr contents;
2371 * Whether this CResult_RouteDecodeErrorZ represents a success state.
2374 } LDKCResult_RouteDecodeErrorZ;
2377 * An enum which can either contain a u64 or not
2379 typedef enum LDKCOption_u64Z_Tag {
2381 * When we're in this state, this COption_u64Z contains a u64
2383 LDKCOption_u64Z_Some,
2385 * When we're in this state, this COption_u64Z contains nothing
2387 LDKCOption_u64Z_None,
2389 * Must be last for serialization purposes
2391 LDKCOption_u64Z_Sentinel,
2392 } LDKCOption_u64Z_Tag;
2394 typedef struct LDKCOption_u64Z {
2395 LDKCOption_u64Z_Tag tag;
2406 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
2408 typedef struct MUST_USE_STRUCT LDKChannelDetails {
2410 * A pointer to the opaque Rust object.
2411 * Nearly everywhere, inner must be non-null, however in places where
2412 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2414 LDKnativeChannelDetails *inner;
2416 * Indicates that this is the only struct which contains the same pointer.
2417 * Rust functions which take ownership of an object provided via an argument require
2418 * this to be true and invalidate the object pointed to by inner.
2421 } LDKChannelDetails;
2424 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
2425 * This corresponds to std::vector in C++
2427 typedef struct LDKCVec_ChannelDetailsZ {
2429 * The elements in the array.
2430 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2432 struct LDKChannelDetails *data;
2434 * The number of elements pointed to by `data`.
2437 } LDKCVec_ChannelDetailsZ;
2442 * A channel descriptor which provides a last-hop route to get_route
2444 typedef struct MUST_USE_STRUCT LDKRouteHint {
2446 * A pointer to the opaque Rust object.
2447 * Nearly everywhere, inner must be non-null, however in places where
2448 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2450 LDKnativeRouteHint *inner;
2452 * Indicates that this is the only struct which contains the same pointer.
2453 * Rust functions which take ownership of an object provided via an argument require
2454 * this to be true and invalidate the object pointed to by inner.
2460 * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
2461 * This corresponds to std::vector in C++
2463 typedef struct LDKCVec_RouteHintZ {
2465 * The elements in the array.
2466 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2468 struct LDKRouteHint *data;
2470 * The number of elements pointed to by `data`.
2473 } LDKCVec_RouteHintZ;
2478 * An Err type for failure to process messages.
2480 typedef struct MUST_USE_STRUCT LDKLightningError {
2482 * A pointer to the opaque Rust object.
2483 * Nearly everywhere, inner must be non-null, however in places where
2484 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2486 LDKnativeLightningError *inner;
2488 * Indicates that this is the only struct which contains the same pointer.
2489 * Rust functions which take ownership of an object provided via an argument require
2490 * this to be true and invalidate the object pointed to by inner.
2493 } LDKLightningError;
2496 * The contents of CResult_RouteLightningErrorZ
2498 typedef union LDKCResult_RouteLightningErrorZPtr {
2500 * A pointer to the contents in the success state.
2501 * Reading from this pointer when `result_ok` is not set is undefined.
2503 struct LDKRoute *result;
2505 * A pointer to the contents in the error state.
2506 * Reading from this pointer when `result_ok` is set is undefined.
2508 struct LDKLightningError *err;
2509 } LDKCResult_RouteLightningErrorZPtr;
2512 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
2513 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
2514 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2516 typedef struct LDKCResult_RouteLightningErrorZ {
2518 * The contents of this CResult_RouteLightningErrorZ, accessible via either
2519 * `err` or `result` depending on the state of `result_ok`.
2521 union LDKCResult_RouteLightningErrorZPtr contents;
2523 * Whether this CResult_RouteLightningErrorZ represents a success state.
2526 } LDKCResult_RouteLightningErrorZ;
2531 * An accept_channel message to be sent or received from a peer
2533 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
2535 * A pointer to the opaque Rust object.
2536 * Nearly everywhere, inner must be non-null, however in places where
2537 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2539 LDKnativeAcceptChannel *inner;
2541 * Indicates that this is the only struct which contains the same pointer.
2542 * Rust functions which take ownership of an object provided via an argument require
2543 * this to be true and invalidate the object pointed to by inner.
2551 * An open_channel message to be sent or received from a peer
2553 typedef struct MUST_USE_STRUCT LDKOpenChannel {
2555 * A pointer to the opaque Rust object.
2556 * Nearly everywhere, inner must be non-null, however in places where
2557 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2559 LDKnativeOpenChannel *inner;
2561 * Indicates that this is the only struct which contains the same pointer.
2562 * Rust functions which take ownership of an object provided via an argument require
2563 * this to be true and invalidate the object pointed to by inner.
2571 * A funding_created message to be sent or received from a peer
2573 typedef struct MUST_USE_STRUCT LDKFundingCreated {
2575 * A pointer to the opaque Rust object.
2576 * Nearly everywhere, inner must be non-null, however in places where
2577 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2579 LDKnativeFundingCreated *inner;
2581 * Indicates that this is the only struct which contains the same pointer.
2582 * Rust functions which take ownership of an object provided via an argument require
2583 * this to be true and invalidate the object pointed to by inner.
2586 } LDKFundingCreated;
2591 * A funding_signed message to be sent or received from a peer
2593 typedef struct MUST_USE_STRUCT LDKFundingSigned {
2595 * A pointer to the opaque Rust object.
2596 * Nearly everywhere, inner must be non-null, however in places where
2597 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2599 LDKnativeFundingSigned *inner;
2601 * Indicates that this is the only struct which contains the same pointer.
2602 * Rust functions which take ownership of an object provided via an argument require
2603 * this to be true and invalidate the object pointed to by inner.
2611 * A funding_locked message to be sent or received from a peer
2613 typedef struct MUST_USE_STRUCT LDKFundingLocked {
2615 * A pointer to the opaque Rust object.
2616 * Nearly everywhere, inner must be non-null, however in places where
2617 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2619 LDKnativeFundingLocked *inner;
2621 * Indicates that this is the only struct which contains the same pointer.
2622 * Rust functions which take ownership of an object provided via an argument require
2623 * this to be true and invalidate the object pointed to by inner.
2631 * An announcement_signatures message to be sent or received from a peer
2633 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
2635 * A pointer to the opaque Rust object.
2636 * Nearly everywhere, inner must be non-null, however in places where
2637 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2639 LDKnativeAnnouncementSignatures *inner;
2641 * Indicates that this is the only struct which contains the same pointer.
2642 * Rust functions which take ownership of an object provided via an argument require
2643 * this to be true and invalidate the object pointed to by inner.
2646 } LDKAnnouncementSignatures;
2651 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
2652 * transaction updates if they were pending.
2654 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
2656 * A pointer to the opaque Rust object.
2657 * Nearly everywhere, inner must be non-null, however in places where
2658 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2660 LDKnativeCommitmentUpdate *inner;
2662 * Indicates that this is the only struct which contains the same pointer.
2663 * Rust functions which take ownership of an object provided via an argument require
2664 * this to be true and invalidate the object pointed to by inner.
2667 } LDKCommitmentUpdate;
2672 * A revoke_and_ack message to be sent or received from a peer
2674 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
2676 * A pointer to the opaque Rust object.
2677 * Nearly everywhere, inner must be non-null, however in places where
2678 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2680 LDKnativeRevokeAndACK *inner;
2682 * Indicates that this is the only struct which contains the same pointer.
2683 * Rust functions which take ownership of an object provided via an argument require
2684 * this to be true and invalidate the object pointed to by inner.
2692 * A closing_signed message to be sent or received from a peer
2694 typedef struct MUST_USE_STRUCT LDKClosingSigned {
2696 * A pointer to the opaque Rust object.
2697 * Nearly everywhere, inner must be non-null, however in places where
2698 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2700 LDKnativeClosingSigned *inner;
2702 * Indicates that this is the only struct which contains the same pointer.
2703 * Rust functions which take ownership of an object provided via an argument require
2704 * this to be true and invalidate the object pointed to by inner.
2712 * A shutdown message to be sent or received from a peer
2714 typedef struct MUST_USE_STRUCT LDKShutdown {
2716 * A pointer to the opaque Rust object.
2717 * Nearly everywhere, inner must be non-null, however in places where
2718 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2720 LDKnativeShutdown *inner;
2722 * Indicates that this is the only struct which contains the same pointer.
2723 * Rust functions which take ownership of an object provided via an argument require
2724 * this to be true and invalidate the object pointed to by inner.
2732 * A channel_reestablish message to be sent or received from a peer
2734 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
2736 * A pointer to the opaque Rust object.
2737 * Nearly everywhere, inner must be non-null, however in places where
2738 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2740 LDKnativeChannelReestablish *inner;
2742 * Indicates that this is the only struct which contains the same pointer.
2743 * Rust functions which take ownership of an object provided via an argument require
2744 * this to be true and invalidate the object pointed to by inner.
2747 } LDKChannelReestablish;
2752 * A channel_announcement message to be sent or received from a peer
2754 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
2756 * A pointer to the opaque Rust object.
2757 * Nearly everywhere, inner must be non-null, however in places where
2758 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2760 LDKnativeChannelAnnouncement *inner;
2762 * Indicates that this is the only struct which contains the same pointer.
2763 * Rust functions which take ownership of an object provided via an argument require
2764 * this to be true and invalidate the object pointed to by inner.
2767 } LDKChannelAnnouncement;
2772 * A channel_update message to be sent or received from a peer
2774 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
2776 * A pointer to the opaque Rust object.
2777 * Nearly everywhere, inner must be non-null, however in places where
2778 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2780 LDKnativeChannelUpdate *inner;
2782 * Indicates that this is the only struct which contains the same pointer.
2783 * Rust functions which take ownership of an object provided via an argument require
2784 * this to be true and invalidate the object pointed to by inner.
2792 * A node_announcement message to be sent or received from a peer
2794 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
2796 * A pointer to the opaque Rust object.
2797 * Nearly everywhere, inner must be non-null, however in places where
2798 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2800 LDKnativeNodeAnnouncement *inner;
2802 * Indicates that this is the only struct which contains the same pointer.
2803 * Rust functions which take ownership of an object provided via an argument require
2804 * this to be true and invalidate the object pointed to by inner.
2807 } LDKNodeAnnouncement;
2812 * An error message to be sent or received from a peer
2814 typedef struct MUST_USE_STRUCT LDKErrorMessage {
2816 * A pointer to the opaque Rust object.
2817 * Nearly everywhere, inner must be non-null, however in places where
2818 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2820 LDKnativeErrorMessage *inner;
2822 * Indicates that this is the only struct which contains the same pointer.
2823 * Rust functions which take ownership of an object provided via an argument require
2824 * this to be true and invalidate the object pointed to by inner.
2830 * Used to put an error message in a LightningError
2832 typedef enum LDKErrorAction_Tag {
2834 * The peer took some action which made us think they were useless. Disconnect them.
2836 LDKErrorAction_DisconnectPeer,
2838 * The peer did something harmless that we weren't able to process, just log and ignore
2840 LDKErrorAction_IgnoreError,
2842 * The peer did something incorrect. Tell them.
2844 LDKErrorAction_SendErrorMessage,
2846 * Must be last for serialization purposes
2848 LDKErrorAction_Sentinel,
2849 } LDKErrorAction_Tag;
2851 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
2853 * An error message which we should make an effort to send before we disconnect.
2855 struct LDKErrorMessage msg;
2856 } LDKErrorAction_LDKDisconnectPeer_Body;
2858 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
2860 * The message to send.
2862 struct LDKErrorMessage msg;
2863 } LDKErrorAction_LDKSendErrorMessage_Body;
2865 typedef struct MUST_USE_STRUCT LDKErrorAction {
2866 LDKErrorAction_Tag tag;
2868 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
2869 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
2874 * The information we received from a peer along the route of a payment we originated. This is
2875 * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
2876 * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
2878 typedef enum LDKHTLCFailChannelUpdate_Tag {
2880 * We received an error which included a full ChannelUpdate message.
2882 LDKHTLCFailChannelUpdate_ChannelUpdateMessage,
2884 * We received an error which indicated only that a channel has been closed
2886 LDKHTLCFailChannelUpdate_ChannelClosed,
2888 * We received an error which indicated only that a node has failed
2890 LDKHTLCFailChannelUpdate_NodeFailure,
2892 * Must be last for serialization purposes
2894 LDKHTLCFailChannelUpdate_Sentinel,
2895 } LDKHTLCFailChannelUpdate_Tag;
2897 typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body {
2899 * The unwrapped message we received
2901 struct LDKChannelUpdate msg;
2902 } LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
2904 typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
2906 * The short_channel_id which has now closed.
2908 uint64_t short_channel_id;
2910 * when this true, this channel should be permanently removed from the
2911 * consideration. Otherwise, this channel can be restored as new channel_update is received
2914 } LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
2916 typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
2918 * The node_id that has failed.
2920 struct LDKPublicKey node_id;
2922 * when this true, node should be permanently removed from the
2923 * consideration. Otherwise, the channels connected to this node can be
2924 * restored as new channel_update is received
2927 } LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
2929 typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate {
2930 LDKHTLCFailChannelUpdate_Tag tag;
2932 LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message;
2933 LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed;
2934 LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure;
2936 } LDKHTLCFailChannelUpdate;
2941 * A query_channel_range message is used to query a peer for channel
2942 * UTXOs in a range of blocks. The recipient of a query makes a best
2943 * effort to reply to the query using one or more reply_channel_range
2946 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
2948 * A pointer to the opaque Rust object.
2949 * Nearly everywhere, inner must be non-null, however in places where
2950 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2952 LDKnativeQueryChannelRange *inner;
2954 * Indicates that this is the only struct which contains the same pointer.
2955 * Rust functions which take ownership of an object provided via an argument require
2956 * this to be true and invalidate the object pointed to by inner.
2959 } LDKQueryChannelRange;
2964 * A query_short_channel_ids message is used to query a peer for
2965 * routing gossip messages related to one or more short_channel_ids.
2966 * The query recipient will reply with the latest, if available,
2967 * channel_announcement, channel_update and node_announcement messages
2968 * it maintains for the requested short_channel_ids followed by a
2969 * reply_short_channel_ids_end message. The short_channel_ids sent in
2970 * this query are encoded. We only support encoding_type=0 uncompressed
2971 * serialization and do not support encoding_type=1 zlib serialization.
2973 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
2975 * A pointer to the opaque Rust object.
2976 * Nearly everywhere, inner must be non-null, however in places where
2977 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2979 LDKnativeQueryShortChannelIds *inner;
2981 * Indicates that this is the only struct which contains the same pointer.
2982 * Rust functions which take ownership of an object provided via an argument require
2983 * this to be true and invalidate the object pointed to by inner.
2986 } LDKQueryShortChannelIds;
2991 * A reply_channel_range message is a reply to a query_channel_range
2992 * message. Multiple reply_channel_range messages can be sent in reply
2993 * to a single query_channel_range message. The query recipient makes a
2994 * best effort to respond based on their local network view which may
2995 * not be a perfect view of the network. The short_channel_ids in the
2996 * reply are encoded. We only support encoding_type=0 uncompressed
2997 * serialization and do not support encoding_type=1 zlib serialization.
2999 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
3001 * A pointer to the opaque Rust object.
3002 * Nearly everywhere, inner must be non-null, however in places where
3003 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3005 LDKnativeReplyChannelRange *inner;
3007 * Indicates that this is the only struct which contains the same pointer.
3008 * Rust functions which take ownership of an object provided via an argument require
3009 * this to be true and invalidate the object pointed to by inner.
3012 } LDKReplyChannelRange;
3015 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
3016 * broadcast to most peers).
3017 * These events are handled by PeerManager::process_events if you are using a PeerManager.
3019 typedef enum LDKMessageSendEvent_Tag {
3021 * Used to indicate that we've accepted a channel open and should send the accept_channel
3022 * message provided to the given peer.
3024 LDKMessageSendEvent_SendAcceptChannel,
3026 * Used to indicate that we've initiated a channel open and should send the open_channel
3027 * message provided to the given peer.
3029 LDKMessageSendEvent_SendOpenChannel,
3031 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
3033 LDKMessageSendEvent_SendFundingCreated,
3035 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
3037 LDKMessageSendEvent_SendFundingSigned,
3039 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
3041 LDKMessageSendEvent_SendFundingLocked,
3043 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
3045 LDKMessageSendEvent_SendAnnouncementSignatures,
3047 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
3048 * message should be sent to the peer with the given node_id.
3050 LDKMessageSendEvent_UpdateHTLCs,
3052 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
3054 LDKMessageSendEvent_SendRevokeAndACK,
3056 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
3058 LDKMessageSendEvent_SendClosingSigned,
3060 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
3062 LDKMessageSendEvent_SendShutdown,
3064 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
3066 LDKMessageSendEvent_SendChannelReestablish,
3068 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
3069 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
3071 * Note that after doing so, you very likely (unless you did so very recently) want to call
3072 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
3073 * This ensures that any nodes which see our channel_announcement also have a relevant
3074 * node_announcement, including relevant feature flags which may be important for routing
3077 LDKMessageSendEvent_BroadcastChannelAnnouncement,
3079 * Used to indicate that a node_announcement should be broadcast to all peers.
3081 LDKMessageSendEvent_BroadcastNodeAnnouncement,
3083 * Used to indicate that a channel_update should be broadcast to all peers.
3085 LDKMessageSendEvent_BroadcastChannelUpdate,
3087 * Broadcast an error downstream to be handled
3089 LDKMessageSendEvent_HandleError,
3091 * When a payment fails we may receive updates back from the hop where it failed. In such
3092 * cases this event is generated so that we can inform the network graph of this information.
3094 LDKMessageSendEvent_PaymentFailureNetworkUpdate,
3096 * Query a peer for channels with funding transaction UTXOs in a block range.
3098 LDKMessageSendEvent_SendChannelRangeQuery,
3100 * Request routing gossip messages from a peer for a list of channels identified by
3101 * their short_channel_ids.
3103 LDKMessageSendEvent_SendShortIdsQuery,
3105 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
3106 * emitted during processing of the query.
3108 LDKMessageSendEvent_SendReplyChannelRange,
3110 * Must be last for serialization purposes
3112 LDKMessageSendEvent_Sentinel,
3113 } LDKMessageSendEvent_Tag;
3115 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
3117 * The node_id of the node which should receive this message
3119 struct LDKPublicKey node_id;
3121 * The message which should be sent.
3123 struct LDKAcceptChannel msg;
3124 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
3126 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
3128 * The node_id of the node which should receive this message
3130 struct LDKPublicKey node_id;
3132 * The message which should be sent.
3134 struct LDKOpenChannel msg;
3135 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
3137 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
3139 * The node_id of the node which should receive this message
3141 struct LDKPublicKey node_id;
3143 * The message which should be sent.
3145 struct LDKFundingCreated msg;
3146 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
3148 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
3150 * The node_id of the node which should receive this message
3152 struct LDKPublicKey node_id;
3154 * The message which should be sent.
3156 struct LDKFundingSigned msg;
3157 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
3159 typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
3161 * The node_id of the node which should receive these message(s)
3163 struct LDKPublicKey node_id;
3165 * The funding_locked message which should be sent.
3167 struct LDKFundingLocked msg;
3168 } LDKMessageSendEvent_LDKSendFundingLocked_Body;
3170 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
3172 * The node_id of the node which should receive these message(s)
3174 struct LDKPublicKey node_id;
3176 * The announcement_signatures message which should be sent.
3178 struct LDKAnnouncementSignatures msg;
3179 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
3181 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
3183 * The node_id of the node which should receive these message(s)
3185 struct LDKPublicKey node_id;
3187 * The update messages which should be sent. ALL messages in the struct should be sent!
3189 struct LDKCommitmentUpdate updates;
3190 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
3192 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
3194 * The node_id of the node which should receive this message
3196 struct LDKPublicKey node_id;
3198 * The message which should be sent.
3200 struct LDKRevokeAndACK msg;
3201 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
3203 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
3205 * The node_id of the node which should receive this message
3207 struct LDKPublicKey node_id;
3209 * The message which should be sent.
3211 struct LDKClosingSigned msg;
3212 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
3214 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
3216 * The node_id of the node which should receive this message
3218 struct LDKPublicKey node_id;
3220 * The message which should be sent.
3222 struct LDKShutdown msg;
3223 } LDKMessageSendEvent_LDKSendShutdown_Body;
3225 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
3227 * The node_id of the node which should receive this message
3229 struct LDKPublicKey node_id;
3231 * The message which should be sent.
3233 struct LDKChannelReestablish msg;
3234 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
3236 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
3238 * The channel_announcement which should be sent.
3240 struct LDKChannelAnnouncement msg;
3242 * The followup channel_update which should be sent.
3244 struct LDKChannelUpdate update_msg;
3245 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
3247 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
3249 * The node_announcement which should be sent.
3251 struct LDKNodeAnnouncement msg;
3252 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
3254 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
3256 * The channel_update which should be sent.
3258 struct LDKChannelUpdate msg;
3259 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
3261 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
3263 * The node_id of the node which should receive this message
3265 struct LDKPublicKey node_id;
3267 * The action which should be taken.
3269 struct LDKErrorAction action;
3270 } LDKMessageSendEvent_LDKHandleError_Body;
3272 typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
3274 * The channel/node update which should be sent to NetGraphMsgHandler
3276 struct LDKHTLCFailChannelUpdate update;
3277 } LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
3279 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
3281 * The node_id of this message recipient
3283 struct LDKPublicKey node_id;
3285 * The query_channel_range which should be sent.
3287 struct LDKQueryChannelRange msg;
3288 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
3290 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
3292 * The node_id of this message recipient
3294 struct LDKPublicKey node_id;
3296 * The query_short_channel_ids which should be sent.
3298 struct LDKQueryShortChannelIds msg;
3299 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
3301 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
3303 * The node_id of this message recipient
3305 struct LDKPublicKey node_id;
3307 * The reply_channel_range which should be sent.
3309 struct LDKReplyChannelRange msg;
3310 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
3312 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
3313 LDKMessageSendEvent_Tag tag;
3315 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
3316 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
3317 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
3318 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
3319 LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
3320 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
3321 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
3322 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
3323 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
3324 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
3325 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
3326 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
3327 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
3328 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
3329 LDKMessageSendEvent_LDKHandleError_Body handle_error;
3330 LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update;
3331 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
3332 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
3333 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
3335 } LDKMessageSendEvent;
3338 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
3339 * This corresponds to std::vector in C++
3341 typedef struct LDKCVec_MessageSendEventZ {
3343 * The elements in the array.
3344 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3346 struct LDKMessageSendEvent *data;
3348 * The number of elements pointed to by `data`.
3351 } LDKCVec_MessageSendEventZ;
3354 * The contents of CResult_boolLightningErrorZ
3356 typedef union LDKCResult_boolLightningErrorZPtr {
3358 * A pointer to the contents in the success state.
3359 * Reading from this pointer when `result_ok` is not set is undefined.
3363 * A pointer to the contents in the error state.
3364 * Reading from this pointer when `result_ok` is set is undefined.
3366 struct LDKLightningError *err;
3367 } LDKCResult_boolLightningErrorZPtr;
3370 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
3371 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
3372 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3374 typedef struct LDKCResult_boolLightningErrorZ {
3376 * The contents of this CResult_boolLightningErrorZ, accessible via either
3377 * `err` or `result` depending on the state of `result_ok`.
3379 union LDKCResult_boolLightningErrorZPtr contents;
3381 * Whether this CResult_boolLightningErrorZ represents a success state.
3384 } LDKCResult_boolLightningErrorZ;
3387 * A tuple of 3 elements. See the individual fields for the types contained.
3389 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
3391 * The element at position 0
3393 struct LDKChannelAnnouncement a;
3395 * The element at position 1
3397 struct LDKChannelUpdate b;
3399 * The element at position 2
3401 struct LDKChannelUpdate c;
3402 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
3405 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
3406 * This corresponds to std::vector in C++
3408 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
3410 * The elements in the array.
3411 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3413 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
3415 * The number of elements pointed to by `data`.
3418 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
3421 * A dynamically-allocated array of crate::lightning::ln::msgs::NodeAnnouncements of arbitrary size.
3422 * This corresponds to std::vector in C++
3424 typedef struct LDKCVec_NodeAnnouncementZ {
3426 * The elements in the array.
3427 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3429 struct LDKNodeAnnouncement *data;
3431 * The number of elements pointed to by `data`.
3434 } LDKCVec_NodeAnnouncementZ;
3437 * The contents of CResult_NoneLightningErrorZ
3439 typedef union LDKCResult_NoneLightningErrorZPtr {
3441 * Note that this value is always NULL, as there are no contents in the OK variant
3445 * A pointer to the contents in the error state.
3446 * Reading from this pointer when `result_ok` is set is undefined.
3448 struct LDKLightningError *err;
3449 } LDKCResult_NoneLightningErrorZPtr;
3452 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
3453 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
3454 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3456 typedef struct LDKCResult_NoneLightningErrorZ {
3458 * The contents of this CResult_NoneLightningErrorZ, accessible via either
3459 * `err` or `result` depending on the state of `result_ok`.
3461 union LDKCResult_NoneLightningErrorZPtr contents;
3463 * Whether this CResult_NoneLightningErrorZ represents a success state.
3466 } LDKCResult_NoneLightningErrorZ;
3469 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
3470 * This corresponds to std::vector in C++
3472 typedef struct LDKCVec_PublicKeyZ {
3474 * The elements in the array.
3475 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3477 struct LDKPublicKey *data;
3479 * The number of elements pointed to by `data`.
3482 } LDKCVec_PublicKeyZ;
3487 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
3488 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
3491 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
3493 * A pointer to the opaque Rust object.
3494 * Nearly everywhere, inner must be non-null, however in places where
3495 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3497 LDKnativePeerHandleError *inner;
3499 * Indicates that this is the only struct which contains the same pointer.
3500 * Rust functions which take ownership of an object provided via an argument require
3501 * this to be true and invalidate the object pointed to by inner.
3504 } LDKPeerHandleError;
3507 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
3509 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
3511 * A pointer to the contents in the success state.
3512 * Reading from this pointer when `result_ok` is not set is undefined.
3514 struct LDKCVec_u8Z *result;
3516 * A pointer to the contents in the error state.
3517 * Reading from this pointer when `result_ok` is set is undefined.
3519 struct LDKPeerHandleError *err;
3520 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
3523 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
3524 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
3525 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3527 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
3529 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
3530 * `err` or `result` depending on the state of `result_ok`.
3532 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
3534 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
3537 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
3540 * The contents of CResult_NonePeerHandleErrorZ
3542 typedef union LDKCResult_NonePeerHandleErrorZPtr {
3544 * Note that this value is always NULL, as there are no contents in the OK variant
3548 * A pointer to the contents in the error state.
3549 * Reading from this pointer when `result_ok` is set is undefined.
3551 struct LDKPeerHandleError *err;
3552 } LDKCResult_NonePeerHandleErrorZPtr;
3555 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
3556 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
3557 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3559 typedef struct LDKCResult_NonePeerHandleErrorZ {
3561 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
3562 * `err` or `result` depending on the state of `result_ok`.
3564 union LDKCResult_NonePeerHandleErrorZPtr contents;
3566 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
3569 } LDKCResult_NonePeerHandleErrorZ;
3572 * The contents of CResult_boolPeerHandleErrorZ
3574 typedef union LDKCResult_boolPeerHandleErrorZPtr {
3576 * A pointer to the contents in the success state.
3577 * Reading from this pointer when `result_ok` is not set is undefined.
3581 * A pointer to the contents in the error state.
3582 * Reading from this pointer when `result_ok` is set is undefined.
3584 struct LDKPeerHandleError *err;
3585 } LDKCResult_boolPeerHandleErrorZPtr;
3588 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
3589 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
3590 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3592 typedef struct LDKCResult_boolPeerHandleErrorZ {
3594 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
3595 * `err` or `result` depending on the state of `result_ok`.
3597 union LDKCResult_boolPeerHandleErrorZPtr contents;
3599 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
3602 } LDKCResult_boolPeerHandleErrorZ;
3605 * The contents of CResult_TxOutAccessErrorZ
3607 typedef union LDKCResult_TxOutAccessErrorZPtr {
3609 * A pointer to the contents in the success state.
3610 * Reading from this pointer when `result_ok` is not set is undefined.
3612 struct LDKTxOut *result;
3614 * A pointer to the contents in the error state.
3615 * Reading from this pointer when `result_ok` is set is undefined.
3617 enum LDKAccessError *err;
3618 } LDKCResult_TxOutAccessErrorZPtr;
3621 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
3622 * containing a crate::c_types::TxOut on success and a crate::lightning::chain::AccessError on failure.
3623 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3625 typedef struct LDKCResult_TxOutAccessErrorZ {
3627 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
3628 * `err` or `result` depending on the state of `result_ok`.
3630 union LDKCResult_TxOutAccessErrorZPtr contents;
3632 * Whether this CResult_TxOutAccessErrorZ represents a success state.
3635 } LDKCResult_TxOutAccessErrorZ;
3638 * An enum which can either contain a crate::c_types::derived::C2Tuple_usizeTransactionZ or not
3640 typedef enum LDKCOption_C2Tuple_usizeTransactionZZ_Tag {
3642 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains a crate::c_types::derived::C2Tuple_usizeTransactionZ
3644 LDKCOption_C2Tuple_usizeTransactionZZ_Some,
3646 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains nothing
3648 LDKCOption_C2Tuple_usizeTransactionZZ_None,
3650 * Must be last for serialization purposes
3652 LDKCOption_C2Tuple_usizeTransactionZZ_Sentinel,
3653 } LDKCOption_C2Tuple_usizeTransactionZZ_Tag;
3655 typedef struct LDKCOption_C2Tuple_usizeTransactionZZ {
3656 LDKCOption_C2Tuple_usizeTransactionZZ_Tag tag;
3659 struct LDKC2Tuple_usizeTransactionZ some;
3662 } LDKCOption_C2Tuple_usizeTransactionZZ;
3667 * Details about one direction of a channel. Received
3668 * within a channel update.
3670 typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
3672 * A pointer to the opaque Rust object.
3673 * Nearly everywhere, inner must be non-null, however in places where
3674 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3676 LDKnativeDirectionalChannelInfo *inner;
3678 * Indicates that this is the only struct which contains the same pointer.
3679 * Rust functions which take ownership of an object provided via an argument require
3680 * this to be true and invalidate the object pointed to by inner.
3683 } LDKDirectionalChannelInfo;
3686 * The contents of CResult_DirectionalChannelInfoDecodeErrorZ
3688 typedef union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr {
3690 * A pointer to the contents in the success state.
3691 * Reading from this pointer when `result_ok` is not set is undefined.
3693 struct LDKDirectionalChannelInfo *result;
3695 * A pointer to the contents in the error state.
3696 * Reading from this pointer when `result_ok` is set is undefined.
3698 struct LDKDecodeError *err;
3699 } LDKCResult_DirectionalChannelInfoDecodeErrorZPtr;
3702 * A CResult_DirectionalChannelInfoDecodeErrorZ represents the result of a fallible operation,
3703 * containing a crate::lightning::routing::network_graph::DirectionalChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
3704 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3706 typedef struct LDKCResult_DirectionalChannelInfoDecodeErrorZ {
3708 * The contents of this CResult_DirectionalChannelInfoDecodeErrorZ, accessible via either
3709 * `err` or `result` depending on the state of `result_ok`.
3711 union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr contents;
3713 * Whether this CResult_DirectionalChannelInfoDecodeErrorZ represents a success state.
3716 } LDKCResult_DirectionalChannelInfoDecodeErrorZ;
3721 * Details about a channel (both directions).
3722 * Received within a channel announcement.
3724 typedef struct MUST_USE_STRUCT LDKChannelInfo {
3726 * A pointer to the opaque Rust object.
3727 * Nearly everywhere, inner must be non-null, however in places where
3728 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3730 LDKnativeChannelInfo *inner;
3732 * Indicates that this is the only struct which contains the same pointer.
3733 * Rust functions which take ownership of an object provided via an argument require
3734 * this to be true and invalidate the object pointed to by inner.
3740 * The contents of CResult_ChannelInfoDecodeErrorZ
3742 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
3744 * A pointer to the contents in the success state.
3745 * Reading from this pointer when `result_ok` is not set is undefined.
3747 struct LDKChannelInfo *result;
3749 * A pointer to the contents in the error state.
3750 * Reading from this pointer when `result_ok` is set is undefined.
3752 struct LDKDecodeError *err;
3753 } LDKCResult_ChannelInfoDecodeErrorZPtr;
3756 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
3757 * containing a crate::lightning::routing::network_graph::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
3758 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3760 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
3762 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
3763 * `err` or `result` depending on the state of `result_ok`.
3765 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
3767 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
3770 } LDKCResult_ChannelInfoDecodeErrorZ;
3775 * Fees for routing via a given channel or a node
3777 typedef struct MUST_USE_STRUCT LDKRoutingFees {
3779 * A pointer to the opaque Rust object.
3780 * Nearly everywhere, inner must be non-null, however in places where
3781 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3783 LDKnativeRoutingFees *inner;
3785 * Indicates that this is the only struct which contains the same pointer.
3786 * Rust functions which take ownership of an object provided via an argument require
3787 * this to be true and invalidate the object pointed to by inner.
3793 * The contents of CResult_RoutingFeesDecodeErrorZ
3795 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
3797 * A pointer to the contents in the success state.
3798 * Reading from this pointer when `result_ok` is not set is undefined.
3800 struct LDKRoutingFees *result;
3802 * A pointer to the contents in the error state.
3803 * Reading from this pointer when `result_ok` is set is undefined.
3805 struct LDKDecodeError *err;
3806 } LDKCResult_RoutingFeesDecodeErrorZPtr;
3809 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
3810 * containing a crate::lightning::routing::network_graph::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
3811 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3813 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
3815 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
3816 * `err` or `result` depending on the state of `result_ok`.
3818 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
3820 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
3823 } LDKCResult_RoutingFeesDecodeErrorZ;
3826 * A 4-byte byte array.
3828 typedef struct LDKFourBytes {
3836 * A 16-byte byte array.
3838 typedef struct LDKSixteenBytes {
3846 * A 10-byte byte array.
3848 typedef struct LDKTenBytes {
3856 * An address which can be used to connect to a remote peer
3858 typedef enum LDKNetAddress_Tag {
3860 * An IPv4 address/port on which the peer is listening.
3864 * An IPv6 address/port on which the peer is listening.
3868 * An old-style Tor onion address/port on which the peer is listening.
3870 LDKNetAddress_OnionV2,
3872 * A new-style Tor onion address/port on which the peer is listening.
3873 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
3874 * wrap as base32 and append \".onion\".
3876 LDKNetAddress_OnionV3,
3878 * Must be last for serialization purposes
3880 LDKNetAddress_Sentinel,
3881 } LDKNetAddress_Tag;
3883 typedef struct LDKNetAddress_LDKIPv4_Body {
3885 * The 4-byte IPv4 address
3887 struct LDKFourBytes addr;
3889 * The port on which the node is listening
3892 } LDKNetAddress_LDKIPv4_Body;
3894 typedef struct LDKNetAddress_LDKIPv6_Body {
3896 * The 16-byte IPv6 address
3898 struct LDKSixteenBytes addr;
3900 * The port on which the node is listening
3903 } LDKNetAddress_LDKIPv6_Body;
3905 typedef struct LDKNetAddress_LDKOnionV2_Body {
3907 * The bytes (usually encoded in base32 with \".onion\" appended)
3909 struct LDKTenBytes addr;
3911 * The port on which the node is listening
3914 } LDKNetAddress_LDKOnionV2_Body;
3916 typedef struct LDKNetAddress_LDKOnionV3_Body {
3918 * The ed25519 long-term public key of the peer
3920 struct LDKThirtyTwoBytes ed25519_pubkey;
3922 * The checksum of the pubkey and version, as included in the onion address
3926 * The version byte, as defined by the Tor Onion v3 spec.
3930 * The port on which the node is listening
3933 } LDKNetAddress_LDKOnionV3_Body;
3935 typedef struct MUST_USE_STRUCT LDKNetAddress {
3936 LDKNetAddress_Tag tag;
3938 LDKNetAddress_LDKIPv4_Body i_pv4;
3939 LDKNetAddress_LDKIPv6_Body i_pv6;
3940 LDKNetAddress_LDKOnionV2_Body onion_v2;
3941 LDKNetAddress_LDKOnionV3_Body onion_v3;
3946 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
3947 * This corresponds to std::vector in C++
3949 typedef struct LDKCVec_NetAddressZ {
3951 * The elements in the array.
3952 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3954 struct LDKNetAddress *data;
3956 * The number of elements pointed to by `data`.
3959 } LDKCVec_NetAddressZ;
3964 * Information received in the latest node_announcement from this node.
3966 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
3968 * A pointer to the opaque Rust object.
3969 * Nearly everywhere, inner must be non-null, however in places where
3970 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3972 LDKnativeNodeAnnouncementInfo *inner;
3974 * Indicates that this is the only struct which contains the same pointer.
3975 * Rust functions which take ownership of an object provided via an argument require
3976 * this to be true and invalidate the object pointed to by inner.
3979 } LDKNodeAnnouncementInfo;
3982 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
3984 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
3986 * A pointer to the contents in the success state.
3987 * Reading from this pointer when `result_ok` is not set is undefined.
3989 struct LDKNodeAnnouncementInfo *result;
3991 * A pointer to the contents in the error state.
3992 * Reading from this pointer when `result_ok` is set is undefined.
3994 struct LDKDecodeError *err;
3995 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
3998 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
3999 * containing a crate::lightning::routing::network_graph::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4000 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4002 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
4004 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
4005 * `err` or `result` depending on the state of `result_ok`.
4007 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
4009 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
4012 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
4015 * A dynamically-allocated array of u64s of arbitrary size.
4016 * This corresponds to std::vector in C++
4018 typedef struct LDKCVec_u64Z {
4020 * The elements in the array.
4021 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4025 * The number of elements pointed to by `data`.
4033 * Details about a node in the network, known from the network announcement.
4035 typedef struct MUST_USE_STRUCT LDKNodeInfo {
4037 * A pointer to the opaque Rust object.
4038 * Nearly everywhere, inner must be non-null, however in places where
4039 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4041 LDKnativeNodeInfo *inner;
4043 * Indicates that this is the only struct which contains the same pointer.
4044 * Rust functions which take ownership of an object provided via an argument require
4045 * this to be true and invalidate the object pointed to by inner.
4051 * The contents of CResult_NodeInfoDecodeErrorZ
4053 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
4055 * A pointer to the contents in the success state.
4056 * Reading from this pointer when `result_ok` is not set is undefined.
4058 struct LDKNodeInfo *result;
4060 * A pointer to the contents in the error state.
4061 * Reading from this pointer when `result_ok` is set is undefined.
4063 struct LDKDecodeError *err;
4064 } LDKCResult_NodeInfoDecodeErrorZPtr;
4067 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
4068 * containing a crate::lightning::routing::network_graph::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
4069 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4071 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
4073 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
4074 * `err` or `result` depending on the state of `result_ok`.
4076 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
4078 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
4081 } LDKCResult_NodeInfoDecodeErrorZ;
4086 * Represents the network as nodes and channels between them
4088 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
4090 * A pointer to the opaque Rust object.
4091 * Nearly everywhere, inner must be non-null, however in places where
4092 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4094 LDKnativeNetworkGraph *inner;
4096 * Indicates that this is the only struct which contains the same pointer.
4097 * Rust functions which take ownership of an object provided via an argument require
4098 * this to be true and invalidate the object pointed to by inner.
4104 * The contents of CResult_NetworkGraphDecodeErrorZ
4106 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
4108 * A pointer to the contents in the success state.
4109 * Reading from this pointer when `result_ok` is not set is undefined.
4111 struct LDKNetworkGraph *result;
4113 * A pointer to the contents in the error state.
4114 * Reading from this pointer when `result_ok` is set is undefined.
4116 struct LDKDecodeError *err;
4117 } LDKCResult_NetworkGraphDecodeErrorZPtr;
4120 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
4121 * containing a crate::lightning::routing::network_graph::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
4122 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4124 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
4126 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
4127 * `err` or `result` depending on the state of `result_ok`.
4129 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
4131 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
4134 } LDKCResult_NetworkGraphDecodeErrorZ;
4139 * Features used within an `init` message.
4141 typedef struct MUST_USE_STRUCT LDKInitFeatures {
4143 * A pointer to the opaque Rust object.
4144 * Nearly everywhere, inner must be non-null, however in places where
4145 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4147 LDKnativeInitFeatures *inner;
4149 * Indicates that this is the only struct which contains the same pointer.
4150 * Rust functions which take ownership of an object provided via an argument require
4151 * this to be true and invalidate the object pointed to by inner.
4157 * The contents of CResult_InitFeaturesDecodeErrorZ
4159 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
4161 * A pointer to the contents in the success state.
4162 * Reading from this pointer when `result_ok` is not set is undefined.
4164 struct LDKInitFeatures *result;
4166 * A pointer to the contents in the error state.
4167 * Reading from this pointer when `result_ok` is set is undefined.
4169 struct LDKDecodeError *err;
4170 } LDKCResult_InitFeaturesDecodeErrorZPtr;
4173 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
4174 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4175 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4177 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
4179 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
4180 * `err` or `result` depending on the state of `result_ok`.
4182 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
4184 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
4187 } LDKCResult_InitFeaturesDecodeErrorZ;
4192 * Features used within a `node_announcement` message.
4194 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
4196 * A pointer to the opaque Rust object.
4197 * Nearly everywhere, inner must be non-null, however in places where
4198 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4200 LDKnativeNodeFeatures *inner;
4202 * Indicates that this is the only struct which contains the same pointer.
4203 * Rust functions which take ownership of an object provided via an argument require
4204 * this to be true and invalidate the object pointed to by inner.
4210 * The contents of CResult_NodeFeaturesDecodeErrorZ
4212 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
4214 * A pointer to the contents in the success state.
4215 * Reading from this pointer when `result_ok` is not set is undefined.
4217 struct LDKNodeFeatures *result;
4219 * A pointer to the contents in the error state.
4220 * Reading from this pointer when `result_ok` is set is undefined.
4222 struct LDKDecodeError *err;
4223 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
4226 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
4227 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4228 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4230 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
4232 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
4233 * `err` or `result` depending on the state of `result_ok`.
4235 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
4237 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
4240 } LDKCResult_NodeFeaturesDecodeErrorZ;
4245 * Features used within a `channel_announcement` message.
4247 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
4249 * A pointer to the opaque Rust object.
4250 * Nearly everywhere, inner must be non-null, however in places where
4251 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4253 LDKnativeChannelFeatures *inner;
4255 * Indicates that this is the only struct which contains the same pointer.
4256 * Rust functions which take ownership of an object provided via an argument require
4257 * this to be true and invalidate the object pointed to by inner.
4260 } LDKChannelFeatures;
4263 * The contents of CResult_ChannelFeaturesDecodeErrorZ
4265 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
4267 * A pointer to the contents in the success state.
4268 * Reading from this pointer when `result_ok` is not set is undefined.
4270 struct LDKChannelFeatures *result;
4272 * A pointer to the contents in the error state.
4273 * Reading from this pointer when `result_ok` is set is undefined.
4275 struct LDKDecodeError *err;
4276 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
4279 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
4280 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4281 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4283 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
4285 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
4286 * `err` or `result` depending on the state of `result_ok`.
4288 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
4290 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
4293 } LDKCResult_ChannelFeaturesDecodeErrorZ;
4298 * Features used within an invoice.
4300 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
4302 * A pointer to the opaque Rust object.
4303 * Nearly everywhere, inner must be non-null, however in places where
4304 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4306 LDKnativeInvoiceFeatures *inner;
4308 * Indicates that this is the only struct which contains the same pointer.
4309 * Rust functions which take ownership of an object provided via an argument require
4310 * this to be true and invalidate the object pointed to by inner.
4313 } LDKInvoiceFeatures;
4316 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
4318 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
4320 * A pointer to the contents in the success state.
4321 * Reading from this pointer when `result_ok` is not set is undefined.
4323 struct LDKInvoiceFeatures *result;
4325 * A pointer to the contents in the error state.
4326 * Reading from this pointer when `result_ok` is set is undefined.
4328 struct LDKDecodeError *err;
4329 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
4332 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
4333 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4334 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4336 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
4338 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
4339 * `err` or `result` depending on the state of `result_ok`.
4341 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
4343 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
4346 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
4349 * The contents of CResult_NetAddressu8Z
4351 typedef union LDKCResult_NetAddressu8ZPtr {
4353 * A pointer to the contents in the success state.
4354 * Reading from this pointer when `result_ok` is not set is undefined.
4356 struct LDKNetAddress *result;
4358 * A pointer to the contents in the error state.
4359 * Reading from this pointer when `result_ok` is set is undefined.
4362 } LDKCResult_NetAddressu8ZPtr;
4365 * A CResult_NetAddressu8Z represents the result of a fallible operation,
4366 * containing a crate::lightning::ln::msgs::NetAddress on success and a u8 on failure.
4367 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4369 typedef struct LDKCResult_NetAddressu8Z {
4371 * The contents of this CResult_NetAddressu8Z, accessible via either
4372 * `err` or `result` depending on the state of `result_ok`.
4374 union LDKCResult_NetAddressu8ZPtr contents;
4376 * Whether this CResult_NetAddressu8Z represents a success state.
4379 } LDKCResult_NetAddressu8Z;
4382 * The contents of CResult_CResult_NetAddressu8ZDecodeErrorZ
4384 typedef union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr {
4386 * A pointer to the contents in the success state.
4387 * Reading from this pointer when `result_ok` is not set is undefined.
4389 struct LDKCResult_NetAddressu8Z *result;
4391 * A pointer to the contents in the error state.
4392 * Reading from this pointer when `result_ok` is set is undefined.
4394 struct LDKDecodeError *err;
4395 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr;
4398 * A CResult_CResult_NetAddressu8ZDecodeErrorZ represents the result of a fallible operation,
4399 * containing a crate::c_types::derived::CResult_NetAddressu8Z on success and a crate::lightning::ln::msgs::DecodeError on failure.
4400 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4402 typedef struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ {
4404 * The contents of this CResult_CResult_NetAddressu8ZDecodeErrorZ, accessible via either
4405 * `err` or `result` depending on the state of `result_ok`.
4407 union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr contents;
4409 * Whether this CResult_CResult_NetAddressu8ZDecodeErrorZ represents a success state.
4412 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZ;
4417 * An update_add_htlc message to be sent or received from a peer
4419 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
4421 * A pointer to the opaque Rust object.
4422 * Nearly everywhere, inner must be non-null, however in places where
4423 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4425 LDKnativeUpdateAddHTLC *inner;
4427 * Indicates that this is the only struct which contains the same pointer.
4428 * Rust functions which take ownership of an object provided via an argument require
4429 * this to be true and invalidate the object pointed to by inner.
4435 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
4436 * This corresponds to std::vector in C++
4438 typedef struct LDKCVec_UpdateAddHTLCZ {
4440 * The elements in the array.
4441 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4443 struct LDKUpdateAddHTLC *data;
4445 * The number of elements pointed to by `data`.
4448 } LDKCVec_UpdateAddHTLCZ;
4453 * An update_fulfill_htlc message to be sent or received from a peer
4455 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
4457 * A pointer to the opaque Rust object.
4458 * Nearly everywhere, inner must be non-null, however in places where
4459 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4461 LDKnativeUpdateFulfillHTLC *inner;
4463 * Indicates that this is the only struct which contains the same pointer.
4464 * Rust functions which take ownership of an object provided via an argument require
4465 * this to be true and invalidate the object pointed to by inner.
4468 } LDKUpdateFulfillHTLC;
4471 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
4472 * This corresponds to std::vector in C++
4474 typedef struct LDKCVec_UpdateFulfillHTLCZ {
4476 * The elements in the array.
4477 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4479 struct LDKUpdateFulfillHTLC *data;
4481 * The number of elements pointed to by `data`.
4484 } LDKCVec_UpdateFulfillHTLCZ;
4489 * An update_fail_htlc message to be sent or received from a peer
4491 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
4493 * A pointer to the opaque Rust object.
4494 * Nearly everywhere, inner must be non-null, however in places where
4495 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4497 LDKnativeUpdateFailHTLC *inner;
4499 * Indicates that this is the only struct which contains the same pointer.
4500 * Rust functions which take ownership of an object provided via an argument require
4501 * this to be true and invalidate the object pointed to by inner.
4504 } LDKUpdateFailHTLC;
4507 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
4508 * This corresponds to std::vector in C++
4510 typedef struct LDKCVec_UpdateFailHTLCZ {
4512 * The elements in the array.
4513 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4515 struct LDKUpdateFailHTLC *data;
4517 * The number of elements pointed to by `data`.
4520 } LDKCVec_UpdateFailHTLCZ;
4525 * An update_fail_malformed_htlc message to be sent or received from a peer
4527 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
4529 * A pointer to the opaque Rust object.
4530 * Nearly everywhere, inner must be non-null, however in places where
4531 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4533 LDKnativeUpdateFailMalformedHTLC *inner;
4535 * Indicates that this is the only struct which contains the same pointer.
4536 * Rust functions which take ownership of an object provided via an argument require
4537 * this to be true and invalidate the object pointed to by inner.
4540 } LDKUpdateFailMalformedHTLC;
4543 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
4544 * This corresponds to std::vector in C++
4546 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
4548 * The elements in the array.
4549 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4551 struct LDKUpdateFailMalformedHTLC *data;
4553 * The number of elements pointed to by `data`.
4556 } LDKCVec_UpdateFailMalformedHTLCZ;
4559 * The contents of CResult_AcceptChannelDecodeErrorZ
4561 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
4563 * A pointer to the contents in the success state.
4564 * Reading from this pointer when `result_ok` is not set is undefined.
4566 struct LDKAcceptChannel *result;
4568 * A pointer to the contents in the error state.
4569 * Reading from this pointer when `result_ok` is set is undefined.
4571 struct LDKDecodeError *err;
4572 } LDKCResult_AcceptChannelDecodeErrorZPtr;
4575 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
4576 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
4577 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4579 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
4581 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
4582 * `err` or `result` depending on the state of `result_ok`.
4584 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
4586 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
4589 } LDKCResult_AcceptChannelDecodeErrorZ;
4592 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
4594 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
4596 * A pointer to the contents in the success state.
4597 * Reading from this pointer when `result_ok` is not set is undefined.
4599 struct LDKAnnouncementSignatures *result;
4601 * A pointer to the contents in the error state.
4602 * Reading from this pointer when `result_ok` is set is undefined.
4604 struct LDKDecodeError *err;
4605 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
4608 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
4609 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4610 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4612 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
4614 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
4615 * `err` or `result` depending on the state of `result_ok`.
4617 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
4619 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
4622 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
4625 * The contents of CResult_ChannelReestablishDecodeErrorZ
4627 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
4629 * A pointer to the contents in the success state.
4630 * Reading from this pointer when `result_ok` is not set is undefined.
4632 struct LDKChannelReestablish *result;
4634 * A pointer to the contents in the error state.
4635 * Reading from this pointer when `result_ok` is set is undefined.
4637 struct LDKDecodeError *err;
4638 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
4641 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
4642 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
4643 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4645 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
4647 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
4648 * `err` or `result` depending on the state of `result_ok`.
4650 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
4652 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
4655 } LDKCResult_ChannelReestablishDecodeErrorZ;
4658 * The contents of CResult_ClosingSignedDecodeErrorZ
4660 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
4662 * A pointer to the contents in the success state.
4663 * Reading from this pointer when `result_ok` is not set is undefined.
4665 struct LDKClosingSigned *result;
4667 * A pointer to the contents in the error state.
4668 * Reading from this pointer when `result_ok` is set is undefined.
4670 struct LDKDecodeError *err;
4671 } LDKCResult_ClosingSignedDecodeErrorZPtr;
4674 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
4675 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
4676 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4678 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
4680 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
4681 * `err` or `result` depending on the state of `result_ok`.
4683 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
4685 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
4688 } LDKCResult_ClosingSignedDecodeErrorZ;
4693 * A commitment_signed message to be sent or received from a peer
4695 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
4697 * A pointer to the opaque Rust object.
4698 * Nearly everywhere, inner must be non-null, however in places where
4699 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4701 LDKnativeCommitmentSigned *inner;
4703 * Indicates that this is the only struct which contains the same pointer.
4704 * Rust functions which take ownership of an object provided via an argument require
4705 * this to be true and invalidate the object pointed to by inner.
4708 } LDKCommitmentSigned;
4711 * The contents of CResult_CommitmentSignedDecodeErrorZ
4713 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
4715 * A pointer to the contents in the success state.
4716 * Reading from this pointer when `result_ok` is not set is undefined.
4718 struct LDKCommitmentSigned *result;
4720 * A pointer to the contents in the error state.
4721 * Reading from this pointer when `result_ok` is set is undefined.
4723 struct LDKDecodeError *err;
4724 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
4727 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
4728 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
4729 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4731 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
4733 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
4734 * `err` or `result` depending on the state of `result_ok`.
4736 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
4738 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
4741 } LDKCResult_CommitmentSignedDecodeErrorZ;
4744 * The contents of CResult_FundingCreatedDecodeErrorZ
4746 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
4748 * A pointer to the contents in the success state.
4749 * Reading from this pointer when `result_ok` is not set is undefined.
4751 struct LDKFundingCreated *result;
4753 * A pointer to the contents in the error state.
4754 * Reading from this pointer when `result_ok` is set is undefined.
4756 struct LDKDecodeError *err;
4757 } LDKCResult_FundingCreatedDecodeErrorZPtr;
4760 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
4761 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
4762 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4764 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
4766 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
4767 * `err` or `result` depending on the state of `result_ok`.
4769 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
4771 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
4774 } LDKCResult_FundingCreatedDecodeErrorZ;
4777 * The contents of CResult_FundingSignedDecodeErrorZ
4779 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
4781 * A pointer to the contents in the success state.
4782 * Reading from this pointer when `result_ok` is not set is undefined.
4784 struct LDKFundingSigned *result;
4786 * A pointer to the contents in the error state.
4787 * Reading from this pointer when `result_ok` is set is undefined.
4789 struct LDKDecodeError *err;
4790 } LDKCResult_FundingSignedDecodeErrorZPtr;
4793 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
4794 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
4795 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4797 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
4799 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
4800 * `err` or `result` depending on the state of `result_ok`.
4802 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
4804 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
4807 } LDKCResult_FundingSignedDecodeErrorZ;
4810 * The contents of CResult_FundingLockedDecodeErrorZ
4812 typedef union LDKCResult_FundingLockedDecodeErrorZPtr {
4814 * A pointer to the contents in the success state.
4815 * Reading from this pointer when `result_ok` is not set is undefined.
4817 struct LDKFundingLocked *result;
4819 * A pointer to the contents in the error state.
4820 * Reading from this pointer when `result_ok` is set is undefined.
4822 struct LDKDecodeError *err;
4823 } LDKCResult_FundingLockedDecodeErrorZPtr;
4826 * A CResult_FundingLockedDecodeErrorZ represents the result of a fallible operation,
4827 * containing a crate::lightning::ln::msgs::FundingLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
4828 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4830 typedef struct LDKCResult_FundingLockedDecodeErrorZ {
4832 * The contents of this CResult_FundingLockedDecodeErrorZ, accessible via either
4833 * `err` or `result` depending on the state of `result_ok`.
4835 union LDKCResult_FundingLockedDecodeErrorZPtr contents;
4837 * Whether this CResult_FundingLockedDecodeErrorZ represents a success state.
4840 } LDKCResult_FundingLockedDecodeErrorZ;
4845 * An init message to be sent or received from a peer
4847 typedef struct MUST_USE_STRUCT LDKInit {
4849 * A pointer to the opaque Rust object.
4850 * Nearly everywhere, inner must be non-null, however in places where
4851 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4853 LDKnativeInit *inner;
4855 * Indicates that this is the only struct which contains the same pointer.
4856 * Rust functions which take ownership of an object provided via an argument require
4857 * this to be true and invalidate the object pointed to by inner.
4863 * The contents of CResult_InitDecodeErrorZ
4865 typedef union LDKCResult_InitDecodeErrorZPtr {
4867 * A pointer to the contents in the success state.
4868 * Reading from this pointer when `result_ok` is not set is undefined.
4870 struct LDKInit *result;
4872 * A pointer to the contents in the error state.
4873 * Reading from this pointer when `result_ok` is set is undefined.
4875 struct LDKDecodeError *err;
4876 } LDKCResult_InitDecodeErrorZPtr;
4879 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
4880 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
4881 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4883 typedef struct LDKCResult_InitDecodeErrorZ {
4885 * The contents of this CResult_InitDecodeErrorZ, accessible via either
4886 * `err` or `result` depending on the state of `result_ok`.
4888 union LDKCResult_InitDecodeErrorZPtr contents;
4890 * Whether this CResult_InitDecodeErrorZ represents a success state.
4893 } LDKCResult_InitDecodeErrorZ;
4896 * The contents of CResult_OpenChannelDecodeErrorZ
4898 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
4900 * A pointer to the contents in the success state.
4901 * Reading from this pointer when `result_ok` is not set is undefined.
4903 struct LDKOpenChannel *result;
4905 * A pointer to the contents in the error state.
4906 * Reading from this pointer when `result_ok` is set is undefined.
4908 struct LDKDecodeError *err;
4909 } LDKCResult_OpenChannelDecodeErrorZPtr;
4912 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
4913 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
4914 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4916 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
4918 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
4919 * `err` or `result` depending on the state of `result_ok`.
4921 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
4923 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
4926 } LDKCResult_OpenChannelDecodeErrorZ;
4929 * The contents of CResult_RevokeAndACKDecodeErrorZ
4931 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
4933 * A pointer to the contents in the success state.
4934 * Reading from this pointer when `result_ok` is not set is undefined.
4936 struct LDKRevokeAndACK *result;
4938 * A pointer to the contents in the error state.
4939 * Reading from this pointer when `result_ok` is set is undefined.
4941 struct LDKDecodeError *err;
4942 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
4945 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
4946 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
4947 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4949 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
4951 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
4952 * `err` or `result` depending on the state of `result_ok`.
4954 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
4956 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
4959 } LDKCResult_RevokeAndACKDecodeErrorZ;
4962 * The contents of CResult_ShutdownDecodeErrorZ
4964 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
4966 * A pointer to the contents in the success state.
4967 * Reading from this pointer when `result_ok` is not set is undefined.
4969 struct LDKShutdown *result;
4971 * A pointer to the contents in the error state.
4972 * Reading from this pointer when `result_ok` is set is undefined.
4974 struct LDKDecodeError *err;
4975 } LDKCResult_ShutdownDecodeErrorZPtr;
4978 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
4979 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
4980 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4982 typedef struct LDKCResult_ShutdownDecodeErrorZ {
4984 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
4985 * `err` or `result` depending on the state of `result_ok`.
4987 union LDKCResult_ShutdownDecodeErrorZPtr contents;
4989 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
4992 } LDKCResult_ShutdownDecodeErrorZ;
4995 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
4997 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
4999 * A pointer to the contents in the success state.
5000 * Reading from this pointer when `result_ok` is not set is undefined.
5002 struct LDKUpdateFailHTLC *result;
5004 * A pointer to the contents in the error state.
5005 * Reading from this pointer when `result_ok` is set is undefined.
5007 struct LDKDecodeError *err;
5008 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
5011 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
5012 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5013 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5015 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
5017 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
5018 * `err` or `result` depending on the state of `result_ok`.
5020 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
5022 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
5025 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
5028 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
5030 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5032 * A pointer to the contents in the success state.
5033 * Reading from this pointer when `result_ok` is not set is undefined.
5035 struct LDKUpdateFailMalformedHTLC *result;
5037 * A pointer to the contents in the error state.
5038 * Reading from this pointer when `result_ok` is set is undefined.
5040 struct LDKDecodeError *err;
5041 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
5044 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
5045 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5046 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5048 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
5050 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
5051 * `err` or `result` depending on the state of `result_ok`.
5053 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
5055 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
5058 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
5063 * An update_fee message to be sent or received from a peer
5065 typedef struct MUST_USE_STRUCT LDKUpdateFee {
5067 * A pointer to the opaque Rust object.
5068 * Nearly everywhere, inner must be non-null, however in places where
5069 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5071 LDKnativeUpdateFee *inner;
5073 * Indicates that this is the only struct which contains the same pointer.
5074 * Rust functions which take ownership of an object provided via an argument require
5075 * this to be true and invalidate the object pointed to by inner.
5081 * The contents of CResult_UpdateFeeDecodeErrorZ
5083 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
5085 * A pointer to the contents in the success state.
5086 * Reading from this pointer when `result_ok` is not set is undefined.
5088 struct LDKUpdateFee *result;
5090 * A pointer to the contents in the error state.
5091 * Reading from this pointer when `result_ok` is set is undefined.
5093 struct LDKDecodeError *err;
5094 } LDKCResult_UpdateFeeDecodeErrorZPtr;
5097 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
5098 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
5099 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5101 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
5103 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
5104 * `err` or `result` depending on the state of `result_ok`.
5106 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
5108 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
5111 } LDKCResult_UpdateFeeDecodeErrorZ;
5114 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
5116 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
5118 * A pointer to the contents in the success state.
5119 * Reading from this pointer when `result_ok` is not set is undefined.
5121 struct LDKUpdateFulfillHTLC *result;
5123 * A pointer to the contents in the error state.
5124 * Reading from this pointer when `result_ok` is set is undefined.
5126 struct LDKDecodeError *err;
5127 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
5130 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
5131 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5132 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5134 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
5136 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
5137 * `err` or `result` depending on the state of `result_ok`.
5139 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
5141 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
5144 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
5147 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
5149 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
5151 * A pointer to the contents in the success state.
5152 * Reading from this pointer when `result_ok` is not set is undefined.
5154 struct LDKUpdateAddHTLC *result;
5156 * A pointer to the contents in the error state.
5157 * Reading from this pointer when `result_ok` is set is undefined.
5159 struct LDKDecodeError *err;
5160 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
5163 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
5164 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
5165 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5167 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
5169 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
5170 * `err` or `result` depending on the state of `result_ok`.
5172 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
5174 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
5177 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
5182 * A ping message to be sent or received from a peer
5184 typedef struct MUST_USE_STRUCT LDKPing {
5186 * A pointer to the opaque Rust object.
5187 * Nearly everywhere, inner must be non-null, however in places where
5188 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5190 LDKnativePing *inner;
5192 * Indicates that this is the only struct which contains the same pointer.
5193 * Rust functions which take ownership of an object provided via an argument require
5194 * this to be true and invalidate the object pointed to by inner.
5200 * The contents of CResult_PingDecodeErrorZ
5202 typedef union LDKCResult_PingDecodeErrorZPtr {
5204 * A pointer to the contents in the success state.
5205 * Reading from this pointer when `result_ok` is not set is undefined.
5207 struct LDKPing *result;
5209 * A pointer to the contents in the error state.
5210 * Reading from this pointer when `result_ok` is set is undefined.
5212 struct LDKDecodeError *err;
5213 } LDKCResult_PingDecodeErrorZPtr;
5216 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
5217 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
5218 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5220 typedef struct LDKCResult_PingDecodeErrorZ {
5222 * The contents of this CResult_PingDecodeErrorZ, accessible via either
5223 * `err` or `result` depending on the state of `result_ok`.
5225 union LDKCResult_PingDecodeErrorZPtr contents;
5227 * Whether this CResult_PingDecodeErrorZ represents a success state.
5230 } LDKCResult_PingDecodeErrorZ;
5235 * A pong message to be sent or received from a peer
5237 typedef struct MUST_USE_STRUCT LDKPong {
5239 * A pointer to the opaque Rust object.
5240 * Nearly everywhere, inner must be non-null, however in places where
5241 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5243 LDKnativePong *inner;
5245 * Indicates that this is the only struct which contains the same pointer.
5246 * Rust functions which take ownership of an object provided via an argument require
5247 * this to be true and invalidate the object pointed to by inner.
5253 * The contents of CResult_PongDecodeErrorZ
5255 typedef union LDKCResult_PongDecodeErrorZPtr {
5257 * A pointer to the contents in the success state.
5258 * Reading from this pointer when `result_ok` is not set is undefined.
5260 struct LDKPong *result;
5262 * A pointer to the contents in the error state.
5263 * Reading from this pointer when `result_ok` is set is undefined.
5265 struct LDKDecodeError *err;
5266 } LDKCResult_PongDecodeErrorZPtr;
5269 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
5270 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
5271 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5273 typedef struct LDKCResult_PongDecodeErrorZ {
5275 * The contents of this CResult_PongDecodeErrorZ, accessible via either
5276 * `err` or `result` depending on the state of `result_ok`.
5278 union LDKCResult_PongDecodeErrorZPtr contents;
5280 * Whether this CResult_PongDecodeErrorZ represents a success state.
5283 } LDKCResult_PongDecodeErrorZ;
5286 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
5288 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
5290 * A pointer to the contents in the success state.
5291 * Reading from this pointer when `result_ok` is not set is undefined.
5293 struct LDKUnsignedChannelAnnouncement *result;
5295 * A pointer to the contents in the error state.
5296 * Reading from this pointer when `result_ok` is set is undefined.
5298 struct LDKDecodeError *err;
5299 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
5302 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
5303 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
5304 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5306 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
5308 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
5309 * `err` or `result` depending on the state of `result_ok`.
5311 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
5313 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
5316 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
5319 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
5321 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
5323 * A pointer to the contents in the success state.
5324 * Reading from this pointer when `result_ok` is not set is undefined.
5326 struct LDKChannelAnnouncement *result;
5328 * A pointer to the contents in the error state.
5329 * Reading from this pointer when `result_ok` is set is undefined.
5331 struct LDKDecodeError *err;
5332 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
5335 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
5336 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
5337 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5339 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
5341 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
5342 * `err` or `result` depending on the state of `result_ok`.
5344 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
5346 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
5349 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
5354 * The unsigned part of a channel_update
5356 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
5358 * A pointer to the opaque Rust object.
5359 * Nearly everywhere, inner must be non-null, however in places where
5360 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5362 LDKnativeUnsignedChannelUpdate *inner;
5364 * Indicates that this is the only struct which contains the same pointer.
5365 * Rust functions which take ownership of an object provided via an argument require
5366 * this to be true and invalidate the object pointed to by inner.
5369 } LDKUnsignedChannelUpdate;
5372 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
5374 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
5376 * A pointer to the contents in the success state.
5377 * Reading from this pointer when `result_ok` is not set is undefined.
5379 struct LDKUnsignedChannelUpdate *result;
5381 * A pointer to the contents in the error state.
5382 * Reading from this pointer when `result_ok` is set is undefined.
5384 struct LDKDecodeError *err;
5385 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
5388 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
5389 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
5390 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5392 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
5394 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
5395 * `err` or `result` depending on the state of `result_ok`.
5397 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
5399 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
5402 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
5405 * The contents of CResult_ChannelUpdateDecodeErrorZ
5407 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
5409 * A pointer to the contents in the success state.
5410 * Reading from this pointer when `result_ok` is not set is undefined.
5412 struct LDKChannelUpdate *result;
5414 * A pointer to the contents in the error state.
5415 * Reading from this pointer when `result_ok` is set is undefined.
5417 struct LDKDecodeError *err;
5418 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
5421 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
5422 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
5423 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5425 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
5427 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
5428 * `err` or `result` depending on the state of `result_ok`.
5430 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
5432 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
5435 } LDKCResult_ChannelUpdateDecodeErrorZ;
5438 * The contents of CResult_ErrorMessageDecodeErrorZ
5440 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
5442 * A pointer to the contents in the success state.
5443 * Reading from this pointer when `result_ok` is not set is undefined.
5445 struct LDKErrorMessage *result;
5447 * A pointer to the contents in the error state.
5448 * Reading from this pointer when `result_ok` is set is undefined.
5450 struct LDKDecodeError *err;
5451 } LDKCResult_ErrorMessageDecodeErrorZPtr;
5454 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
5455 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
5456 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5458 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
5460 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
5461 * `err` or `result` depending on the state of `result_ok`.
5463 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
5465 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
5468 } LDKCResult_ErrorMessageDecodeErrorZ;
5473 * The unsigned part of a node_announcement
5475 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
5477 * A pointer to the opaque Rust object.
5478 * Nearly everywhere, inner must be non-null, however in places where
5479 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5481 LDKnativeUnsignedNodeAnnouncement *inner;
5483 * Indicates that this is the only struct which contains the same pointer.
5484 * Rust functions which take ownership of an object provided via an argument require
5485 * this to be true and invalidate the object pointed to by inner.
5488 } LDKUnsignedNodeAnnouncement;
5491 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
5493 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
5495 * A pointer to the contents in the success state.
5496 * Reading from this pointer when `result_ok` is not set is undefined.
5498 struct LDKUnsignedNodeAnnouncement *result;
5500 * A pointer to the contents in the error state.
5501 * Reading from this pointer when `result_ok` is set is undefined.
5503 struct LDKDecodeError *err;
5504 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
5507 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
5508 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
5509 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5511 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
5513 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
5514 * `err` or `result` depending on the state of `result_ok`.
5516 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
5518 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
5521 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
5524 * The contents of CResult_NodeAnnouncementDecodeErrorZ
5526 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
5528 * A pointer to the contents in the success state.
5529 * Reading from this pointer when `result_ok` is not set is undefined.
5531 struct LDKNodeAnnouncement *result;
5533 * A pointer to the contents in the error state.
5534 * Reading from this pointer when `result_ok` is set is undefined.
5536 struct LDKDecodeError *err;
5537 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
5540 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
5541 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
5542 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5544 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
5546 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
5547 * `err` or `result` depending on the state of `result_ok`.
5549 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
5551 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
5554 } LDKCResult_NodeAnnouncementDecodeErrorZ;
5557 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
5559 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
5561 * A pointer to the contents in the success state.
5562 * Reading from this pointer when `result_ok` is not set is undefined.
5564 struct LDKQueryShortChannelIds *result;
5566 * A pointer to the contents in the error state.
5567 * Reading from this pointer when `result_ok` is set is undefined.
5569 struct LDKDecodeError *err;
5570 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
5573 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
5574 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
5575 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5577 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
5579 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
5580 * `err` or `result` depending on the state of `result_ok`.
5582 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
5584 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
5587 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
5592 * A reply_short_channel_ids_end message is sent as a reply to a
5593 * query_short_channel_ids message. The query recipient makes a best
5594 * effort to respond based on their local network view which may not be
5595 * a perfect view of the network.
5597 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
5599 * A pointer to the opaque Rust object.
5600 * Nearly everywhere, inner must be non-null, however in places where
5601 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5603 LDKnativeReplyShortChannelIdsEnd *inner;
5605 * Indicates that this is the only struct which contains the same pointer.
5606 * Rust functions which take ownership of an object provided via an argument require
5607 * this to be true and invalidate the object pointed to by inner.
5610 } LDKReplyShortChannelIdsEnd;
5613 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
5615 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
5617 * A pointer to the contents in the success state.
5618 * Reading from this pointer when `result_ok` is not set is undefined.
5620 struct LDKReplyShortChannelIdsEnd *result;
5622 * A pointer to the contents in the error state.
5623 * Reading from this pointer when `result_ok` is set is undefined.
5625 struct LDKDecodeError *err;
5626 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
5629 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
5630 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
5631 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5633 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
5635 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
5636 * `err` or `result` depending on the state of `result_ok`.
5638 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
5640 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
5643 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
5646 * The contents of CResult_QueryChannelRangeDecodeErrorZ
5648 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
5650 * A pointer to the contents in the success state.
5651 * Reading from this pointer when `result_ok` is not set is undefined.
5653 struct LDKQueryChannelRange *result;
5655 * A pointer to the contents in the error state.
5656 * Reading from this pointer when `result_ok` is set is undefined.
5658 struct LDKDecodeError *err;
5659 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
5662 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
5663 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
5664 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5666 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
5668 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
5669 * `err` or `result` depending on the state of `result_ok`.
5671 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
5673 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
5676 } LDKCResult_QueryChannelRangeDecodeErrorZ;
5679 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
5681 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
5683 * A pointer to the contents in the success state.
5684 * Reading from this pointer when `result_ok` is not set is undefined.
5686 struct LDKReplyChannelRange *result;
5688 * A pointer to the contents in the error state.
5689 * Reading from this pointer when `result_ok` is set is undefined.
5691 struct LDKDecodeError *err;
5692 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
5695 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
5696 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
5697 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5699 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
5701 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
5702 * `err` or `result` depending on the state of `result_ok`.
5704 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
5706 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
5709 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
5714 * A gossip_timestamp_filter message is used by a node to request
5715 * gossip relay for messages in the requested time range when the
5716 * gossip_queries feature has been negotiated.
5718 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
5720 * A pointer to the opaque Rust object.
5721 * Nearly everywhere, inner must be non-null, however in places where
5722 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5724 LDKnativeGossipTimestampFilter *inner;
5726 * Indicates that this is the only struct which contains the same pointer.
5727 * Rust functions which take ownership of an object provided via an argument require
5728 * this to be true and invalidate the object pointed to by inner.
5731 } LDKGossipTimestampFilter;
5734 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
5736 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
5738 * A pointer to the contents in the success state.
5739 * Reading from this pointer when `result_ok` is not set is undefined.
5741 struct LDKGossipTimestampFilter *result;
5743 * A pointer to the contents in the error state.
5744 * Reading from this pointer when `result_ok` is set is undefined.
5746 struct LDKDecodeError *err;
5747 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
5750 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
5751 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
5752 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5754 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
5756 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
5757 * `err` or `result` depending on the state of `result_ok`.
5759 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
5761 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
5764 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
5767 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
5769 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
5771 * A pointer to the contents in the success state.
5772 * Reading from this pointer when `result_ok` is not set is undefined.
5774 struct LDKSpendableOutputDescriptor *result;
5776 * A pointer to the contents in the error state.
5777 * Reading from this pointer when `result_ok` is set is undefined.
5779 struct LDKDecodeError *err;
5780 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
5783 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
5784 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
5785 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5787 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
5789 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
5790 * `err` or `result` depending on the state of `result_ok`.
5792 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
5794 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
5797 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
5800 * The contents of CResult_SignDecodeErrorZ
5802 typedef union LDKCResult_SignDecodeErrorZPtr {
5804 * A pointer to the contents in the success state.
5805 * Reading from this pointer when `result_ok` is not set is undefined.
5807 struct LDKSign *result;
5809 * A pointer to the contents in the error state.
5810 * Reading from this pointer when `result_ok` is set is undefined.
5812 struct LDKDecodeError *err;
5813 } LDKCResult_SignDecodeErrorZPtr;
5816 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
5817 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
5818 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5820 typedef struct LDKCResult_SignDecodeErrorZ {
5822 * The contents of this CResult_SignDecodeErrorZ, accessible via either
5823 * `err` or `result` depending on the state of `result_ok`.
5825 union LDKCResult_SignDecodeErrorZPtr contents;
5827 * Whether this CResult_SignDecodeErrorZ represents a success state.
5830 } LDKCResult_SignDecodeErrorZ;
5833 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
5834 * This corresponds to std::vector in C++
5836 typedef struct LDKCVec_CVec_u8ZZ {
5838 * The elements in the array.
5839 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5841 struct LDKCVec_u8Z *data;
5843 * The number of elements pointed to by `data`.
5846 } LDKCVec_CVec_u8ZZ;
5849 * The contents of CResult_CVec_CVec_u8ZZNoneZ
5851 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
5853 * A pointer to the contents in the success state.
5854 * Reading from this pointer when `result_ok` is not set is undefined.
5856 struct LDKCVec_CVec_u8ZZ *result;
5858 * Note that this value is always NULL, as there are no contents in the Err variant
5861 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
5864 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
5865 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
5866 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5868 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
5870 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
5871 * `err` or `result` depending on the state of `result_ok`.
5873 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
5875 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
5878 } LDKCResult_CVec_CVec_u8ZZNoneZ;
5883 * A simple implementation of Sign that just keeps the private keys in memory.
5885 * This implementation performs no policy checks and is insufficient by itself as
5886 * a secure external signer.
5888 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
5890 * A pointer to the opaque Rust object.
5891 * Nearly everywhere, inner must be non-null, however in places where
5892 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5894 LDKnativeInMemorySigner *inner;
5896 * Indicates that this is the only struct which contains the same pointer.
5897 * Rust functions which take ownership of an object provided via an argument require
5898 * this to be true and invalidate the object pointed to by inner.
5901 } LDKInMemorySigner;
5904 * The contents of CResult_InMemorySignerDecodeErrorZ
5906 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
5908 * A pointer to the contents in the success state.
5909 * Reading from this pointer when `result_ok` is not set is undefined.
5911 struct LDKInMemorySigner *result;
5913 * A pointer to the contents in the error state.
5914 * Reading from this pointer when `result_ok` is set is undefined.
5916 struct LDKDecodeError *err;
5917 } LDKCResult_InMemorySignerDecodeErrorZPtr;
5920 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
5921 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
5922 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5924 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
5926 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
5927 * `err` or `result` depending on the state of `result_ok`.
5929 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
5931 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
5934 } LDKCResult_InMemorySignerDecodeErrorZ;
5937 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
5938 * This corresponds to std::vector in C++
5940 typedef struct LDKCVec_TxOutZ {
5942 * The elements in the array.
5943 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5945 struct LDKTxOut *data;
5947 * The number of elements pointed to by `data`.
5953 * The contents of CResult_TransactionNoneZ
5955 typedef union LDKCResult_TransactionNoneZPtr {
5957 * A pointer to the contents in the success state.
5958 * Reading from this pointer when `result_ok` is not set is undefined.
5960 struct LDKTransaction *result;
5962 * Note that this value is always NULL, as there are no contents in the Err variant
5965 } LDKCResult_TransactionNoneZPtr;
5968 * A CResult_TransactionNoneZ represents the result of a fallible operation,
5969 * containing a crate::c_types::Transaction on success and a () on failure.
5970 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5972 typedef struct LDKCResult_TransactionNoneZ {
5974 * The contents of this CResult_TransactionNoneZ, accessible via either
5975 * `err` or `result` depending on the state of `result_ok`.
5977 union LDKCResult_TransactionNoneZPtr contents;
5979 * Whether this CResult_TransactionNoneZ represents a success state.
5982 } LDKCResult_TransactionNoneZ;
5985 * A Rust str object, ie a reference to a UTF8-valid string.
5986 * This is *not* null-terminated so cannot be used directly as a C string!
5988 typedef struct LDKStr {
5990 * A pointer to the string's bytes, in UTF8 encoding
5992 const uint8_t *chars;
5994 * The number of bytes (not characters!) pointed to by `chars`
6000 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
6003 typedef enum LDKAPIError_Tag {
6005 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
6006 * are documented, but generally indicates some precondition of a function was violated.
6008 LDKAPIError_APIMisuseError,
6010 * Due to a high feerate, we were unable to complete the request.
6011 * For example, this may be returned if the feerate implies we cannot open a channel at the
6012 * requested value, but opening a larger channel would succeed.
6014 LDKAPIError_FeeRateTooHigh,
6016 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
6017 * too-many-hops, etc).
6019 LDKAPIError_RouteError,
6021 * We were unable to complete the request as the Channel required to do so is unable to
6022 * complete the request (or was not found). This can take many forms, including disconnected
6023 * peer, channel at capacity, channel shutting down, etc.
6025 LDKAPIError_ChannelUnavailable,
6027 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
6028 * attempted action to fail.
6030 LDKAPIError_MonitorUpdateFailed,
6032 * Must be last for serialization purposes
6034 LDKAPIError_Sentinel,
6037 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
6039 * A human-readable error message
6041 struct LDKCVec_u8Z err;
6042 } LDKAPIError_LDKAPIMisuseError_Body;
6044 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
6046 * A human-readable error message
6048 struct LDKCVec_u8Z err;
6050 * The feerate which was too high.
6053 } LDKAPIError_LDKFeeRateTooHigh_Body;
6055 typedef struct LDKAPIError_LDKRouteError_Body {
6057 * A human-readable error message
6060 } LDKAPIError_LDKRouteError_Body;
6062 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
6064 * A human-readable error message
6066 struct LDKCVec_u8Z err;
6067 } LDKAPIError_LDKChannelUnavailable_Body;
6069 typedef struct MUST_USE_STRUCT LDKAPIError {
6070 LDKAPIError_Tag tag;
6072 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
6073 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
6074 LDKAPIError_LDKRouteError_Body route_error;
6075 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
6080 * The contents of CResult_NoneAPIErrorZ
6082 typedef union LDKCResult_NoneAPIErrorZPtr {
6084 * Note that this value is always NULL, as there are no contents in the OK variant
6088 * A pointer to the contents in the error state.
6089 * Reading from this pointer when `result_ok` is set is undefined.
6091 struct LDKAPIError *err;
6092 } LDKCResult_NoneAPIErrorZPtr;
6095 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
6096 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
6097 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6099 typedef struct LDKCResult_NoneAPIErrorZ {
6101 * The contents of this CResult_NoneAPIErrorZ, accessible via either
6102 * `err` or `result` depending on the state of `result_ok`.
6104 union LDKCResult_NoneAPIErrorZPtr contents;
6106 * Whether this CResult_NoneAPIErrorZ represents a success state.
6109 } LDKCResult_NoneAPIErrorZ;
6112 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
6113 * This corresponds to std::vector in C++
6115 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
6117 * The elements in the array.
6118 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6120 struct LDKCResult_NoneAPIErrorZ *data;
6122 * The number of elements pointed to by `data`.
6125 } LDKCVec_CResult_NoneAPIErrorZZ;
6128 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
6129 * This corresponds to std::vector in C++
6131 typedef struct LDKCVec_APIErrorZ {
6133 * The elements in the array.
6134 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6136 struct LDKAPIError *data;
6138 * The number of elements pointed to by `data`.
6141 } LDKCVec_APIErrorZ;
6144 * If a payment fails to send, it can be in one of several states. This enum is returned as the
6145 * Err() type describing which state the payment is in, see the description of individual enum
6148 typedef enum LDKPaymentSendFailure_Tag {
6150 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
6151 * send the payment at all. No channel state has been changed or messages sent to peers, and
6152 * once you've changed the parameter at error, you can freely retry the payment in full.
6154 LDKPaymentSendFailure_ParameterError,
6156 * A parameter in a single path which was passed to send_payment was invalid, preventing us
6157 * from attempting to send the payment at all. No channel state has been changed or messages
6158 * sent to peers, and once you've changed the parameter at error, you can freely retry the
6161 * The results here are ordered the same as the paths in the route object which was passed to
6164 LDKPaymentSendFailure_PathParameterError,
6166 * All paths which were attempted failed to send, with no channel state change taking place.
6167 * You can freely retry the payment in full (though you probably want to do so over different
6168 * paths than the ones selected).
6170 LDKPaymentSendFailure_AllFailedRetrySafe,
6172 * Some paths which were attempted failed to send, though possibly not all. At least some
6173 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
6174 * in over-/re-payment.
6176 * The results here are ordered the same as the paths in the route object which was passed to
6177 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
6178 * retried (though there is currently no API with which to do so).
6180 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
6181 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
6182 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
6183 * with the latest update_id.
6185 LDKPaymentSendFailure_PartialFailure,
6187 * Must be last for serialization purposes
6189 LDKPaymentSendFailure_Sentinel,
6190 } LDKPaymentSendFailure_Tag;
6192 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
6193 LDKPaymentSendFailure_Tag tag;
6196 struct LDKAPIError parameter_error;
6199 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
6202 struct LDKCVec_APIErrorZ all_failed_retry_safe;
6205 struct LDKCVec_CResult_NoneAPIErrorZZ partial_failure;
6208 } LDKPaymentSendFailure;
6211 * The contents of CResult_NonePaymentSendFailureZ
6213 typedef union LDKCResult_NonePaymentSendFailureZPtr {
6215 * Note that this value is always NULL, as there are no contents in the OK variant
6219 * A pointer to the contents in the error state.
6220 * Reading from this pointer when `result_ok` is set is undefined.
6222 struct LDKPaymentSendFailure *err;
6223 } LDKCResult_NonePaymentSendFailureZPtr;
6226 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
6227 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
6228 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6230 typedef struct LDKCResult_NonePaymentSendFailureZ {
6232 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
6233 * `err` or `result` depending on the state of `result_ok`.
6235 union LDKCResult_NonePaymentSendFailureZPtr contents;
6237 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
6240 } LDKCResult_NonePaymentSendFailureZ;
6243 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
6244 * This corresponds to std::vector in C++
6246 typedef struct LDKCVec_ChannelMonitorZ {
6248 * The elements in the array.
6249 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6251 struct LDKChannelMonitor *data;
6253 * The number of elements pointed to by `data`.
6256 } LDKCVec_ChannelMonitorZ;
6259 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
6260 * blocks are connected and disconnected.
6262 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
6263 * responsible for maintaining a set of monitors such that they can be updated accordingly as
6264 * channel state changes and HTLCs are resolved. See method documentation for specific
6267 * Implementations **must** ensure that updates are successfully applied and persisted upon method
6268 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
6269 * without taking any further action such as persisting the current state.
6271 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
6272 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
6273 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
6274 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
6275 * multiple instances.
6277 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
6278 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
6279 * [`PermanentFailure`]: channelmonitor::ChannelMonitorUpdateErr::PermanentFailure
6281 typedef struct LDKWatch {
6283 * An opaque pointer which is passed to your function implementations as an argument.
6284 * This has no meaning in the LDK, and can be NULL or any other value.
6288 * Watches a channel identified by `funding_txo` using `monitor`.
6290 * Implementations are responsible for watching the chain for the funding transaction along
6291 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
6292 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
6294 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
6295 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
6296 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
6298 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
6300 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
6302 * Implementations must call [`update_monitor`] with the given update. See
6303 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
6305 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
6306 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
6308 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
6310 * Returns any monitor events since the last call. Subsequent calls must only return new
6313 struct LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
6315 * Frees any resources associated with this object given its this_arg pointer.
6316 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6318 void (*free)(void *this_arg);
6322 * An interface to send a transaction to the Bitcoin network.
6324 typedef struct LDKBroadcasterInterface {
6326 * An opaque pointer which is passed to your function implementations as an argument.
6327 * This has no meaning in the LDK, and can be NULL or any other value.
6331 * Sends a transaction out to (hopefully) be mined.
6333 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
6335 * Frees any resources associated with this object given its this_arg pointer.
6336 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6338 void (*free)(void *this_arg);
6339 } LDKBroadcasterInterface;
6342 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
6343 * own the memory pointed to by data.
6345 typedef struct LDKu8slice {
6347 * A pointer to the byte buffer
6349 const uint8_t *data;
6351 * The number of bytes pointed to by `data`.
6357 * A trait to describe an object which can get user secrets and key material.
6359 typedef struct LDKKeysInterface {
6361 * An opaque pointer which is passed to your function implementations as an argument.
6362 * This has no meaning in the LDK, and can be NULL or any other value.
6366 * Get node secret key (aka node_id or network_key).
6368 * This method must return the same value each time it is called.
6370 struct LDKSecretKey (*get_node_secret)(const void *this_arg);
6372 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
6374 * This method should return a different value each time it is called, to avoid linking
6375 * on-chain funds across channels as controlled to the same user.
6377 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
6379 * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing
6382 * This method should return a different value each time it is called, to avoid linking
6383 * on-chain funds across channels as controlled to the same user.
6385 struct LDKPublicKey (*get_shutdown_pubkey)(const void *this_arg);
6387 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
6388 * restarted with some stale data!
6390 * This method must return a different value each time it is called.
6392 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
6394 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
6395 * onion packets and for temporary channel IDs. There is no requirement that these be
6396 * persisted anywhere, though they must be unique across restarts.
6398 * This method must return a different value each time it is called.
6400 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
6402 * Reads a `Signer` for this `KeysInterface` from the given input stream.
6403 * This is only called during deserialization of other objects which contain
6404 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
6405 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
6406 * contain no versioning scheme. You may wish to include your own version prefix and ensure
6407 * you've read all of the provided bytes to ensure no corruption occurred.
6409 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
6411 * Frees any resources associated with this object given its this_arg pointer.
6412 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6414 void (*free)(void *this_arg);
6418 * A trait which should be implemented to provide feerate information on a number of time
6421 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
6422 * called from inside the library in response to chain events, P2P events, or timer events).
6424 typedef struct LDKFeeEstimator {
6426 * An opaque pointer which is passed to your function implementations as an argument.
6427 * This has no meaning in the LDK, and can be NULL or any other value.
6431 * Gets estimated satoshis of fee required per 1000 Weight-Units.
6433 * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
6434 * don't put us below 1 satoshi-per-byte).
6436 * This translates to:
6437 * * satoshis-per-byte * 250
6438 * * ceil(satoshis-per-kbyte / 4)
6440 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
6442 * Frees any resources associated with this object given its this_arg pointer.
6443 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6445 void (*free)(void *this_arg);
6449 * A trait encapsulating the operations required of a logger
6451 typedef struct LDKLogger {
6453 * An opaque pointer which is passed to your function implementations as an argument.
6454 * This has no meaning in the LDK, and can be NULL or any other value.
6460 void (*log)(const void *this_arg, const char *record);
6462 * Frees any resources associated with this object given its this_arg pointer.
6463 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6465 void (*free)(void *this_arg);
6471 * Manager which keeps track of a number of channels and sends messages to the appropriate
6472 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
6474 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
6475 * to individual Channels.
6477 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
6478 * all peers during write/read (though does not modify this instance, only the instance being
6479 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
6480 * called funding_transaction_generated for outbound channels).
6482 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
6483 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
6484 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
6485 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
6486 * the serialization process). If the deserialized version is out-of-date compared to the
6487 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
6488 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
6490 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
6491 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
6492 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
6493 * block_connected() to step towards your best block) upon deserialization before using the
6496 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
6497 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
6498 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
6499 * offline for a full minute. In order to track this, you must call
6500 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
6502 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
6503 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
6504 * essentially you should default to using a SimpleRefChannelManager, and use a
6505 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
6506 * you're using lightning-net-tokio.
6508 typedef struct MUST_USE_STRUCT LDKChannelManager {
6510 * A pointer to the opaque Rust object.
6511 * Nearly everywhere, inner must be non-null, however in places where
6512 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6514 LDKnativeChannelManager *inner;
6516 * Indicates that this is the only struct which contains the same pointer.
6517 * Rust functions which take ownership of an object provided via an argument require
6518 * this to be true and invalidate the object pointed to by inner.
6521 } LDKChannelManager;
6524 * A tuple of 2 elements. See the individual fields for the types contained.
6526 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
6528 * The element at position 0
6530 struct LDKThirtyTwoBytes a;
6532 * The element at position 1
6534 struct LDKChannelManager b;
6535 } LDKC2Tuple_BlockHashChannelManagerZ;
6538 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
6540 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
6542 * A pointer to the contents in the success state.
6543 * Reading from this pointer when `result_ok` is not set is undefined.
6545 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
6547 * A pointer to the contents in the error state.
6548 * Reading from this pointer when `result_ok` is set is undefined.
6550 struct LDKDecodeError *err;
6551 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
6554 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
6555 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
6556 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6558 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
6560 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
6561 * `err` or `result` depending on the state of `result_ok`.
6563 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
6565 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
6568 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
6571 * A trait indicating an object may generate message send events
6573 typedef struct LDKMessageSendEventsProvider {
6575 * An opaque pointer which is passed to your function implementations as an argument.
6576 * This has no meaning in the LDK, and can be NULL or any other value.
6580 * Gets the list of pending events which were generated by previous actions, clearing the list
6583 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
6585 * Frees any resources associated with this object given its this_arg pointer.
6586 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6588 void (*free)(void *this_arg);
6589 } LDKMessageSendEventsProvider;
6592 * A trait indicating an object may generate events
6594 typedef struct LDKEventsProvider {
6596 * An opaque pointer which is passed to your function implementations as an argument.
6597 * This has no meaning in the LDK, and can be NULL or any other value.
6601 * Gets the list of pending events which were generated by previous actions, clearing the list
6604 struct LDKCVec_EventZ (*get_and_clear_pending_events)(const void *this_arg);
6606 * Frees any resources associated with this object given its this_arg pointer.
6607 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6609 void (*free)(void *this_arg);
6610 } LDKEventsProvider;
6615 * Configuration we set when applicable.
6617 * Default::default() provides sane defaults.
6619 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
6621 * A pointer to the opaque Rust object.
6622 * Nearly everywhere, inner must be non-null, however in places where
6623 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6625 LDKnativeChannelHandshakeConfig *inner;
6627 * Indicates that this is the only struct which contains the same pointer.
6628 * Rust functions which take ownership of an object provided via an argument require
6629 * this to be true and invalidate the object pointed to by inner.
6632 } LDKChannelHandshakeConfig;
6637 * Optional channel limits which are applied during channel creation.
6639 * These limits are only applied to our counterparty's limits, not our own.
6641 * Use 0/<type>::max_value() as appropriate to skip checking.
6643 * Provides sane defaults for most configurations.
6645 * Most additional limits are disabled except those with which specify a default in individual
6646 * field documentation. Note that this may result in barely-usable channels, but since they
6647 * are applied mostly only to incoming channels that's not much of a problem.
6649 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
6651 * A pointer to the opaque Rust object.
6652 * Nearly everywhere, inner must be non-null, however in places where
6653 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6655 LDKnativeChannelHandshakeLimits *inner;
6657 * Indicates that this is the only struct which contains the same pointer.
6658 * Rust functions which take ownership of an object provided via an argument require
6659 * this to be true and invalidate the object pointed to by inner.
6662 } LDKChannelHandshakeLimits;
6667 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
6669 * Default::default() provides sane defaults for most configurations
6670 * (but currently with 0 relay fees!)
6672 typedef struct MUST_USE_STRUCT LDKUserConfig {
6674 * A pointer to the opaque Rust object.
6675 * Nearly everywhere, inner must be non-null, however in places where
6676 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6678 LDKnativeUserConfig *inner;
6680 * Indicates that this is the only struct which contains the same pointer.
6681 * Rust functions which take ownership of an object provided via an argument require
6682 * this to be true and invalidate the object pointed to by inner.
6688 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
6691 typedef struct LDKAccess {
6693 * An opaque pointer which is passed to your function implementations as an argument.
6694 * This has no meaning in the LDK, and can be NULL or any other value.
6698 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
6699 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
6702 * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
6704 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
6706 * Frees any resources associated with this object given its this_arg pointer.
6707 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6709 void (*free)(void *this_arg);
6713 * The `Listen` trait is used to be notified of when blocks have been connected or disconnected
6716 * Useful when needing to replay chain data upon startup or as new chain events occur.
6718 typedef struct LDKListen {
6720 * An opaque pointer which is passed to your function implementations as an argument.
6721 * This has no meaning in the LDK, and can be NULL or any other value.
6725 * Notifies the listener that a block was added at the given height.
6727 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
6729 * Notifies the listener that a block was removed at the given height.
6731 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
6733 * Frees any resources associated with this object given its this_arg pointer.
6734 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6736 void (*free)(void *this_arg);
6742 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
6744 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
6745 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
6746 * the return value of [`Filter::register_output`].
6748 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
6749 * may have been spent there. See [`Filter::register_output`] for details.
6751 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
6752 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
6754 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
6756 * A pointer to the opaque Rust object.
6757 * Nearly everywhere, inner must be non-null, however in places where
6758 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6760 LDKnativeWatchedOutput *inner;
6762 * Indicates that this is the only struct which contains the same pointer.
6763 * Rust functions which take ownership of an object provided via an argument require
6764 * this to be true and invalidate the object pointed to by inner.
6770 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
6773 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
6774 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
6775 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
6776 * receiving full blocks from a chain source, any further filtering is unnecessary.
6778 * After an output has been registered, subsequent block retrievals from the chain source must not
6779 * exclude any transactions matching the new criteria nor any in-block descendants of such
6782 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
6783 * should not block on I/O. Implementations should instead queue the newly monitored data to be
6784 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
6785 * invocation that has called the `Filter` must return [`TemporaryFailure`].
6787 * [`TemporaryFailure`]: channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure
6788 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
6789 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
6791 typedef struct LDKFilter {
6793 * An opaque pointer which is passed to your function implementations as an argument.
6794 * This has no meaning in the LDK, and can be NULL or any other value.
6798 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
6799 * a spending condition.
6801 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
6803 * Registers interest in spends of a transaction output.
6805 * Optionally, when `output.block_hash` is set, should return any transaction spending the
6806 * output that is found in the corresponding block along with its index.
6808 * This return value is useful for Electrum clients in order to supply in-block descendant
6809 * transactions which otherwise were not included. This is not necessary for other clients if
6810 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
6813 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
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 * `Persist` defines behavior for persisting channel monitors: this could mean
6823 * writing once to disk, and/or uploading to one or more backup services.
6825 * Note that for every new monitor, you **must** persist the new `ChannelMonitor`
6826 * to disk/backups. And, on every update, you **must** persist either the
6827 * `ChannelMonitorUpdate` or the updated monitor itself. Otherwise, there is risk
6828 * of situations such as revoking a transaction, then crashing before this
6829 * revocation can be persisted, then unintentionally broadcasting a revoked
6830 * transaction and losing money. This is a risk because previous channel states
6831 * are toxic, so it's important that whatever channel state is persisted is
6834 typedef struct LDKPersist {
6836 * An opaque pointer which is passed to your function implementations as an argument.
6837 * This has no meaning in the LDK, and can be NULL or any other value.
6841 * Persist a new channel's data. The data can be stored any way you want, but
6842 * the identifier provided by Rust-Lightning is the channel's outpoint (and
6843 * it is up to you to maintain a correct mapping between the outpoint and the
6844 * stored channel data). Note that you **must** persist every new monitor to
6845 * disk. See the `Persist` trait documentation for more details.
6847 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
6848 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
6850 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data);
6852 * Update one channel's data. The provided `ChannelMonitor` has already
6853 * applied the given update.
6855 * Note that on every update, you **must** persist either the
6856 * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See
6857 * the `Persist` trait documentation for more details.
6859 * If an implementer chooses to persist the updates only, they need to make
6860 * sure that all the updates are applied to the `ChannelMonitors` *before*
6861 * the set of channel monitors is given to the `ChannelManager`
6862 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
6863 * applying a monitor update to a monitor. If full `ChannelMonitors` are
6864 * persisted, then there is no need to persist individual updates.
6866 * Note that there could be a performance tradeoff between persisting complete
6867 * channel monitors on every update vs. persisting only updates and applying
6868 * them in batches. The size of each monitor grows `O(number of state updates)`
6869 * whereas updates are small and `O(1)`.
6871 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
6872 * [`ChannelMonitorUpdate::write`] for writing out an update, and
6873 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
6875 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);
6877 * Frees any resources associated with this object given its this_arg pointer.
6878 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6880 void (*free)(void *this_arg);
6886 * An implementation of [`chain::Watch`] for monitoring channels.
6888 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
6889 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
6890 * or used independently to monitor channels remotely. See the [module-level documentation] for
6893 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
6894 * [module-level documentation]: crate::chain::chainmonitor
6896 typedef struct MUST_USE_STRUCT LDKChainMonitor {
6898 * A pointer to the opaque Rust object.
6899 * Nearly everywhere, inner must be non-null, however in places where
6900 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6902 LDKnativeChainMonitor *inner;
6904 * Indicates that this is the only struct which contains the same pointer.
6905 * Rust functions which take ownership of an object provided via an argument require
6906 * this to be true and invalidate the object pointed to by inner.
6914 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
6915 * and derives keys from that.
6917 * Your node_id is seed/0'
6918 * ChannelMonitor closes may use seed/1'
6919 * Cooperative closes may use seed/2'
6920 * The two close keys may be needed to claim on-chain funds!
6922 typedef struct MUST_USE_STRUCT LDKKeysManager {
6924 * A pointer to the opaque Rust object.
6925 * Nearly everywhere, inner must be non-null, however in places where
6926 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6928 LDKnativeKeysManager *inner;
6930 * Indicates that this is the only struct which contains the same pointer.
6931 * Rust functions which take ownership of an object provided via an argument require
6932 * this to be true and invalidate the object pointed to by inner.
6940 * Chain-related parameters used to construct a new `ChannelManager`.
6942 * Typically, the block-specific parameters are derived from the best block hash for the network,
6943 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
6944 * are not needed when deserializing a previously constructed `ChannelManager`.
6946 typedef struct MUST_USE_STRUCT LDKChainParameters {
6948 * A pointer to the opaque Rust object.
6949 * Nearly everywhere, inner must be non-null, however in places where
6950 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6952 LDKnativeChainParameters *inner;
6954 * Indicates that this is the only struct which contains the same pointer.
6955 * Rust functions which take ownership of an object provided via an argument require
6956 * this to be true and invalidate the object pointed to by inner.
6959 } LDKChainParameters;
6964 * The best known block as identified by its hash and height.
6966 typedef struct MUST_USE_STRUCT LDKBestBlock {
6968 * A pointer to the opaque Rust object.
6969 * Nearly everywhere, inner must be non-null, however in places where
6970 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6972 LDKnativeBestBlock *inner;
6974 * Indicates that this is the only struct which contains the same pointer.
6975 * Rust functions which take ownership of an object provided via an argument require
6976 * this to be true and invalidate the object pointed to by inner.
6982 * A 3-byte byte array.
6984 typedef struct LDKThreeBytes {
6992 * A trait to describe an object which can receive channel messages.
6994 * Messages MAY be called in parallel when they originate from different their_node_ids, however
6995 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
6997 typedef struct LDKChannelMessageHandler {
6999 * An opaque pointer which is passed to your function implementations as an argument.
7000 * This has no meaning in the LDK, and can be NULL or any other value.
7004 * Handle an incoming open_channel message from the given peer.
7006 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
7008 * Handle an incoming accept_channel message from the given peer.
7010 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
7012 * Handle an incoming funding_created message from the given peer.
7014 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
7016 * Handle an incoming funding_signed message from the given peer.
7018 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
7020 * Handle an incoming funding_locked message from the given peer.
7022 void (*handle_funding_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg);
7024 * Handle an incoming shutdown message from the given peer.
7026 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);
7028 * Handle an incoming closing_signed message from the given peer.
7030 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
7032 * Handle an incoming update_add_htlc message from the given peer.
7034 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
7036 * Handle an incoming update_fulfill_htlc message from the given peer.
7038 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
7040 * Handle an incoming update_fail_htlc message from the given peer.
7042 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
7044 * Handle an incoming update_fail_malformed_htlc message from the given peer.
7046 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
7048 * Handle an incoming commitment_signed message from the given peer.
7050 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
7052 * Handle an incoming revoke_and_ack message from the given peer.
7054 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
7056 * Handle an incoming update_fee message from the given peer.
7058 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
7060 * Handle an incoming announcement_signatures message from the given peer.
7062 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
7064 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
7065 * is believed to be possible in the future (eg they're sending us messages we don't
7066 * understand or indicate they require unknown feature bits), no_connection_possible is set
7067 * and any outstanding channels should be failed.
7069 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
7071 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
7073 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
7075 * Handle an incoming channel_reestablish message from the given peer.
7077 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
7079 * Handle an incoming channel update from the given peer.
7081 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
7083 * Handle an incoming error message from the given peer.
7085 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
7087 * Implementation of MessageSendEventsProvider for this object.
7089 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
7091 * Frees any resources associated with this object given its this_arg pointer.
7092 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7094 void (*free)(void *this_arg);
7095 } LDKChannelMessageHandler;
7100 * Arguments for the creation of a ChannelManager that are not deserialized.
7102 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
7104 * 1) Deserialize all stored ChannelMonitors.
7105 * 2) Deserialize the ChannelManager by filling in this struct and calling:
7106 * <(BlockHash, ChannelManager)>::read(reader, args)
7107 * This may result in closing some Channels if the ChannelMonitor is newer than the stored
7108 * ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted.
7109 * 3) If you are not fetching full blocks, register all relevant ChannelMonitor outpoints the same
7110 * way you would handle a `chain::Filter` call using ChannelMonitor::get_outputs_to_watch() and
7111 * ChannelMonitor::get_funding_txo().
7112 * 4) Reconnect blocks on your ChannelMonitors.
7113 * 5) Disconnect/connect blocks on the ChannelManager.
7114 * 6) Move the ChannelMonitors into your local chain::Watch.
7116 * Note that the ordering of #4-6 is not of importance, however all three must occur before you
7117 * call any other methods on the newly-deserialized ChannelManager.
7119 * Note that because some channels may be closed during deserialization, it is critical that you
7120 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
7121 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
7122 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
7123 * not force-close the same channels but consider them live), you may end up revoking a state for
7124 * which you've already broadcasted the transaction.
7126 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
7128 * A pointer to the opaque Rust object.
7129 * Nearly everywhere, inner must be non-null, however in places where
7130 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7132 LDKnativeChannelManagerReadArgs *inner;
7134 * Indicates that this is the only struct which contains the same pointer.
7135 * Rust functions which take ownership of an object provided via an argument require
7136 * this to be true and invalidate the object pointed to by inner.
7139 } LDKChannelManagerReadArgs;
7144 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
7145 * This is used to convince the recipient that the channel is at a certain commitment
7146 * number even if they lost that data due to a local failure. Of course, the peer may lie
7147 * and even later commitments may have been revoked.
7149 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
7151 * A pointer to the opaque Rust object.
7152 * Nearly everywhere, inner must be non-null, however in places where
7153 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7155 LDKnativeDataLossProtect *inner;
7157 * Indicates that this is the only struct which contains the same pointer.
7158 * Rust functions which take ownership of an object provided via an argument require
7159 * this to be true and invalidate the object pointed to by inner.
7162 } LDKDataLossProtect;
7165 * A trait to describe an object which can receive routing messages.
7167 * # Implementor DoS Warnings
7169 * For `gossip_queries` messages there are potential DoS vectors when handling
7170 * inbound queries. Implementors using an on-disk network graph should be aware of
7171 * repeated disk I/O for queries accessing different parts of the network graph.
7173 typedef struct LDKRoutingMessageHandler {
7175 * An opaque pointer which is passed to your function implementations as an argument.
7176 * This has no meaning in the LDK, and can be NULL or any other value.
7180 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
7181 * false or returning an Err otherwise.
7183 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
7185 * Handle a channel_announcement message, returning true if it should be forwarded on, false
7186 * or returning an Err otherwise.
7188 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
7190 * Handle an incoming channel_update message, returning true if it should be forwarded on,
7191 * false or returning an Err otherwise.
7193 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
7195 * Handle some updates to the route graph that we learned due to an outbound failed payment.
7197 void (*handle_htlc_fail_channel_update)(const void *this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update);
7199 * Gets a subset of the channel announcements and updates required to dump our routing table
7200 * to a remote node, starting at the short_channel_id indicated by starting_point and
7201 * including the batch_amount entries immediately higher in numerical value than starting_point.
7203 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
7205 * Gets a subset of the node announcements required to dump our routing table to a remote node,
7206 * starting at the node *after* the provided publickey and including batch_amount entries
7207 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
7208 * If None is provided for starting_point, we start at the first node.
7210 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
7212 * Called when a connection is established with a peer. This can be used to
7213 * perform routing table synchronization using a strategy defined by the
7216 void (*sync_routing_table)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
7218 * Handles the reply of a query we initiated to learn about channels
7219 * for a given range of blocks. We can expect to receive one or more
7220 * replies to a single query.
7222 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
7224 * Handles the reply of a query we initiated asking for routing gossip
7225 * messages for a list of channels. We should receive this message when
7226 * a node has completed its best effort to send us the pertaining routing
7229 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
7231 * Handles when a peer asks us to send a list of short_channel_ids
7232 * for the requested range of blocks.
7234 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
7236 * Handles when a peer asks us to send routing gossip messages for a
7237 * list of short_channel_ids.
7239 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
7241 * Implementation of MessageSendEventsProvider for this object.
7243 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
7245 * Frees any resources associated with this object given its this_arg pointer.
7246 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7248 void (*free)(void *this_arg);
7249 } LDKRoutingMessageHandler;
7254 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
7255 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
7257 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
7259 * A pointer to the opaque Rust object.
7260 * Nearly everywhere, inner must be non-null, however in places where
7261 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7263 LDKnativeIgnoringMessageHandler *inner;
7265 * Indicates that this is the only struct which contains the same pointer.
7266 * Rust functions which take ownership of an object provided via an argument require
7267 * this to be true and invalidate the object pointed to by inner.
7270 } LDKIgnoringMessageHandler;
7275 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
7276 * You can provide one of these as the route_handler in a MessageHandler.
7278 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
7280 * A pointer to the opaque Rust object.
7281 * Nearly everywhere, inner must be non-null, however in places where
7282 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7284 LDKnativeErroringMessageHandler *inner;
7286 * Indicates that this is the only struct which contains the same pointer.
7287 * Rust functions which take ownership of an object provided via an argument require
7288 * this to be true and invalidate the object pointed to by inner.
7291 } LDKErroringMessageHandler;
7296 * Provides references to trait impls which handle different types of messages.
7298 typedef struct MUST_USE_STRUCT LDKMessageHandler {
7300 * A pointer to the opaque Rust object.
7301 * Nearly everywhere, inner must be non-null, however in places where
7302 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7304 LDKnativeMessageHandler *inner;
7306 * Indicates that this is the only struct which contains the same pointer.
7307 * Rust functions which take ownership of an object provided via an argument require
7308 * this to be true and invalidate the object pointed to by inner.
7311 } LDKMessageHandler;
7314 * Provides an object which can be used to send data to and which uniquely identifies a connection
7315 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
7316 * implement Hash to meet the PeerManager API.
7318 * For efficiency, Clone should be relatively cheap for this type.
7320 * You probably want to just extend an int and put a file descriptor in a struct and implement
7321 * send_data. Note that if you are using a higher-level net library that may call close() itself,
7322 * be careful to ensure you don't have races whereby you might register a new connection with an
7323 * fd which is the same as a previous one which has yet to be removed via
7324 * PeerManager::socket_disconnected().
7326 typedef struct LDKSocketDescriptor {
7328 * An opaque pointer which is passed to your function implementations as an argument.
7329 * This has no meaning in the LDK, and can be NULL or any other value.
7333 * Attempts to send some data from the given slice to the peer.
7335 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
7336 * Note that in the disconnected case, socket_disconnected must still fire and further write
7337 * attempts may occur until that time.
7339 * If the returned size is smaller than data.len(), a write_available event must
7340 * trigger the next time more data can be written. Additionally, until the a send_data event
7341 * completes fully, no further read_events should trigger on the same peer!
7343 * If a read_event on this descriptor had previously returned true (indicating that read
7344 * events should be paused to prevent DoS in the send buffer), resume_read may be set
7345 * indicating that read events on this descriptor should resume. A resume_read of false does
7346 * *not* imply that further read events should be paused.
7348 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
7350 * Disconnect the socket pointed to by this SocketDescriptor. Once this function returns, no
7351 * more calls to write_buffer_space_avail, read_event or socket_disconnected may be made with
7352 * this descriptor. No socket_disconnected call should be generated as a result of this call,
7353 * though races may occur whereby disconnect_socket is called after a call to
7354 * socket_disconnected but prior to socket_disconnected returning.
7356 void (*disconnect_socket)(void *this_arg);
7358 * Checks if two objects are equal given this object's this_arg pointer and another object.
7360 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
7362 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
7363 * This is used, for example, for inclusion of this object in a hash map.
7365 uint64_t (*hash)(const void *this_arg);
7367 * Creates a copy of the object pointed to by this_arg, for a copy of this SocketDescriptor.
7368 * Note that the ultimate copy of the SocketDescriptor will have all function pointers the same as the original.
7369 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new SocketDescriptor.
7371 void *(*clone)(const void *this_arg);
7373 * Frees any resources associated with this object given its this_arg pointer.
7374 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7376 void (*free)(void *this_arg);
7377 } LDKSocketDescriptor;
7382 * A PeerManager manages a set of peers, described by their SocketDescriptor and marshalls socket
7383 * events into messages which it passes on to its MessageHandlers.
7385 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
7386 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
7387 * essentially you should default to using a SimpleRefPeerManager, and use a
7388 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
7389 * you're using lightning-net-tokio.
7391 typedef struct MUST_USE_STRUCT LDKPeerManager {
7393 * A pointer to the opaque Rust object.
7394 * Nearly everywhere, inner must be non-null, however in places where
7395 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7397 LDKnativePeerManager *inner;
7399 * Indicates that this is the only struct which contains the same pointer.
7400 * Rust functions which take ownership of an object provided via an argument require
7401 * this to be true and invalidate the object pointed to by inner.
7409 * Static channel fields used to build transactions given per-commitment fields, organized by
7410 * broadcaster/countersignatory.
7412 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
7413 * as_holder_broadcastable and as_counterparty_broadcastable functions.
7415 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
7417 * A pointer to the opaque Rust object.
7418 * Nearly everywhere, inner must be non-null, however in places where
7419 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7421 LDKnativeDirectedChannelTransactionParameters *inner;
7423 * Indicates that this is the only struct which contains the same pointer.
7424 * Rust functions which take ownership of an object provided via an argument require
7425 * this to be true and invalidate the object pointed to by inner.
7428 } LDKDirectedChannelTransactionParameters;
7433 * A simple newtype for RwLockReadGuard<'a, NetworkGraph>.
7434 * This exists only to make accessing a RwLock<NetworkGraph> possible from
7435 * the C bindings, as it can be done directly in Rust code.
7437 typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
7439 * A pointer to the opaque Rust object.
7440 * Nearly everywhere, inner must be non-null, however in places where
7441 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7443 LDKnativeLockedNetworkGraph *inner;
7445 * Indicates that this is the only struct which contains the same pointer.
7446 * Rust functions which take ownership of an object provided via an argument require
7447 * this to be true and invalidate the object pointed to by inner.
7450 } LDKLockedNetworkGraph;
7455 * Receives and validates network updates from peers,
7456 * stores authentic and relevant data as a network graph.
7457 * This network graph is then used for routing payments.
7458 * Provides interface to help with initial routing sync by
7459 * serving historical announcements.
7461 typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
7463 * A pointer to the opaque Rust object.
7464 * Nearly everywhere, inner must be non-null, however in places where
7465 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7467 LDKnativeNetGraphMsgHandler *inner;
7469 * Indicates that this is the only struct which contains the same pointer.
7470 * Rust functions which take ownership of an object provided via an argument require
7471 * this to be true and invalidate the object pointed to by inner.
7474 } LDKNetGraphMsgHandler;
7476 extern const uintptr_t MAX_BUF_SIZE;
7478 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
7480 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
7482 extern const uint16_t BREAKDOWN_TIMEOUT;
7484 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
7486 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
7489 * Frees the data buffer, if data_is_owned is set and datalen > 0.
7491 void Transaction_free(struct LDKTransaction _res);
7494 * Frees the data pointed to by script_pubkey.
7496 void TxOut_free(struct LDKTxOut _res);
7499 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
7501 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
7504 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
7506 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
7509 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
7511 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
7514 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
7516 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
7519 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
7520 * but with all dynamically-allocated buffers duplicated in new buffers.
7522 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
7525 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
7527 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
7530 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
7532 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
7535 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
7537 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
7540 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
7541 * but with all dynamically-allocated buffers duplicated in new buffers.
7543 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
7546 * Creates a new CResult_SecretKeyErrorZ in the success state.
7548 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
7551 * Creates a new CResult_SecretKeyErrorZ in the error state.
7553 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
7556 * Frees any resources used by the CResult_SecretKeyErrorZ.
7558 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
7561 * Creates a new CResult_PublicKeyErrorZ in the success state.
7563 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
7566 * Creates a new CResult_PublicKeyErrorZ in the error state.
7568 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
7571 * Frees any resources used by the CResult_PublicKeyErrorZ.
7573 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
7576 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
7578 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
7581 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
7583 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
7586 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
7588 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
7591 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
7592 * but with all dynamically-allocated buffers duplicated in new buffers.
7594 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
7597 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
7599 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
7602 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
7604 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
7607 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
7609 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
7612 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
7613 * but with all dynamically-allocated buffers duplicated in new buffers.
7615 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
7618 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
7620 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
7623 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
7625 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
7628 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
7630 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
7633 * Constructs a new COption_u32Z containing a u32
7635 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
7638 * Constructs a new COption_u32Z containing nothing
7640 struct LDKCOption_u32Z COption_u32Z_none(void);
7643 * Frees any resources associated with the u32, if we are in the Some state
7645 void COption_u32Z_free(struct LDKCOption_u32Z _res);
7648 * Creates a new COption_u32Z which has the same data as `orig`
7649 * but with all dynamically-allocated buffers duplicated in new buffers.
7651 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
7654 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
7656 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
7659 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
7661 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
7664 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
7666 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
7669 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
7670 * but with all dynamically-allocated buffers duplicated in new buffers.
7672 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
7675 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
7677 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
7680 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
7682 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
7685 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
7687 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
7690 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
7691 * but with all dynamically-allocated buffers duplicated in new buffers.
7693 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
7696 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
7698 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
7701 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
7703 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
7706 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
7708 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
7711 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
7712 * but with all dynamically-allocated buffers duplicated in new buffers.
7714 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
7717 * Frees the buffer pointed to by `data` if `datalen` is non-0.
7719 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
7722 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
7724 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
7727 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
7729 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
7732 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
7734 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
7737 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
7738 * but with all dynamically-allocated buffers duplicated in new buffers.
7740 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
7743 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
7745 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
7748 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
7750 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
7753 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
7755 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
7758 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
7759 * but with all dynamically-allocated buffers duplicated in new buffers.
7761 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
7764 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
7766 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
7769 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
7771 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
7774 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
7776 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
7779 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
7780 * but with all dynamically-allocated buffers duplicated in new buffers.
7782 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
7785 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
7787 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
7790 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
7792 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
7795 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
7797 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
7800 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
7802 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
7805 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
7807 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
7810 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
7812 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
7815 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
7816 * but with all dynamically-allocated buffers duplicated in new buffers.
7818 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
7821 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
7823 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
7826 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
7828 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
7831 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
7833 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
7836 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
7837 * but with all dynamically-allocated buffers duplicated in new buffers.
7839 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
7842 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
7844 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
7847 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
7849 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
7852 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
7854 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
7857 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
7858 * but with all dynamically-allocated buffers duplicated in new buffers.
7860 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
7863 * Creates a new CResult_NoneMonitorUpdateErrorZ in the success state.
7865 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
7868 * Creates a new CResult_NoneMonitorUpdateErrorZ in the error state.
7870 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e);
7873 * Frees any resources used by the CResult_NoneMonitorUpdateErrorZ.
7875 void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res);
7878 * Creates a new CResult_NoneMonitorUpdateErrorZ which has the same data as `orig`
7879 * but with all dynamically-allocated buffers duplicated in new buffers.
7881 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig);
7884 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
7886 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
7889 * Frees any resources used by the C2Tuple_OutPointScriptZ.
7891 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
7894 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
7896 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
7899 * Frees any resources used by the C2Tuple_u32ScriptZ.
7901 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
7904 * Frees the buffer pointed to by `data` if `datalen` is non-0.
7906 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
7909 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
7911 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
7914 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
7916 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
7919 * Frees the buffer pointed to by `data` if `datalen` is non-0.
7921 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
7924 * Frees the buffer pointed to by `data` if `datalen` is non-0.
7926 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
7929 * Frees the buffer pointed to by `data` if `datalen` is non-0.
7931 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
7934 * Frees the buffer pointed to by `data` if `datalen` is non-0.
7936 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
7939 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
7941 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
7944 * Frees any resources used by the C2Tuple_usizeTransactionZ.
7946 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
7949 * Frees the buffer pointed to by `data` if `datalen` is non-0.
7951 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
7954 * Creates a new tuple which has the same data as `orig`
7955 * but with all dynamically-allocated buffers duplicated in new buffers.
7957 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
7960 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
7962 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
7965 * Frees any resources used by the C2Tuple_u32TxOutZ.
7967 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
7970 * Frees the buffer pointed to by `data` if `datalen` is non-0.
7972 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
7975 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
7977 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
7980 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
7982 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
7985 * Frees the buffer pointed to by `data` if `datalen` is non-0.
7987 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
7990 * Frees the buffer pointed to by `data` if `datalen` is non-0.
7992 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
7995 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
7997 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
8000 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
8002 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
8005 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
8007 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
8010 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
8011 * but with all dynamically-allocated buffers duplicated in new buffers.
8013 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
8016 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
8018 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
8021 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
8023 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
8026 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
8028 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
8031 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
8033 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
8036 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
8038 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
8041 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8043 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
8046 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8048 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
8051 * Creates a new CResult_RouteDecodeErrorZ in the success state.
8053 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
8056 * Creates a new CResult_RouteDecodeErrorZ in the error state.
8058 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
8061 * Frees any resources used by the CResult_RouteDecodeErrorZ.
8063 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
8066 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
8067 * but with all dynamically-allocated buffers duplicated in new buffers.
8069 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
8072 * Constructs a new COption_u64Z containing a u64
8074 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
8077 * Constructs a new COption_u64Z containing nothing
8079 struct LDKCOption_u64Z COption_u64Z_none(void);
8082 * Frees any resources associated with the u64, if we are in the Some state
8084 void COption_u64Z_free(struct LDKCOption_u64Z _res);
8087 * Creates a new COption_u64Z which has the same data as `orig`
8088 * but with all dynamically-allocated buffers duplicated in new buffers.
8090 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
8093 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8095 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
8098 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8100 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
8103 * Creates a new CResult_RouteLightningErrorZ in the success state.
8105 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
8108 * Creates a new CResult_RouteLightningErrorZ in the error state.
8110 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
8113 * Frees any resources used by the CResult_RouteLightningErrorZ.
8115 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
8118 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
8119 * but with all dynamically-allocated buffers duplicated in new buffers.
8121 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
8124 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8126 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
8129 * Creates a new CResult_boolLightningErrorZ in the success state.
8131 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
8134 * Creates a new CResult_boolLightningErrorZ in the error state.
8136 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
8139 * Frees any resources used by the CResult_boolLightningErrorZ.
8141 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
8144 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
8145 * but with all dynamically-allocated buffers duplicated in new buffers.
8147 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
8150 * Creates a new tuple which has the same data as `orig`
8151 * but with all dynamically-allocated buffers duplicated in new buffers.
8153 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
8156 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
8158 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
8161 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
8163 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
8166 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8168 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
8171 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8173 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
8176 * Creates a new CResult_NoneLightningErrorZ in the success state.
8178 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
8181 * Creates a new CResult_NoneLightningErrorZ in the error state.
8183 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
8186 * Frees any resources used by the CResult_NoneLightningErrorZ.
8188 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
8191 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
8192 * but with all dynamically-allocated buffers duplicated in new buffers.
8194 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
8197 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8199 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
8202 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8204 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
8207 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
8209 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
8212 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
8214 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
8217 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
8219 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
8222 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
8223 * but with all dynamically-allocated buffers duplicated in new buffers.
8225 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
8228 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
8230 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
8233 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
8235 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
8238 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
8240 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
8243 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
8244 * but with all dynamically-allocated buffers duplicated in new buffers.
8246 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
8249 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
8251 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
8254 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
8256 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
8259 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
8261 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
8264 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
8265 * but with all dynamically-allocated buffers duplicated in new buffers.
8267 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
8270 * Creates a new CResult_TxOutAccessErrorZ in the success state.
8272 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
8275 * Creates a new CResult_TxOutAccessErrorZ in the error state.
8277 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
8280 * Frees any resources used by the CResult_TxOutAccessErrorZ.
8282 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
8285 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
8286 * but with all dynamically-allocated buffers duplicated in new buffers.
8288 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
8291 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ
8293 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
8296 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing
8298 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
8301 * Frees any resources associated with the crate::c_types::derived::C2Tuple_usizeTransactionZ, if we are in the Some state
8303 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
8306 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8308 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
8311 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the success state.
8313 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o);
8316 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the error state.
8318 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
8321 * Frees any resources used by the CResult_DirectionalChannelInfoDecodeErrorZ.
8323 void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res);
8326 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ which has the same data as `orig`
8327 * but with all dynamically-allocated buffers duplicated in new buffers.
8329 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig);
8332 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
8334 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
8337 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
8339 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
8342 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
8344 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
8347 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
8348 * but with all dynamically-allocated buffers duplicated in new buffers.
8350 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
8353 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
8355 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
8358 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
8360 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
8363 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
8365 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
8368 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
8369 * but with all dynamically-allocated buffers duplicated in new buffers.
8371 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
8374 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8376 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
8379 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
8381 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
8384 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
8386 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
8389 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
8391 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
8394 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
8395 * but with all dynamically-allocated buffers duplicated in new buffers.
8397 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
8400 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8402 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
8405 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
8407 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
8410 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
8412 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
8415 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
8417 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
8420 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
8421 * but with all dynamically-allocated buffers duplicated in new buffers.
8423 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
8426 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
8428 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
8431 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
8433 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
8436 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
8438 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
8441 * Creates a new CResult_NetworkGraphDecodeErrorZ which has the same data as `orig`
8442 * but with all dynamically-allocated buffers duplicated in new buffers.
8444 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
8447 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
8449 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
8452 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
8454 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
8457 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
8459 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
8462 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
8464 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
8467 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
8469 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
8472 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
8474 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
8477 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
8479 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
8482 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
8484 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
8487 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
8489 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
8492 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
8494 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
8497 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
8499 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
8502 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
8504 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
8507 * Creates a new CResult_NetAddressu8Z in the success state.
8509 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
8512 * Creates a new CResult_NetAddressu8Z in the error state.
8514 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
8517 * Frees any resources used by the CResult_NetAddressu8Z.
8519 void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
8522 * Creates a new CResult_NetAddressu8Z which has the same data as `orig`
8523 * but with all dynamically-allocated buffers duplicated in new buffers.
8525 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
8528 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the success state.
8530 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
8533 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the error state.
8535 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
8538 * Frees any resources used by the CResult_CResult_NetAddressu8ZDecodeErrorZ.
8540 void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
8543 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ which has the same data as `orig`
8544 * but with all dynamically-allocated buffers duplicated in new buffers.
8546 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
8549 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8551 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
8554 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8556 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
8559 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8561 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
8564 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8566 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
8569 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
8571 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
8574 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
8576 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
8579 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
8581 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
8584 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
8585 * but with all dynamically-allocated buffers duplicated in new buffers.
8587 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
8590 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
8592 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
8595 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
8597 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
8600 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
8602 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
8605 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
8606 * but with all dynamically-allocated buffers duplicated in new buffers.
8608 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
8611 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
8613 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
8616 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
8618 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
8621 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
8623 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
8626 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
8627 * but with all dynamically-allocated buffers duplicated in new buffers.
8629 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
8632 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
8634 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
8637 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
8639 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
8642 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
8644 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
8647 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
8648 * but with all dynamically-allocated buffers duplicated in new buffers.
8650 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
8653 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
8655 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
8658 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
8660 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
8663 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
8665 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
8668 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
8669 * but with all dynamically-allocated buffers duplicated in new buffers.
8671 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
8674 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
8676 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
8679 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
8681 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
8684 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
8686 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
8689 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
8690 * but with all dynamically-allocated buffers duplicated in new buffers.
8692 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
8695 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
8697 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
8700 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
8702 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
8705 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
8707 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
8710 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
8711 * but with all dynamically-allocated buffers duplicated in new buffers.
8713 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
8716 * Creates a new CResult_FundingLockedDecodeErrorZ in the success state.
8718 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o);
8721 * Creates a new CResult_FundingLockedDecodeErrorZ in the error state.
8723 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e);
8726 * Frees any resources used by the CResult_FundingLockedDecodeErrorZ.
8728 void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res);
8731 * Creates a new CResult_FundingLockedDecodeErrorZ which has the same data as `orig`
8732 * but with all dynamically-allocated buffers duplicated in new buffers.
8734 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig);
8737 * Creates a new CResult_InitDecodeErrorZ in the success state.
8739 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
8742 * Creates a new CResult_InitDecodeErrorZ in the error state.
8744 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
8747 * Frees any resources used by the CResult_InitDecodeErrorZ.
8749 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
8752 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
8753 * but with all dynamically-allocated buffers duplicated in new buffers.
8755 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
8758 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
8760 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
8763 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
8765 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
8768 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
8770 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
8773 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
8774 * but with all dynamically-allocated buffers duplicated in new buffers.
8776 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
8779 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
8781 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
8784 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
8786 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
8789 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
8791 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
8794 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
8795 * but with all dynamically-allocated buffers duplicated in new buffers.
8797 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
8800 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
8802 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
8805 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
8807 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
8810 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
8812 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
8815 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
8816 * but with all dynamically-allocated buffers duplicated in new buffers.
8818 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
8821 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
8823 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
8826 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
8828 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
8831 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
8833 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
8836 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
8837 * but with all dynamically-allocated buffers duplicated in new buffers.
8839 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
8842 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
8844 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
8847 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
8849 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
8852 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
8854 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
8857 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
8858 * but with all dynamically-allocated buffers duplicated in new buffers.
8860 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
8863 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
8865 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
8868 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
8870 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
8873 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
8875 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
8878 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
8879 * but with all dynamically-allocated buffers duplicated in new buffers.
8881 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
8884 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
8886 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
8889 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
8891 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
8894 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
8896 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
8899 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
8900 * but with all dynamically-allocated buffers duplicated in new buffers.
8902 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
8905 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
8907 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
8910 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
8912 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
8915 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
8917 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
8920 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
8921 * but with all dynamically-allocated buffers duplicated in new buffers.
8923 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
8926 * Creates a new CResult_PingDecodeErrorZ in the success state.
8928 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
8931 * Creates a new CResult_PingDecodeErrorZ in the error state.
8933 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
8936 * Frees any resources used by the CResult_PingDecodeErrorZ.
8938 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
8941 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
8942 * but with all dynamically-allocated buffers duplicated in new buffers.
8944 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
8947 * Creates a new CResult_PongDecodeErrorZ in the success state.
8949 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
8952 * Creates a new CResult_PongDecodeErrorZ in the error state.
8954 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
8957 * Frees any resources used by the CResult_PongDecodeErrorZ.
8959 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
8962 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
8963 * but with all dynamically-allocated buffers duplicated in new buffers.
8965 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
8968 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
8970 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
8973 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
8975 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
8978 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
8980 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
8983 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
8984 * but with all dynamically-allocated buffers duplicated in new buffers.
8986 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
8989 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
8991 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
8994 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
8996 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
8999 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
9001 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
9004 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
9005 * but with all dynamically-allocated buffers duplicated in new buffers.
9007 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
9010 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
9012 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
9015 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
9017 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
9020 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
9022 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
9025 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
9026 * but with all dynamically-allocated buffers duplicated in new buffers.
9028 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
9031 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
9033 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
9036 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
9038 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
9041 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
9043 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
9046 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
9047 * but with all dynamically-allocated buffers duplicated in new buffers.
9049 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
9052 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
9054 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
9057 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
9059 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
9062 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
9064 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
9067 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
9068 * but with all dynamically-allocated buffers duplicated in new buffers.
9070 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
9073 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
9075 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
9078 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
9080 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
9083 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
9085 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
9088 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
9089 * but with all dynamically-allocated buffers duplicated in new buffers.
9091 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
9094 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
9096 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
9099 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
9101 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
9104 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
9106 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
9109 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
9110 * but with all dynamically-allocated buffers duplicated in new buffers.
9112 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
9115 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
9117 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
9120 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
9122 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
9125 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
9127 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
9130 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
9131 * but with all dynamically-allocated buffers duplicated in new buffers.
9133 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
9136 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
9138 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
9141 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
9143 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
9146 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
9148 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
9151 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
9152 * but with all dynamically-allocated buffers duplicated in new buffers.
9154 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
9157 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
9159 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
9162 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
9164 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
9167 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
9169 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
9172 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
9173 * but with all dynamically-allocated buffers duplicated in new buffers.
9175 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
9178 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
9180 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
9183 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
9185 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
9188 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
9190 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
9193 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
9194 * but with all dynamically-allocated buffers duplicated in new buffers.
9196 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
9199 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
9201 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
9204 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
9206 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
9209 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
9211 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
9214 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
9215 * but with all dynamically-allocated buffers duplicated in new buffers.
9217 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
9220 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
9222 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
9225 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
9227 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
9230 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
9232 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
9235 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
9236 * but with all dynamically-allocated buffers duplicated in new buffers.
9238 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
9241 * Creates a new tuple which has the same data as `orig`
9242 * but with all dynamically-allocated buffers duplicated in new buffers.
9244 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
9247 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
9249 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
9252 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
9254 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
9257 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
9259 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
9262 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
9264 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
9267 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
9269 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
9272 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
9273 * but with all dynamically-allocated buffers duplicated in new buffers.
9275 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
9278 * Creates a new CResult_SignatureNoneZ in the success state.
9280 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
9283 * Creates a new CResult_SignatureNoneZ in the error state.
9285 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
9288 * Frees any resources used by the CResult_SignatureNoneZ.
9290 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
9293 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
9294 * but with all dynamically-allocated buffers duplicated in new buffers.
9296 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
9299 * Creates a new CResult_SignDecodeErrorZ in the success state.
9301 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
9304 * Creates a new CResult_SignDecodeErrorZ in the error state.
9306 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
9309 * Frees any resources used by the CResult_SignDecodeErrorZ.
9311 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
9314 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
9315 * but with all dynamically-allocated buffers duplicated in new buffers.
9317 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
9320 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9322 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
9325 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
9327 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
9330 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
9332 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
9335 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
9337 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
9340 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
9341 * but with all dynamically-allocated buffers duplicated in new buffers.
9343 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
9346 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
9348 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
9351 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
9353 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
9356 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
9358 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
9361 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
9362 * but with all dynamically-allocated buffers duplicated in new buffers.
9364 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
9367 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9369 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
9372 * Creates a new CResult_TransactionNoneZ in the success state.
9374 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
9377 * Creates a new CResult_TransactionNoneZ in the error state.
9379 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
9382 * Frees any resources used by the CResult_TransactionNoneZ.
9384 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
9387 * Creates a new CResult_NoneAPIErrorZ in the success state.
9389 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
9392 * Creates a new CResult_NoneAPIErrorZ in the error state.
9394 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
9397 * Frees any resources used by the CResult_NoneAPIErrorZ.
9399 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
9402 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
9403 * but with all dynamically-allocated buffers duplicated in new buffers.
9405 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
9408 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9410 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
9413 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9415 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
9418 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
9420 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
9423 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
9425 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
9428 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
9430 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
9433 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
9434 * but with all dynamically-allocated buffers duplicated in new buffers.
9436 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
9439 * Frees the buffer pointed to by `data` if `datalen` is non-0.
9441 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
9444 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
9446 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
9449 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
9451 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
9454 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
9456 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
9459 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
9461 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
9464 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
9466 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
9469 * Frees any resources used by the Event
9471 void Event_free(struct LDKEvent this_ptr);
9474 * Creates a copy of the Event
9476 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
9479 * Serialize the Event object into a byte array which can be read by Event_read
9481 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
9484 * Frees any resources used by the MessageSendEvent
9486 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
9489 * Creates a copy of the MessageSendEvent
9491 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
9494 * Calls the free function if one is set
9496 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
9499 * Calls the free function if one is set
9501 void EventsProvider_free(struct LDKEventsProvider this_ptr);
9504 * Frees any resources used by the APIError
9506 void APIError_free(struct LDKAPIError this_ptr);
9509 * Creates a copy of the APIError
9511 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
9514 * Creates a copy of the Level
9516 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
9519 * Returns the most verbose logging level.
9521 MUST_USE_RES enum LDKLevel Level_max(void);
9524 * Calls the free function if one is set
9526 void Logger_free(struct LDKLogger this_ptr);
9529 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
9531 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
9534 * Confirmations we will wait for before considering the channel locked in.
9535 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
9536 * equivalent limit applied to outbound channels).
9540 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
9543 * Confirmations we will wait for before considering the channel locked in.
9544 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
9545 * equivalent limit applied to outbound channels).
9549 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
9552 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
9553 * the number of blocks we have to punish our counterparty if they broadcast a revoked
9556 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
9557 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
9558 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
9559 * possibly with time in between to RBF the spending transaction).
9561 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
9562 * case of an honest unilateral channel close, which implicitly decrease the economic value of
9565 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
9566 * can tweak config to ask for more security, not less.
9568 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
9571 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
9572 * the number of blocks we have to punish our counterparty if they broadcast a revoked
9575 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
9576 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
9577 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
9578 * possibly with time in between to RBF the spending transaction).
9580 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
9581 * case of an honest unilateral channel close, which implicitly decrease the economic value of
9584 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
9585 * can tweak config to ask for more security, not less.
9587 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
9590 * Set to the smallest value HTLC we will accept to process.
9592 * This value is sent to our counterparty on channel-open and we close the channel any time
9593 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
9595 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
9598 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
9601 * Set to the smallest value HTLC we will accept to process.
9603 * This value is sent to our counterparty on channel-open and we close the channel any time
9604 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
9606 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
9609 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
9612 * Constructs a new ChannelHandshakeConfig given each field
9614 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);
9617 * Creates a copy of the ChannelHandshakeConfig
9619 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
9622 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
9624 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
9627 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
9629 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
9632 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
9633 * only applies to inbound channels.
9637 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9640 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
9641 * only applies to inbound channels.
9645 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9648 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
9649 * you to limit the maximum minimum-size they can require.
9651 * Default value: u64::max_value.
9653 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9656 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
9657 * you to limit the maximum minimum-size they can require.
9659 * Default value: u64::max_value.
9661 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9664 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
9665 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
9669 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9672 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
9673 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
9677 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9680 * The remote node will require we keep a certain amount in direct payment to ourselves at all
9681 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
9682 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
9684 * Default value: u64::max_value.
9686 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9689 * The remote node will require we keep a certain amount in direct payment to ourselves at all
9690 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
9691 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
9693 * Default value: u64::max_value.
9695 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9698 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
9699 * time. This allows you to set a minimum such value.
9703 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9706 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
9707 * time. This allows you to set a minimum such value.
9711 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
9714 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
9715 * required to always be higher than this value so this only applies to HTLC outputs (and
9716 * potentially to-self outputs before any payments have been made).
9717 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
9718 * This setting allows you to set a minimum dust limit for their commitment transactions,
9719 * reflecting the reality that tiny outputs are not considered standard transactions and will
9720 * not propagate through the Bitcoin network.
9722 * Default value: 546, the current dust limit on the Bitcoin network.
9724 uint64_t ChannelHandshakeLimits_get_min_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9727 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
9728 * required to always be higher than this value so this only applies to HTLC outputs (and
9729 * potentially to-self outputs before any payments have been made).
9730 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
9731 * This setting allows you to set a minimum dust limit for their commitment transactions,
9732 * reflecting the reality that tiny outputs are not considered standard transactions and will
9733 * not propagate through the Bitcoin network.
9735 * Default value: 546, the current dust limit on the Bitcoin network.
9737 void ChannelHandshakeLimits_set_min_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9740 * Maximum allowed threshold above which outputs will not be generated in their commitment
9742 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
9744 * Default value: u64::max_value.
9746 uint64_t ChannelHandshakeLimits_get_max_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9749 * Maximum allowed threshold above which outputs will not be generated in their commitment
9751 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
9753 * Default value: u64::max_value.
9755 void ChannelHandshakeLimits_set_max_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9758 * Before a channel is usable the funding transaction will need to be confirmed by at least a
9759 * certain number of blocks, specified by the node which is not the funder (as the funder can
9760 * assume they aren't going to double-spend themselves).
9761 * This config allows you to set a limit on the maximum amount of time to wait.
9763 * Default value: 144, or roughly one day and only applies to outbound channels.
9765 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9768 * Before a channel is usable the funding transaction will need to be confirmed by at least a
9769 * certain number of blocks, specified by the node which is not the funder (as the funder can
9770 * assume they aren't going to double-spend themselves).
9771 * This config allows you to set a limit on the maximum amount of time to wait.
9773 * Default value: 144, or roughly one day and only applies to outbound channels.
9775 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
9778 * Set to force the incoming channel to match our announced channel preference in
9781 * Default value: true, to make the default that no announced channels are possible (which is
9782 * appropriate for any nodes which are not online very reliably).
9784 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9787 * Set to force the incoming channel to match our announced channel preference in
9790 * Default value: true, to make the default that no announced channels are possible (which is
9791 * appropriate for any nodes which are not online very reliably).
9793 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
9796 * Set to the amount of time we're willing to wait to claim money back to us.
9798 * Not checking this value would be a security issue, as our peer would be able to set it to
9799 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
9801 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
9802 * reduce the loss of having useless locked funds (if your peer accepts)
9804 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9807 * Set to the amount of time we're willing to wait to claim money back to us.
9809 * Not checking this value would be a security issue, as our peer would be able to set it to
9810 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
9812 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
9813 * reduce the loss of having useless locked funds (if your peer accepts)
9815 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
9818 * Constructs a new ChannelHandshakeLimits given each field
9820 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);
9823 * Creates a copy of the ChannelHandshakeLimits
9825 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
9828 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
9830 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
9833 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
9835 void ChannelConfig_free(struct LDKChannelConfig this_obj);
9838 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
9839 * This may be allowed to change at runtime in a later update, however doing so must result in
9840 * update messages sent to notify all nodes of our updated relay fee.
9844 uint32_t ChannelConfig_get_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
9847 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
9848 * This may be allowed to change at runtime in a later update, however doing so must result in
9849 * update messages sent to notify all nodes of our updated relay fee.
9853 void ChannelConfig_set_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
9856 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
9857 * the channel this config applies to.
9859 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
9860 * HTLC balance when a channel appears on-chain whereas
9861 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
9862 * (non-HTLC-encumbered) balance.
9864 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
9865 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
9866 * commitment transaction at least once per this many blocks (minus some margin to allow us
9867 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
9868 * the spending transaction).
9870 * Default value: 72 (12 hours at an average of 6 blocks/hour).
9871 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
9872 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
9874 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
9876 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
9879 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
9880 * the channel this config applies to.
9882 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
9883 * HTLC balance when a channel appears on-chain whereas
9884 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
9885 * (non-HTLC-encumbered) balance.
9887 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
9888 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
9889 * commitment transaction at least once per this many blocks (minus some margin to allow us
9890 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
9891 * the spending transaction).
9893 * Default value: 72 (12 hours at an average of 6 blocks/hour).
9894 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
9895 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
9897 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
9899 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
9902 * Set to announce the channel publicly and notify all nodes that they can route via this
9905 * This should only be set to true for nodes which expect to be online reliably.
9907 * As the node which funds a channel picks this value this will only apply for new outbound
9908 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
9910 * This cannot be changed after the initial channel handshake.
9912 * Default value: false.
9914 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
9917 * Set to announce the channel publicly and notify all nodes that they can route via this
9920 * This should only be set to true for nodes which expect to be online reliably.
9922 * As the node which funds a channel picks this value this will only apply for new outbound
9923 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
9925 * This cannot be changed after the initial channel handshake.
9927 * Default value: false.
9929 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
9932 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
9933 * supports it, they will then enforce the mutual-close output to us matches what we provided
9934 * at intialization, preventing us from closing to an alternate pubkey.
9936 * This is set to true by default to provide a slight increase in security, though ultimately
9937 * any attacker who is able to take control of a channel can just as easily send the funds via
9938 * lightning payments, so we never require that our counterparties support this option.
9940 * This cannot be changed after a channel has been initialized.
9942 * Default value: true.
9944 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
9947 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
9948 * supports it, they will then enforce the mutual-close output to us matches what we provided
9949 * at intialization, preventing us from closing to an alternate pubkey.
9951 * This is set to true by default to provide a slight increase in security, though ultimately
9952 * any attacker who is able to take control of a channel can just as easily send the funds via
9953 * lightning payments, so we never require that our counterparties support this option.
9955 * This cannot be changed after a channel has been initialized.
9957 * Default value: true.
9959 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
9962 * Constructs a new ChannelConfig given each field
9964 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);
9967 * Creates a copy of the ChannelConfig
9969 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
9972 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
9974 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
9977 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
9979 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
9982 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
9984 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
9987 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
9989 void UserConfig_free(struct LDKUserConfig this_obj);
9992 * Channel config that we propose to our counterparty.
9994 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
9997 * Channel config that we propose to our counterparty.
9999 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
10002 * Limits applied to our counterparty's proposed channel config settings.
10004 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
10007 * Limits applied to our counterparty's proposed channel config settings.
10009 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
10012 * Channel config which affects behavior during channel lifetime.
10014 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
10017 * Channel config which affects behavior during channel lifetime.
10019 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
10022 * Constructs a new UserConfig given each field
10024 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);
10027 * Creates a copy of the UserConfig
10029 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
10032 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
10034 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
10037 * Creates a copy of the AccessError
10039 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
10042 * Calls the free function if one is set
10044 void Access_free(struct LDKAccess this_ptr);
10047 * Calls the free function if one is set
10049 void Listen_free(struct LDKListen this_ptr);
10052 * Calls the free function if one is set
10054 void Watch_free(struct LDKWatch this_ptr);
10057 * Calls the free function if one is set
10059 void Filter_free(struct LDKFilter this_ptr);
10062 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
10064 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
10067 * First block where the transaction output may have been spent.
10069 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
10072 * First block where the transaction output may have been spent.
10074 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10077 * Outpoint identifying the transaction output.
10079 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
10082 * Outpoint identifying the transaction output.
10084 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
10087 * Spending condition of the transaction output.
10089 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
10092 * Spending condition of the transaction output.
10094 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
10097 * Constructs a new WatchedOutput given each field
10099 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
10102 * Calls the free function if one is set
10104 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
10107 * Creates a copy of the ConfirmationTarget
10109 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
10112 * Calls the free function if one is set
10114 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
10117 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
10119 void ChainMonitor_free(struct LDKChainMonitor this_obj);
10122 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
10123 * of a channel and reacting accordingly based on transactions in the connected block. See
10124 * [`ChannelMonitor::block_connected`] for details. Any HTLCs that were resolved on chain will
10125 * be returned by [`chain::Watch::release_pending_monitor_events`].
10127 * Calls back to [`chain::Filter`] if any monitor indicated new outputs to watch. Subsequent
10128 * calls must not exclude any transactions matching the new outputs nor any in-block
10129 * descendants of such transactions. It is not necessary to re-fetch the block to obtain
10130 * updated `txdata`.
10132 void ChainMonitor_block_connected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
10135 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
10136 * of a channel and reacting accordingly to newly confirmed transactions. For details, see
10137 * [`ChannelMonitor::transactions_confirmed`].
10139 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
10140 * blocks. May be called before or after [`update_best_block`] for transactions in the
10141 * corresponding block. See [`update_best_block`] for further calling expectations.
10143 * [`block_connected`]: Self::block_connected
10144 * [`update_best_block`]: Self::update_best_block
10146 void ChainMonitor_transactions_confirmed(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
10149 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
10150 * of a channel and reacting accordingly based on the new chain tip. For details, see
10151 * [`ChannelMonitor::update_best_block`].
10153 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
10154 * blocks. May be called before or after [`transactions_confirmed`] for the corresponding
10157 * Must be called after new blocks become available for the most recent block. Intermediary
10158 * blocks, however, may be safely skipped. In the event of a chain re-organization, this only
10159 * needs to be called for the most recent block assuming `transaction_unconfirmed` is called
10160 * for any affected transactions.
10162 * [`block_connected`]: Self::block_connected
10163 * [`transactions_confirmed`]: Self::transactions_confirmed
10164 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
10166 void ChainMonitor_update_best_block(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height);
10169 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
10170 * of a channel based on the disconnected block. See [`ChannelMonitor::block_disconnected`] for
10173 void ChainMonitor_block_disconnected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t disconnected_height);
10176 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
10177 * of a channel based on transactions unconfirmed as a result of a chain reorganization. See
10178 * [`ChannelMonitor::transaction_unconfirmed`] for details.
10180 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
10181 * than blocks. May be called before or after [`update_best_block`] for transactions in the
10182 * corresponding block. See [`update_best_block`] for further calling expectations.
10184 * [`block_disconnected`]: Self::block_disconnected
10185 * [`update_best_block`]: Self::update_best_block
10187 void ChainMonitor_transaction_unconfirmed(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*txid)[32]);
10190 * Returns the set of txids that should be monitored for re-organization out of the chain.
10192 MUST_USE_RES struct LDKCVec_TxidZ ChainMonitor_get_relevant_txids(const struct LDKChainMonitor *NONNULL_PTR this_arg);
10195 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
10197 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
10198 * will call back to it indicating transactions and outputs of interest. This allows clients to
10199 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
10200 * always need to fetch full blocks absent another means for determining which blocks contain
10201 * transactions relevant to the watched channels.
10203 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
10206 * Constructs a new Watch which calls the relevant methods on this_arg.
10207 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
10209 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
10212 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
10213 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
10215 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
10218 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
10220 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
10223 * The sequence number of this update. Updates *must* be replayed in-order according to this
10224 * sequence number (and updates may panic if they are not). The update_id values are strictly
10225 * increasing and increase by one for each new update, with one exception specified below.
10227 * This sequence number is also used to track up to which points updates which returned
10228 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
10229 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
10231 * The only instance where update_id values are not strictly increasing is the case where we
10232 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
10233 * its docs for more details.
10235 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
10238 * The sequence number of this update. Updates *must* be replayed in-order according to this
10239 * sequence number (and updates may panic if they are not). The update_id values are strictly
10240 * increasing and increase by one for each new update, with one exception specified below.
10242 * This sequence number is also used to track up to which points updates which returned
10243 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
10244 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
10246 * The only instance where update_id values are not strictly increasing is the case where we
10247 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
10248 * its docs for more details.
10250 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
10253 * Creates a copy of the ChannelMonitorUpdate
10255 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
10258 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
10260 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
10263 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
10265 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
10268 * Creates a copy of the ChannelMonitorUpdateErr
10270 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
10273 * Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
10275 void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
10278 * Creates a copy of the MonitorUpdateError
10280 struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
10283 * Frees any resources used by the MonitorEvent
10285 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
10288 * Creates a copy of the MonitorEvent
10290 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
10293 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
10295 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
10298 * Creates a copy of the HTLCUpdate
10300 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
10303 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
10305 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
10308 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
10310 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
10313 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
10315 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
10318 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
10320 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
10323 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
10326 * panics if the given update is not the next update by update_id.
10328 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);
10331 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
10334 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10337 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
10339 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10342 * Gets a list of txids, with their output scripts (in the order they appear in the
10343 * transaction), which we must learn about spends of via block_connected().
10345 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10348 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
10349 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
10350 * have been registered.
10352 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
10355 * Get the list of HTLCs who's status has been updated on chain. This should be called by
10356 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
10358 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10361 * Gets the list of pending events which were generated by previous actions, clearing the list
10364 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
10365 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
10366 * no internal locking in ChannelMonitors.
10368 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10371 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
10372 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
10373 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
10374 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
10375 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
10376 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
10377 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
10378 * out-of-band the other node operator to coordinate with him if option is available to you.
10379 * In any-case, choice is up to the user.
10381 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);
10384 * Processes transactions in a newly connected block, which may result in any of the following:
10385 * - update the monitor's state against resolved HTLCs
10386 * - punish the counterparty in the case of seeing a revoked commitment transaction
10387 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
10388 * - detect settled outputs for later spending
10389 * - schedule and bump any in-flight claims
10391 * Returns any new outputs to watch from `txdata`; after called, these are also included in
10392 * [`get_outputs_to_watch`].
10394 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
10396 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);
10399 * Determines if the disconnected block contained any transactions of interest and updates
10402 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);
10405 * Processes transactions confirmed in a block with the given header and height, returning new
10406 * outputs to watch. See [`block_connected`] for details.
10408 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
10409 * blocks. May be called before or after [`update_best_block`] for transactions in the
10410 * corresponding block. See [`update_best_block`] for further calling expectations.
10412 * [`block_connected`]: Self::block_connected
10413 * [`update_best_block`]: Self::update_best_block
10415 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);
10418 * Processes a transaction that was reorganized out of the chain.
10420 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
10421 * than blocks. May be called before or after [`update_best_block`] for transactions in the
10422 * corresponding block. See [`update_best_block`] for further calling expectations.
10424 * [`block_disconnected`]: Self::block_disconnected
10425 * [`update_best_block`]: Self::update_best_block
10427 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);
10430 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
10431 * [`block_connected`] for details.
10433 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
10434 * blocks. May be called before or after [`transactions_confirmed`] for the corresponding
10437 * Must be called after new blocks become available for the most recent block. Intermediary
10438 * blocks, however, may be safely skipped. In the event of a chain re-organization, this only
10439 * needs to be called for the most recent block assuming `transaction_unconfirmed` is called
10440 * for any affected transactions.
10442 * [`block_connected`]: Self::block_connected
10443 * [`transactions_confirmed`]: Self::transactions_confirmed
10444 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
10446 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);
10449 * Returns the set of txids that should be monitored for re-organization out of the chain.
10451 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10454 * Calls the free function if one is set
10456 void Persist_free(struct LDKPersist this_ptr);
10459 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
10461 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
10464 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
10466 void OutPoint_free(struct LDKOutPoint this_obj);
10469 * The referenced transaction's txid.
10471 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
10474 * The referenced transaction's txid.
10476 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10479 * The index of the referenced output in its transaction's vout.
10481 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
10484 * The index of the referenced output in its transaction's vout.
10486 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
10489 * Constructs a new OutPoint given each field
10491 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
10494 * Creates a copy of the OutPoint
10496 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
10499 * Convert an `OutPoint` to a lightning channel id.
10501 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
10504 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
10506 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
10509 * Read a OutPoint from a byte array, created by OutPoint_write
10511 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
10514 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
10516 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
10519 * The outpoint which is spendable
10521 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10524 * The outpoint which is spendable
10526 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
10529 * Per commitment point to derive delayed_payment_key by key holder
10531 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10534 * Per commitment point to derive delayed_payment_key by key holder
10536 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10539 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
10540 * the witness_script.
10542 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10545 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
10546 * the witness_script.
10548 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
10551 * The output which is referenced by the given outpoint
10553 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
10556 * The revocation point specific to the commitment transaction which was broadcast. Used to
10557 * derive the witnessScript for this output.
10559 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10562 * The revocation point specific to the commitment transaction which was broadcast. Used to
10563 * derive the witnessScript for this output.
10565 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10568 * Arbitrary identification information returned by a call to
10569 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
10570 * the channel to spend the output.
10572 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
10575 * Arbitrary identification information returned by a call to
10576 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
10577 * the channel to spend the output.
10579 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10582 * The value of the channel which this output originated from, possibly indirectly.
10584 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10587 * The value of the channel which this output originated from, possibly indirectly.
10589 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
10592 * Constructs a new DelayedPaymentOutputDescriptor given each field
10594 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);
10597 * Creates a copy of the DelayedPaymentOutputDescriptor
10599 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
10602 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
10604 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
10607 * The outpoint which is spendable
10609 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10612 * The outpoint which is spendable
10614 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
10617 * The output which is referenced by the given outpoint
10619 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
10622 * Arbitrary identification information returned by a call to
10623 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
10624 * the channel to spend the output.
10626 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
10629 * Arbitrary identification information returned by a call to
10630 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
10631 * the channel to spend the output.
10633 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10636 * The value of the channel which this transactions spends.
10638 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10641 * The value of the channel which this transactions spends.
10643 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
10646 * Constructs a new StaticPaymentOutputDescriptor given each field
10648 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);
10651 * Creates a copy of the StaticPaymentOutputDescriptor
10653 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
10656 * Frees any resources used by the SpendableOutputDescriptor
10658 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
10661 * Creates a copy of the SpendableOutputDescriptor
10663 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
10666 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
10668 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
10671 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
10673 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
10676 * Calls the free function if one is set
10678 void BaseSign_free(struct LDKBaseSign this_ptr);
10681 * Creates a copy of a Sign
10683 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
10686 * Calls the free function if one is set
10688 void Sign_free(struct LDKSign this_ptr);
10691 * Calls the free function if one is set
10693 void KeysInterface_free(struct LDKKeysInterface this_ptr);
10696 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
10698 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
10701 * Private key of anchor tx
10703 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10706 * Private key of anchor tx
10708 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10711 * Holder secret key for blinded revocation pubkey
10713 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10716 * Holder secret key for blinded revocation pubkey
10718 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10721 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
10723 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10726 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
10728 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10731 * Holder secret key used in HTLC tx
10733 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10736 * Holder secret key used in HTLC tx
10738 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10741 * Holder htlc secret key used in commitment tx htlc outputs
10743 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10746 * Holder htlc secret key used in commitment tx htlc outputs
10748 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10753 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10758 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10761 * Creates a copy of the InMemorySigner
10763 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
10766 * Create a new InMemorySigner
10768 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);
10771 * Counterparty pubkeys.
10772 * Will panic if ready_channel wasn't called.
10774 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10777 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
10778 * transactions, ie the amount of time that we have to wait to recover our funds if we
10779 * broadcast a transaction.
10780 * Will panic if ready_channel wasn't called.
10782 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10785 * The contest_delay value specified by us and applied on transactions broadcastable
10786 * by our counterparty, ie the amount of time that they have to wait to recover their funds
10787 * if they broadcast a transaction.
10788 * Will panic if ready_channel wasn't called.
10790 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10793 * Whether the holder is the initiator
10794 * Will panic if ready_channel wasn't called.
10796 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10800 * Will panic if ready_channel wasn't called.
10802 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10805 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
10806 * building transactions.
10808 * Will panic if ready_channel wasn't called.
10810 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10813 * Sign the single input of spend_tx at index `input_idx` which spends the output
10814 * described by descriptor, returning the witness stack for the input.
10816 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
10817 * or is not spending the outpoint described by `descriptor.outpoint`.
10819 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);
10822 * Sign the single input of spend_tx at index `input_idx` which spends the output
10823 * described by descriptor, returning the witness stack for the input.
10825 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
10826 * is not spending the outpoint described by `descriptor.outpoint`, or does not have a
10827 * sequence set to `descriptor.to_self_delay`.
10829 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);
10832 * Constructs a new BaseSign which calls the relevant methods on this_arg.
10833 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
10835 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10838 * Constructs a new Sign which calls the relevant methods on this_arg.
10839 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
10841 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10844 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
10846 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
10849 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
10851 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
10854 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
10856 void KeysManager_free(struct LDKKeysManager this_obj);
10859 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
10860 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
10861 * starting_time isn't strictly required to actually be a time, but it must absolutely,
10862 * without a doubt, be unique to this instance. ie if you start multiple times with the same
10863 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
10864 * simply use the current time (with very high precision).
10866 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
10867 * obviously, starting_time should be unique every time you reload the library - it is only
10868 * used to generate new ephemeral key data (which will be stored by the individual channel if
10871 * Note that the seed is required to recover certain on-chain funds independent of
10872 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
10873 * channel, and some on-chain during-closing funds.
10875 * Note that until the 0.1 release there is no guarantee of backward compatibility between
10876 * versions. Once the library is more fully supported, the docs will be updated to include a
10877 * detailed description of the guarantee.
10879 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
10882 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
10884 * Key derivation parameters are accessible through a per-channel secrets
10885 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
10886 * onchain output detection for which a corresponding delayed_payment_key must be derived.
10888 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]);
10891 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
10892 * output to the given change destination (if sufficient change value remains). The
10893 * transaction will have a feerate, at least, of the given value.
10895 * Returns `Err(())` if the output value is greater than the input value minus required fee or
10896 * if a descriptor was duplicated.
10898 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
10900 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
10901 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
10903 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);
10906 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
10907 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
10909 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
10912 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
10914 void ChannelManager_free(struct LDKChannelManager this_obj);
10917 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
10919 void ChainParameters_free(struct LDKChainParameters this_obj);
10922 * The network for determining the `chain_hash` in Lightning messages.
10924 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
10927 * The network for determining the `chain_hash` in Lightning messages.
10929 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
10932 * The hash and height of the latest block successfully connected.
10934 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
10936 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
10939 * The hash and height of the latest block successfully connected.
10941 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
10943 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
10946 * Constructs a new ChainParameters given each field
10948 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
10951 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
10953 void BestBlock_free(struct LDKBestBlock this_obj);
10956 * Creates a copy of the BestBlock
10958 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
10961 * Returns the best block from the genesis of the given network.
10963 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
10966 * Returns the best block as identified by the given block hash and height.
10968 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
10971 * Returns the best block hash.
10973 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
10976 * Returns the best block height.
10978 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
10981 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
10983 void ChannelDetails_free(struct LDKChannelDetails this_obj);
10986 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
10987 * thereafter this is the txid of the funding transaction xor the funding transaction output).
10988 * Note that this means this value is *not* persistent - it can change once during the
10989 * lifetime of the channel.
10991 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
10994 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
10995 * thereafter this is the txid of the funding transaction xor the funding transaction output).
10996 * Note that this means this value is *not* persistent - it can change once during the
10997 * lifetime of the channel.
10999 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11002 * The position of the funding transaction in the chain. None if the funding transaction has
11003 * not yet been confirmed and the channel fully opened.
11005 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11008 * The position of the funding transaction in the chain. None if the funding transaction has
11009 * not yet been confirmed and the channel fully opened.
11011 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
11014 * The node_id of our counterparty
11016 struct LDKPublicKey ChannelDetails_get_remote_network_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11019 * The node_id of our counterparty
11021 void ChannelDetails_set_remote_network_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11024 * The Features the channel counterparty provided upon last connection.
11025 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
11026 * many routing-relevant features are present in the init context.
11028 struct LDKInitFeatures ChannelDetails_get_counterparty_features(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11031 * The Features the channel counterparty provided upon last connection.
11032 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
11033 * many routing-relevant features are present in the init context.
11035 void ChannelDetails_set_counterparty_features(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
11038 * The value, in satoshis, of this channel as appears in the funding output
11040 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11043 * The value, in satoshis, of this channel as appears in the funding output
11045 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
11048 * The user_id passed in to create_channel, or 0 if the channel was inbound.
11050 uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11053 * The user_id passed in to create_channel, or 0 if the channel was inbound.
11055 void ChannelDetails_set_user_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
11058 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
11059 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
11060 * available for inclusion in new outbound HTLCs). This further does not include any pending
11061 * outgoing HTLCs which are awaiting some other resolution to be sent.
11063 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11066 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
11067 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
11068 * available for inclusion in new outbound HTLCs). This further does not include any pending
11069 * outgoing HTLCs which are awaiting some other resolution to be sent.
11071 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
11074 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
11075 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
11076 * available for inclusion in new inbound HTLCs).
11077 * Note that there are some corner cases not fully handled here, so the actual available
11078 * inbound capacity may be slightly higher than this.
11080 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11083 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
11084 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
11085 * available for inclusion in new inbound HTLCs).
11086 * Note that there are some corner cases not fully handled here, so the actual available
11087 * inbound capacity may be slightly higher than this.
11089 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
11092 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
11093 * the peer is connected, and (c) no monitor update failure is pending resolution.
11095 bool ChannelDetails_get_is_live(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
11098 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
11099 * the peer is connected, and (c) no monitor update failure is pending resolution.
11101 void ChannelDetails_set_is_live(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
11104 * Creates a copy of the ChannelDetails
11106 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
11109 * Frees any resources used by the PaymentSendFailure
11111 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
11114 * Creates a copy of the PaymentSendFailure
11116 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
11119 * Constructs a new ChannelManager to hold several channels and route between them.
11121 * This is the main \"logic hub\" for all channel-related actions, and implements
11122 * ChannelMessageHandler.
11124 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
11126 * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
11128 * Users need to notify the new ChannelManager when a new block is connected or
11129 * disconnected using its `block_connected` and `block_disconnected` methods, starting
11130 * from after `params.latest_hash`.
11132 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);
11135 * Gets the current configuration applied to all new channels, as
11137 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
11140 * Creates a new outbound channel to the given remote node and with the given value.
11142 * user_id will be provided back as user_channel_id in FundingGenerationReady events to allow
11143 * tracking of which events correspond with which create_channel call. Note that the
11144 * user_channel_id defaults to 0 for inbound channels, so you may wish to avoid using 0 for
11145 * user_id here. user_id has no meaning inside of LDK, it is simply copied to events and
11146 * otherwise ignored.
11148 * If successful, will generate a SendOpenChannel message event, so you should probably poll
11149 * PeerManager::process_events afterwards.
11151 * Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
11152 * greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
11154 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);
11157 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
11158 * more information.
11160 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
11163 * Gets the list of usable channels, in random order. Useful as an argument to
11164 * get_route to ensure non-announced channels are used.
11166 * These are guaranteed to have their is_live value set to true, see the documentation for
11167 * ChannelDetails::is_live for more info on exactly what the criteria are.
11169 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
11172 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
11173 * will be accepted on the given channel, and after additional timeout/the closing of all
11174 * pending HTLCs, the channel will be closed on chain.
11176 * May generate a SendShutdown message event on success, which should be relayed.
11178 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
11181 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
11182 * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
11184 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
11187 * Force close all channels, immediately broadcasting the latest local commitment transaction
11188 * for each to the chain and rejecting new HTLCs on each.
11190 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
11193 * Sends a payment along a given route.
11195 * Value parameters are provided via the last hop in route, see documentation for RouteHop
11196 * fields for more info.
11198 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
11199 * payment), we don't do anything to stop you! We always try to ensure that if the provided
11200 * next hop knows the preimage to payment_hash they can claim an additional amount as
11201 * specified in the last hop in the route! Thus, you should probably do your own
11202 * payment_preimage tracking (which you should already be doing as they represent \"proof of
11203 * payment\") and prevent double-sends yourself.
11205 * May generate SendHTLCs message(s) event on success, which should be relayed.
11207 * Each path may have a different return value, and PaymentSendValue may return a Vec with
11208 * each entry matching the corresponding-index entry in the route paths, see
11209 * PaymentSendFailure for more info.
11211 * In general, a path may raise:
11212 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
11213 * node public key) is specified.
11214 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
11215 * (including due to previous monitor update failure or new permanent monitor update
11217 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
11218 * relevant updates.
11220 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
11221 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
11222 * different route unless you intend to pay twice!
11224 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
11225 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
11226 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
11227 * must not contain multiple paths as multi-path payments require a recipient-provided
11229 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
11230 * bit set (either as required or as available). If multiple paths are present in the Route,
11231 * we assume the invoice had the basic_mpp feature set.
11233 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);
11236 * Call this upon creation of a funding transaction for the given channel.
11238 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
11239 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
11241 * Panics if a funding transaction has already been provided for this channel.
11243 * May panic if the output found in the funding transaction is duplicative with some other
11244 * channel (note that this should be trivially prevented by using unique funding transaction
11245 * keys per-channel).
11247 * Do NOT broadcast the funding transaction yourself. When we have safely received our
11248 * counterparty's signature the funding transaction will automatically be broadcast via the
11249 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
11251 * Note that this includes RBF or similar transaction replacement strategies - lightning does
11252 * not currently support replacing a funding transaction on an existing channel. Instead,
11253 * create a new channel with a conflicting funding transaction.
11255 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);
11258 * Generates a signed node_announcement from the given arguments and creates a
11259 * BroadcastNodeAnnouncement event. Note that such messages will be ignored unless peers have
11260 * seen a channel_announcement from us (ie unless we have public channels open).
11262 * RGB is a node \"color\" and alias is a printable human-readable string to describe this node
11263 * to humans. They carry no in-protocol meaning.
11265 * addresses represent the set (possibly empty) of socket addresses on which this node accepts
11266 * incoming connections. These will be broadcast to the network, publicly tying these
11267 * addresses together. If you wish to preserve user privacy, addresses should likely contain
11268 * only Tor Onion addresses.
11270 * Panics if addresses is absurdly large (more than 500).
11272 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
11275 * Processes HTLCs which are pending waiting on random forward delay.
11277 * Should only really ever be called in response to a PendingHTLCsForwardable event.
11278 * Will likely generate further events.
11280 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
11283 * If a peer is disconnected we mark any channels with that peer as 'disabled'.
11284 * After some time, if channels are still disabled we need to broadcast a ChannelUpdate
11285 * to inform the network about the uselessness of these channels.
11287 * This method handles all the details, and must be called roughly once per minute.
11289 * Note that in some rare cases this may generate a `chain::Watch::update_channel` call.
11291 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
11294 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
11295 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
11296 * along the path (including in our own channel on which we received it).
11297 * Returns false if no payment was found to fail backwards, true if the process of failing the
11298 * HTLC backwards has been started.
11300 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);
11303 * Provides a payment preimage in response to a PaymentReceived event, returning true and
11304 * generating message events for the net layer to claim the payment, if possible. Thus, you
11305 * should probably kick the net layer to go send messages if this returns true!
11307 * You must specify the expected amounts for this HTLC, and we will only claim HTLCs
11308 * available within a few percent of the expected amount. This is critical for several
11309 * reasons : a) it avoids providing senders with `proof-of-payment` (in the form of the
11310 * payment_preimage without having provided the full value and b) it avoids certain
11311 * privacy-breaking recipient-probing attacks which may reveal payment activity to
11312 * motivated attackers.
11314 * Note that the privacy concerns in (b) are not relevant in payments with a payment_secret
11315 * set. Thus, for such payments we will claim any payments which do not under-pay.
11317 * May panic if called except in response to a PaymentReceived event.
11319 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);
11322 * Gets the node_id held by this ChannelManager
11324 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
11327 * Restores a single, given channel to normal operation after a
11328 * ChannelMonitorUpdateErr::TemporaryFailure was returned from a channel monitor update
11331 * All ChannelMonitor updates up to and including highest_applied_update_id must have been
11332 * fully committed in every copy of the given channels' ChannelMonitors.
11334 * Note that there is no effect to calling with a highest_applied_update_id other than the
11335 * current latest ChannelMonitorUpdate and one call to this function after multiple
11336 * ChannelMonitorUpdateErr::TemporaryFailures is fine. The highest_applied_update_id field
11337 * exists largely only to prevent races between this and concurrent update_monitor calls.
11339 * Thus, the anticipated use is, at a high level:
11340 * 1) You register a chain::Watch with this ChannelManager,
11341 * 2) it stores each update to disk, and begins updating any remote (eg watchtower) copies of
11342 * said ChannelMonitors as it can, returning ChannelMonitorUpdateErr::TemporaryFailures
11343 * any time it cannot do so instantly,
11344 * 3) update(s) are applied to each remote copy of a ChannelMonitor,
11345 * 4) once all remote copies are updated, you call this function with the update_id that
11346 * completed, and once it is the latest the Channel will be re-enabled.
11348 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);
11351 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
11352 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
11354 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
11357 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
11358 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
11360 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
11363 * Constructs a new Listen which calls the relevant methods on this_arg.
11364 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
11366 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
11369 * Updates channel state to take note of transactions which were confirmed in the given block
11370 * at the given height.
11372 * Note that you must still call (or have called) [`update_best_block`] with the block
11373 * information which is included here.
11375 * This method may be called before or after [`update_best_block`] for a given block's
11376 * transaction data and may be called multiple times with additional transaction data for a
11379 * This method may be called for a previous block after an [`update_best_block`] call has
11380 * been made for a later block, however it must *not* be called with transaction data from a
11381 * block which is no longer in the best chain (ie where [`update_best_block`] has already
11382 * been informed about a blockchain reorganization which no longer includes the block which
11383 * corresponds to `header`).
11385 * [`update_best_block`]: `Self::update_best_block`
11387 void ChannelManager_transactions_confirmed(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKCVec_C2Tuple_usizeTransactionZZ txdata);
11390 * Updates channel state with the current best blockchain tip. You should attempt to call this
11391 * quickly after a new block becomes available, however if multiple new blocks become
11392 * available at the same time, only a single `update_best_block()` call needs to be made.
11394 * This method should also be called immediately after any block disconnections, once at the
11395 * reorganization fork point, and once with the new chain tip. Calling this method at the
11396 * blockchain reorganization fork point ensures we learn when a funding transaction which was
11397 * previously confirmed is reorganized out of the blockchain, ensuring we do not continue to
11398 * accept payments which cannot be enforced on-chain.
11400 * In both the block-connection and block-disconnection case, this method may be called either
11401 * once per block connected or disconnected, or simply at the fork point and new tip(s),
11402 * skipping any intermediary blocks.
11404 void ChannelManager_update_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height);
11407 * Gets the set of txids which should be monitored for their confirmation state.
11409 * If you're providing information about reorganizations via [`transaction_unconfirmed`], this
11410 * is the set of transactions which you may need to call [`transaction_unconfirmed`] for.
11412 * This may be useful to poll to determine the set of transactions which must be registered
11413 * with an Electrum server or for which an Electrum server needs to be polled to determine
11414 * transaction confirmation state.
11416 * This may update after any [`transactions_confirmed`] or [`block_connected`] call.
11418 * Note that this is NOT the set of transactions which must be included in calls to
11419 * [`transactions_confirmed`] if they are confirmed, but a small subset of it.
11421 * [`transactions_confirmed`]: Self::transactions_confirmed
11422 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
11423 * [`block_connected`]: chain::Listen::block_connected
11425 MUST_USE_RES struct LDKCVec_TxidZ ChannelManager_get_relevant_txids(const struct LDKChannelManager *NONNULL_PTR this_arg);
11428 * Marks a transaction as having been reorganized out of the blockchain.
11430 * If a transaction is included in [`get_relevant_txids`], and is no longer in the main branch
11431 * of the blockchain, this function should be called to indicate that the transaction should
11432 * be considered reorganized out.
11434 * Once this is called, the given transaction will no longer appear on [`get_relevant_txids`],
11435 * though this may be called repeatedly for a given transaction without issue.
11437 * Note that if the transaction is confirmed on the main chain in a different block (indicated
11438 * via a call to [`transactions_confirmed`]), it may re-appear in [`get_relevant_txids`], thus
11439 * be very wary of race-conditions wherein the final state of a transaction indicated via
11440 * these APIs is not the same as its state on the blockchain.
11442 * [`transactions_confirmed`]: Self::transactions_confirmed
11443 * [`get_relevant_txids`]: Self::get_relevant_txids
11445 void ChannelManager_transaction_unconfirmed(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*txid)[32]);
11448 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
11449 * indicating whether persistence is necessary. Only one listener on
11450 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
11452 * Note that the feature `allow_wallclock_use` must be enabled to use this function.
11454 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
11457 * Blocks until ChannelManager needs to be persisted. Only one listener on
11458 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
11461 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
11464 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
11465 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
11467 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
11470 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
11472 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
11475 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
11477 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
11480 * The keys provider which will give us relevant keys. Some keys will be loaded during
11481 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
11484 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11487 * The keys provider which will give us relevant keys. Some keys will be loaded during
11488 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
11491 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
11494 * The fee_estimator for use in the ChannelManager in the future.
11496 * No calls to the FeeEstimator will be made during deserialization.
11498 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11501 * The fee_estimator for use in the ChannelManager in the future.
11503 * No calls to the FeeEstimator will be made during deserialization.
11505 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
11508 * The chain::Watch for use in the ChannelManager in the future.
11510 * No calls to the chain::Watch will be made during deserialization. It is assumed that
11511 * you have deserialized ChannelMonitors separately and will add them to your
11512 * chain::Watch after deserializing this ChannelManager.
11514 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11517 * The chain::Watch for use in the ChannelManager in the future.
11519 * No calls to the chain::Watch will be made during deserialization. It is assumed that
11520 * you have deserialized ChannelMonitors separately and will add them to your
11521 * chain::Watch after deserializing this ChannelManager.
11523 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
11526 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
11527 * used to broadcast the latest local commitment transactions of channels which must be
11528 * force-closed during deserialization.
11530 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11533 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
11534 * used to broadcast the latest local commitment transactions of channels which must be
11535 * force-closed during deserialization.
11537 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
11540 * The Logger for use in the ChannelManager and which may be used to log information during
11543 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11546 * The Logger for use in the ChannelManager and which may be used to log information during
11549 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
11552 * Default settings used for new channels. Any existing channels will continue to use the
11553 * runtime settings which were stored when the ChannelManager was serialized.
11555 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11558 * Default settings used for new channels. Any existing channels will continue to use the
11559 * runtime settings which were stored when the ChannelManager was serialized.
11561 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
11564 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
11565 * HashMap for you. This is primarily useful for C bindings where it is not practical to
11566 * populate a HashMap directly from C.
11568 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);
11571 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
11573 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
11576 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
11578 void DecodeError_free(struct LDKDecodeError this_obj);
11581 * Creates a copy of the DecodeError
11583 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
11586 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
11588 void Init_free(struct LDKInit this_obj);
11591 * The relevant features which the sender supports
11593 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
11596 * The relevant features which the sender supports
11598 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
11601 * Constructs a new Init given each field
11603 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
11606 * Creates a copy of the Init
11608 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
11611 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
11613 void ErrorMessage_free(struct LDKErrorMessage this_obj);
11616 * The channel ID involved in the error
11618 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
11621 * The channel ID involved in the error
11623 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11626 * A possibly human-readable error description.
11627 * The string should be sanitized before it is used (e.g. emitted to logs
11628 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
11629 * vulnerability in the terminal emulator or the logging subsystem.
11631 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
11634 * A possibly human-readable error description.
11635 * The string should be sanitized before it is used (e.g. emitted to logs
11636 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
11637 * vulnerability in the terminal emulator or the logging subsystem.
11639 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
11642 * Constructs a new ErrorMessage given each field
11644 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg);
11647 * Creates a copy of the ErrorMessage
11649 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
11652 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
11654 void Ping_free(struct LDKPing this_obj);
11657 * The desired response length
11659 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
11662 * The desired response length
11664 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
11667 * The ping packet size.
11668 * This field is not sent on the wire. byteslen zeros are sent.
11670 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
11673 * The ping packet size.
11674 * This field is not sent on the wire. byteslen zeros are sent.
11676 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
11679 * Constructs a new Ping given each field
11681 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
11684 * Creates a copy of the Ping
11686 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
11689 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
11691 void Pong_free(struct LDKPong this_obj);
11694 * The pong packet size.
11695 * This field is not sent on the wire. byteslen zeros are sent.
11697 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
11700 * The pong packet size.
11701 * This field is not sent on the wire. byteslen zeros are sent.
11703 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
11706 * Constructs a new Pong given each field
11708 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
11711 * Creates a copy of the Pong
11713 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
11716 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
11718 void OpenChannel_free(struct LDKOpenChannel this_obj);
11721 * The genesis hash of the blockchain where the channel is to be opened
11723 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
11726 * The genesis hash of the blockchain where the channel is to be opened
11728 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11731 * A temporary channel ID, until the funding outpoint is announced
11733 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
11736 * A temporary channel ID, until the funding outpoint is announced
11738 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11741 * The channel value
11743 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11746 * The channel value
11748 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11751 * The amount to push to the counterparty as part of the open, in milli-satoshi
11753 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11756 * The amount to push to the counterparty as part of the open, in milli-satoshi
11758 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11761 * The threshold below which outputs on transactions broadcast by sender will be omitted
11763 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11766 * The threshold below which outputs on transactions broadcast by sender will be omitted
11768 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11771 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
11773 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11776 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
11778 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11781 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
11783 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11786 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
11788 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11791 * The minimum HTLC size incoming to sender, in milli-satoshi
11793 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11796 * The minimum HTLC size incoming to sender, in milli-satoshi
11798 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11801 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
11803 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11806 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
11808 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
11811 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
11813 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11816 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
11818 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
11821 * The maximum number of inbound HTLCs towards sender
11823 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11826 * The maximum number of inbound HTLCs towards sender
11828 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
11831 * The sender's key controlling the funding transaction
11833 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11836 * The sender's key controlling the funding transaction
11838 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11841 * Used to derive a revocation key for transactions broadcast by counterparty
11843 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11846 * Used to derive a revocation key for transactions broadcast by counterparty
11848 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11851 * A payment key to sender for transactions broadcast by counterparty
11853 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11856 * A payment key to sender for transactions broadcast by counterparty
11858 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11861 * Used to derive a payment key to sender for transactions broadcast by sender
11863 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11866 * Used to derive a payment key to sender for transactions broadcast by sender
11868 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11871 * Used to derive an HTLC payment key to sender
11873 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11876 * Used to derive an HTLC payment key to sender
11878 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11881 * The first to-be-broadcast-by-sender transaction's per commitment point
11883 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11886 * The first to-be-broadcast-by-sender transaction's per commitment point
11888 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11893 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11898 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
11901 * Creates a copy of the OpenChannel
11903 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
11906 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
11908 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
11911 * A temporary channel ID, until the funding outpoint is announced
11913 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
11916 * A temporary channel ID, until the funding outpoint is announced
11918 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11921 * The threshold below which outputs on transactions broadcast by sender will be omitted
11923 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
11926 * The threshold below which outputs on transactions broadcast by sender will be omitted
11928 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
11931 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
11933 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
11936 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
11938 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
11941 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
11943 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
11946 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
11948 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
11951 * The minimum HTLC size incoming to sender, in milli-satoshi
11953 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
11956 * The minimum HTLC size incoming to sender, in milli-satoshi
11958 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
11961 * Minimum depth of the funding transaction before the channel is considered open
11963 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
11966 * Minimum depth of the funding transaction before the channel is considered open
11968 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
11971 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
11973 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
11976 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
11978 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
11981 * The maximum number of inbound HTLCs towards sender
11983 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
11986 * The maximum number of inbound HTLCs towards sender
11988 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
11991 * The sender's key controlling the funding transaction
11993 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
11996 * The sender's key controlling the funding transaction
11998 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12001 * Used to derive a revocation key for transactions broadcast by counterparty
12003 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12006 * Used to derive a revocation key for transactions broadcast by counterparty
12008 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12011 * A payment key to sender for transactions broadcast by counterparty
12013 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12016 * A payment key to sender for transactions broadcast by counterparty
12018 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12021 * Used to derive a payment key to sender for transactions broadcast by sender
12023 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12026 * Used to derive a payment key to sender for transactions broadcast by sender
12028 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12031 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
12033 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12036 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
12038 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12041 * The first to-be-broadcast-by-sender transaction's per commitment point
12043 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
12046 * The first to-be-broadcast-by-sender transaction's per commitment point
12048 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12051 * Creates a copy of the AcceptChannel
12053 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
12056 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
12058 void FundingCreated_free(struct LDKFundingCreated this_obj);
12061 * A temporary channel ID, until the funding is established
12063 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
12066 * A temporary channel ID, until the funding is established
12068 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12071 * The funding transaction ID
12073 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
12076 * The funding transaction ID
12078 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12081 * The specific output index funding this channel
12083 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
12086 * The specific output index funding this channel
12088 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
12091 * The signature of the channel initiator (funder) on the funding transaction
12093 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
12096 * The signature of the channel initiator (funder) on the funding transaction
12098 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
12101 * Constructs a new FundingCreated given each field
12103 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);
12106 * Creates a copy of the FundingCreated
12108 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
12111 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
12113 void FundingSigned_free(struct LDKFundingSigned this_obj);
12118 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
12123 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12126 * The signature of the channel acceptor (fundee) on the funding transaction
12128 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
12131 * The signature of the channel acceptor (fundee) on the funding transaction
12133 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
12136 * Constructs a new FundingSigned given each field
12138 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
12141 * Creates a copy of the FundingSigned
12143 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
12146 * Frees any resources used by the FundingLocked, if is_owned is set and inner is non-NULL.
12148 void FundingLocked_free(struct LDKFundingLocked this_obj);
12153 const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32];
12158 void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12161 * The per-commitment point of the second commitment transaction
12163 struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr);
12166 * The per-commitment point of the second commitment transaction
12168 void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12171 * Constructs a new FundingLocked given each field
12173 MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
12176 * Creates a copy of the FundingLocked
12178 struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
12181 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
12183 void Shutdown_free(struct LDKShutdown this_obj);
12188 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
12193 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12196 * The destination of this peer's funds on closing.
12197 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
12199 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
12202 * The destination of this peer's funds on closing.
12203 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
12205 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
12208 * Constructs a new Shutdown given each field
12210 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
12213 * Creates a copy of the Shutdown
12215 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
12218 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
12220 void ClosingSigned_free(struct LDKClosingSigned this_obj);
12225 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
12230 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12233 * The proposed total fee for the closing transaction
12235 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
12238 * The proposed total fee for the closing transaction
12240 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
12243 * A signature on the closing transaction
12245 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
12248 * A signature on the closing transaction
12250 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
12253 * Constructs a new ClosingSigned given each field
12255 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg);
12258 * Creates a copy of the ClosingSigned
12260 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
12263 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
12265 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
12270 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
12275 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12280 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
12285 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
12288 * The HTLC value in milli-satoshi
12290 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
12293 * The HTLC value in milli-satoshi
12295 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
12298 * The payment hash, the pre-image of which controls HTLC redemption
12300 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
12303 * The payment hash, the pre-image of which controls HTLC redemption
12305 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12308 * The expiry height of the HTLC
12310 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
12313 * The expiry height of the HTLC
12315 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
12318 * Creates a copy of the UpdateAddHTLC
12320 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
12323 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
12325 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
12330 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
12335 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12340 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
12345 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
12348 * The pre-image of the payment hash, allowing HTLC redemption
12350 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
12353 * The pre-image of the payment hash, allowing HTLC redemption
12355 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12358 * Constructs a new UpdateFulfillHTLC given each field
12360 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
12363 * Creates a copy of the UpdateFulfillHTLC
12365 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
12368 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
12370 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
12375 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
12380 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12385 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
12390 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
12393 * Creates a copy of the UpdateFailHTLC
12395 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
12398 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
12400 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
12405 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
12410 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12415 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
12420 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
12425 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
12430 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
12433 * Creates a copy of the UpdateFailMalformedHTLC
12435 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
12438 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
12440 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
12445 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
12450 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12453 * A signature on the commitment transaction
12455 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
12458 * A signature on the commitment transaction
12460 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
12463 * Signatures on the HTLC transactions
12465 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
12468 * Constructs a new CommitmentSigned given each field
12470 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
12473 * Creates a copy of the CommitmentSigned
12475 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
12478 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
12480 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
12485 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
12490 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12493 * The secret corresponding to the per-commitment point
12495 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
12498 * The secret corresponding to the per-commitment point
12500 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12503 * The next sender-broadcast commitment transaction's per-commitment point
12505 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
12508 * The next sender-broadcast commitment transaction's per-commitment point
12510 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12513 * Constructs a new RevokeAndACK given each field
12515 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);
12518 * Creates a copy of the RevokeAndACK
12520 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
12523 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
12525 void UpdateFee_free(struct LDKUpdateFee this_obj);
12530 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
12535 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12538 * Fee rate per 1000-weight of the transaction
12540 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
12543 * Fee rate per 1000-weight of the transaction
12545 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
12548 * Constructs a new UpdateFee given each field
12550 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
12553 * Creates a copy of the UpdateFee
12555 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
12558 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
12560 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
12563 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
12564 * belonging to the recipient
12566 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
12569 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
12570 * belonging to the recipient
12572 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12575 * The sender's per-commitment point for their current commitment transaction
12577 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
12580 * The sender's per-commitment point for their current commitment transaction
12582 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12585 * Constructs a new DataLossProtect given each field
12587 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
12590 * Creates a copy of the DataLossProtect
12592 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
12595 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
12597 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
12602 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
12607 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12610 * The next commitment number for the sender
12612 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
12615 * The next commitment number for the sender
12617 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
12620 * The next commitment number for the recipient
12622 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
12625 * The next commitment number for the recipient
12627 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
12630 * Creates a copy of the ChannelReestablish
12632 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
12635 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
12637 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
12642 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
12647 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12650 * The short channel ID
12652 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
12655 * The short channel ID
12657 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
12660 * A signature by the node key
12662 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
12665 * A signature by the node key
12667 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
12670 * A signature by the funding key
12672 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
12675 * A signature by the funding key
12677 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
12680 * Constructs a new AnnouncementSignatures given each field
12682 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);
12685 * Creates a copy of the AnnouncementSignatures
12687 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
12690 * Frees any resources used by the NetAddress
12692 void NetAddress_free(struct LDKNetAddress this_ptr);
12695 * Creates a copy of the NetAddress
12697 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
12700 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
12702 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
12705 * Read a Result from a byte array, created by Result_write
12707 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
12710 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
12712 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
12715 * The advertised features
12717 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
12720 * The advertised features
12722 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
12725 * A strictly monotonic announcement counter, with gaps allowed
12727 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
12730 * A strictly monotonic announcement counter, with gaps allowed
12732 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
12735 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
12738 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
12741 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
12744 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12747 * An RGB color for UI purposes
12749 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
12752 * An RGB color for UI purposes
12754 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
12757 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
12760 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
12763 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
12766 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12769 * List of addresses on which this node is reachable
12771 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
12774 * Creates a copy of the UnsignedNodeAnnouncement
12776 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
12779 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
12781 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
12784 * The signature by the node key
12786 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
12789 * The signature by the node key
12791 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
12794 * The actual content of the announcement
12796 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
12799 * The actual content of the announcement
12801 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
12804 * Constructs a new NodeAnnouncement given each field
12806 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
12809 * Creates a copy of the NodeAnnouncement
12811 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
12814 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
12816 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
12819 * The advertised channel features
12821 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
12824 * The advertised channel features
12826 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
12829 * The genesis hash of the blockchain where the channel is to be opened
12831 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
12834 * The genesis hash of the blockchain where the channel is to be opened
12836 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12839 * The short channel ID
12841 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
12844 * The short channel ID
12846 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
12849 * One of the two node_ids which are endpoints of this channel
12851 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
12854 * One of the two node_ids which are endpoints of this channel
12856 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12859 * The other of the two node_ids which are endpoints of this channel
12861 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
12864 * The other of the two node_ids which are endpoints of this channel
12866 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12869 * The funding key for the first node
12871 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
12874 * The funding key for the first node
12876 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12879 * The funding key for the second node
12881 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
12884 * The funding key for the second node
12886 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12889 * Creates a copy of the UnsignedChannelAnnouncement
12891 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
12894 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
12896 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
12899 * Authentication of the announcement by the first public node
12901 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
12904 * Authentication of the announcement by the first public node
12906 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
12909 * Authentication of the announcement by the second public node
12911 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
12914 * Authentication of the announcement by the second public node
12916 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
12919 * Proof of funding UTXO ownership by the first public node
12921 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
12924 * Proof of funding UTXO ownership by the first public node
12926 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
12929 * Proof of funding UTXO ownership by the second public node
12931 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
12934 * Proof of funding UTXO ownership by the second public node
12936 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
12939 * The actual announcement
12941 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
12944 * The actual announcement
12946 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
12949 * Constructs a new ChannelAnnouncement given each field
12951 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);
12954 * Creates a copy of the ChannelAnnouncement
12956 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
12959 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
12961 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
12964 * The genesis hash of the blockchain where the channel is to be opened
12966 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
12969 * The genesis hash of the blockchain where the channel is to be opened
12971 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12974 * The short channel ID
12976 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
12979 * The short channel ID
12981 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
12984 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
12986 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
12989 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
12991 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
12996 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13001 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
13004 * The number of blocks such that if:
13005 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
13006 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
13007 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
13008 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
13009 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
13010 * forwarding. Note that the HTLC sender is the one who originally sets this value when
13011 * constructing the route.
13013 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13016 * The number of blocks such that if:
13017 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
13018 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
13019 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
13020 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
13021 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
13022 * forwarding. Note that the HTLC sender is the one who originally sets this value when
13023 * constructing the route.
13025 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
13028 * The minimum HTLC size incoming to sender, in milli-satoshi
13030 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13033 * The minimum HTLC size incoming to sender, in milli-satoshi
13035 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
13038 * The base HTLC fee charged by sender, in milli-satoshi
13040 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13043 * The base HTLC fee charged by sender, in milli-satoshi
13045 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
13048 * The amount to fee multiplier, in micro-satoshi
13050 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
13053 * The amount to fee multiplier, in micro-satoshi
13055 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
13058 * Creates a copy of the UnsignedChannelUpdate
13060 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
13063 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
13065 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
13068 * A signature of the channel update
13070 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
13073 * A signature of the channel update
13075 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
13078 * The actual channel update
13080 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
13083 * The actual channel update
13085 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
13088 * Constructs a new ChannelUpdate given each field
13090 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
13093 * Creates a copy of the ChannelUpdate
13095 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
13098 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
13100 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
13103 * The genesis hash of the blockchain being queried
13105 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
13108 * The genesis hash of the blockchain being queried
13110 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13113 * The height of the first block for the channel UTXOs being queried
13115 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
13118 * The height of the first block for the channel UTXOs being queried
13120 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
13123 * The number of blocks to include in the query results
13125 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
13128 * The number of blocks to include in the query results
13130 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
13133 * Constructs a new QueryChannelRange given each field
13135 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
13138 * Creates a copy of the QueryChannelRange
13140 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
13143 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
13145 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
13148 * The genesis hash of the blockchain being queried
13150 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
13153 * The genesis hash of the blockchain being queried
13155 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13158 * The height of the first block in the range of the reply
13160 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
13163 * The height of the first block in the range of the reply
13165 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
13168 * The number of blocks included in the range of the reply
13170 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
13173 * The number of blocks included in the range of the reply
13175 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
13178 * True when this is the final reply for a query
13180 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
13183 * True when this is the final reply for a query
13185 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
13188 * The short_channel_ids in the channel range
13190 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
13193 * Constructs a new ReplyChannelRange given each field
13195 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);
13198 * Creates a copy of the ReplyChannelRange
13200 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
13203 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
13205 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
13208 * The genesis hash of the blockchain being queried
13210 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
13213 * The genesis hash of the blockchain being queried
13215 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13218 * The short_channel_ids that are being queried
13220 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
13223 * Constructs a new QueryShortChannelIds given each field
13225 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
13228 * Creates a copy of the QueryShortChannelIds
13230 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
13233 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
13235 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
13238 * The genesis hash of the blockchain that was queried
13240 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
13243 * The genesis hash of the blockchain that was queried
13245 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13248 * Indicates if the query recipient maintains up-to-date channel
13249 * information for the chain_hash
13251 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
13254 * Indicates if the query recipient maintains up-to-date channel
13255 * information for the chain_hash
13257 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
13260 * Constructs a new ReplyShortChannelIdsEnd given each field
13262 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
13265 * Creates a copy of the ReplyShortChannelIdsEnd
13267 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
13270 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
13272 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
13275 * The genesis hash of the blockchain for channel and node information
13277 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
13280 * The genesis hash of the blockchain for channel and node information
13282 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13285 * The starting unix timestamp
13287 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
13290 * The starting unix timestamp
13292 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
13295 * The range of information in seconds
13297 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
13300 * The range of information in seconds
13302 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
13305 * Constructs a new GossipTimestampFilter given each field
13307 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
13310 * Creates a copy of the GossipTimestampFilter
13312 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
13315 * Frees any resources used by the ErrorAction
13317 void ErrorAction_free(struct LDKErrorAction this_ptr);
13320 * Creates a copy of the ErrorAction
13322 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
13325 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
13327 void LightningError_free(struct LDKLightningError this_obj);
13330 * A human-readable message describing the error
13332 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
13335 * A human-readable message describing the error
13337 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
13340 * The action which should be taken against the offending peer.
13342 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
13345 * The action which should be taken against the offending peer.
13347 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
13350 * Constructs a new LightningError given each field
13352 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKCVec_u8Z err_arg, struct LDKErrorAction action_arg);
13355 * Creates a copy of the LightningError
13357 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
13360 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
13362 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
13365 * update_add_htlc messages which should be sent
13367 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
13370 * update_fulfill_htlc messages which should be sent
13372 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
13375 * update_fail_htlc messages which should be sent
13377 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
13380 * update_fail_malformed_htlc messages which should be sent
13382 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
13385 * An update_fee message which should be sent
13387 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
13390 * An update_fee message which should be sent
13392 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
13395 * Finally, the commitment_signed message which should be sent
13397 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
13400 * Finally, the commitment_signed message which should be sent
13402 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
13405 * Constructs a new CommitmentUpdate given each field
13407 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);
13410 * Creates a copy of the CommitmentUpdate
13412 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
13415 * Frees any resources used by the HTLCFailChannelUpdate
13417 void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr);
13420 * Creates a copy of the HTLCFailChannelUpdate
13422 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig);
13425 * Calls the free function if one is set
13427 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
13430 * Calls the free function if one is set
13432 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
13435 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
13437 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
13440 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
13442 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
13445 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
13447 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
13450 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
13452 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
13455 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
13457 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
13460 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
13462 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
13465 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
13467 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
13470 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
13472 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
13475 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
13477 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
13480 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
13482 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
13485 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
13487 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
13490 * Read a FundingCreated from a byte array, created by FundingCreated_write
13492 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
13495 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
13497 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
13500 * Read a FundingSigned from a byte array, created by FundingSigned_write
13502 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
13505 * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
13507 struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
13510 * Read a FundingLocked from a byte array, created by FundingLocked_write
13512 struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
13515 * Serialize the Init object into a byte array which can be read by Init_read
13517 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
13520 * Read a Init from a byte array, created by Init_write
13522 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
13525 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
13527 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
13530 * Read a OpenChannel from a byte array, created by OpenChannel_write
13532 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
13535 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
13537 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
13540 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
13542 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
13545 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
13547 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
13550 * Read a Shutdown from a byte array, created by Shutdown_write
13552 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
13555 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
13557 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
13560 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
13562 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
13565 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
13567 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
13570 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
13572 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
13575 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
13577 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
13580 * Read a UpdateFee from a byte array, created by UpdateFee_write
13582 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
13585 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
13587 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
13590 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
13592 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
13595 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
13597 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
13600 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
13602 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
13605 * Serialize the Ping object into a byte array which can be read by Ping_read
13607 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
13610 * Read a Ping from a byte array, created by Ping_write
13612 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
13615 * Serialize the Pong object into a byte array which can be read by Pong_read
13617 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
13620 * Read a Pong from a byte array, created by Pong_write
13622 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
13625 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
13627 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
13630 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
13632 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
13635 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
13637 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
13640 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
13642 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
13645 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
13647 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
13650 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
13652 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
13655 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
13657 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
13660 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
13662 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
13665 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
13667 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
13670 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
13672 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
13675 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
13677 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
13680 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
13682 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
13685 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
13687 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
13690 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
13692 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
13695 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
13697 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
13700 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
13702 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
13705 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
13707 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
13710 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
13712 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
13715 *\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
13717 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
13720 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
13722 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
13725 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
13727 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
13730 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
13732 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
13735 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
13737 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
13740 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
13742 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
13745 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
13747 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
13750 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
13752 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
13755 * Constructs a new IgnoringMessageHandler given each field
13757 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
13760 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
13761 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
13763 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
13766 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
13767 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
13769 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
13772 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
13774 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
13777 * Constructs a new ErroringMessageHandler
13779 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
13782 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
13783 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
13785 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
13788 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
13789 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
13791 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
13794 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
13796 void MessageHandler_free(struct LDKMessageHandler this_obj);
13799 * A message handler which handles messages specific to channels. Usually this is just a
13800 * ChannelManager object or a ErroringMessageHandler.
13802 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
13805 * A message handler which handles messages specific to channels. Usually this is just a
13806 * ChannelManager object or a ErroringMessageHandler.
13808 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
13811 * A message handler which handles messages updating our knowledge of the network channel
13812 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
13814 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
13817 * A message handler which handles messages updating our knowledge of the network channel
13818 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
13820 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
13823 * Constructs a new MessageHandler given each field
13825 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
13828 * Creates a copy of a SocketDescriptor
13830 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
13833 * Calls the free function if one is set
13835 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
13838 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
13840 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
13843 * Used to indicate that we probably can't make any future connections to this peer, implying
13844 * we should go ahead and force-close any channels we have with it.
13846 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
13849 * Used to indicate that we probably can't make any future connections to this peer, implying
13850 * we should go ahead and force-close any channels we have with it.
13852 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
13855 * Constructs a new PeerHandleError given each field
13857 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
13860 * Creates a copy of the PeerHandleError
13862 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
13865 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
13867 void PeerManager_free(struct LDKPeerManager this_obj);
13870 * Constructs a new PeerManager with the given message handlers and node_id secret key
13871 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
13872 * cryptographically secure random bytes.
13874 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);
13877 * Get the list of node ids for peers which have completed the initial handshake.
13879 * For outbound connections, this will be the same as the their_node_id parameter passed in to
13880 * new_outbound_connection, however entries will only appear once the initial handshake has
13881 * completed and we are sure the remote peer has the private key for the given node_id.
13883 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
13886 * Indicates a new outbound connection has been established to a node with the given node_id.
13887 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
13888 * descriptor but must disconnect the connection immediately.
13890 * Returns a small number of bytes to send to the remote node (currently always 50).
13892 * Panics if descriptor is duplicative with some other descriptor which has not yet had a
13893 * socket_disconnected().
13895 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);
13898 * Indicates a new inbound connection has been established.
13900 * May refuse the connection by returning an Err, but will never write bytes to the remote end
13901 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
13902 * call socket_disconnected for the new descriptor but must disconnect the connection
13905 * Panics if descriptor is duplicative with some other descriptor which has not yet had
13906 * socket_disconnected called.
13908 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor);
13911 * Indicates that there is room to write data to the given socket descriptor.
13913 * May return an Err to indicate that the connection should be closed.
13915 * Will most likely call send_data on the descriptor passed in (or the descriptor handed into
13916 * new_*\\_connection) before returning. Thus, be very careful with reentrancy issues! The
13917 * invariants around calling write_buffer_space_avail in case a write did not fully complete
13918 * must still hold - be ready to call write_buffer_space_avail again if a write call generated
13919 * here isn't sufficient! Panics if the descriptor was not previously registered in a
13920 * new_\\*_connection event.
13922 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
13925 * Indicates that data was read from the given socket descriptor.
13927 * May return an Err to indicate that the connection should be closed.
13929 * Will *not* call back into send_data on any descriptors to avoid reentrancy complexity.
13930 * Thus, however, you almost certainly want to call process_events() after any read_event to
13931 * generate send_data calls to handle responses.
13933 * If Ok(true) is returned, further read_events should not be triggered until a send_data call
13934 * on this file descriptor has resume_read set (preventing DoS issues in the send buffer).
13936 * Panics if the descriptor was not previously registered in a new_*_connection event.
13938 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);
13941 * Checks for any events generated by our handlers and processes them. Includes sending most
13942 * response messages as well as messages generated by calls to handler functions directly (eg
13943 * functions like ChannelManager::process_pending_htlc_forward or send_payment).
13945 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
13948 * Indicates that the given socket descriptor's connection is now closed.
13950 * This must only be called if the socket has been disconnected by the peer or your own
13951 * decision to disconnect it and must NOT be called in any case where other parts of this
13952 * library (eg PeerHandleError, explicit disconnect_socket calls) instruct you to disconnect
13955 * Panics if the descriptor was not previously registered in a successful new_*_connection event.
13957 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
13960 * Disconnect a peer given its node id.
13962 * Set no_connection_possible to true to prevent any further connection with this peer,
13963 * force-closing any channels we have with it.
13965 * If a peer is connected, this will call `disconnect_socket` on the descriptor for the peer,
13966 * so be careful about reentrancy issues.
13968 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
13971 * This function should be called roughly once every 30 seconds.
13972 * It will send pings to each peer and disconnect those which did not respond to the last round of pings.
13973 * Will most likely call send_data on all of the registered descriptors, thus, be very careful with reentrancy issues!
13975 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
13978 * Build the commitment secret from the seed and the commitment number
13980 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
13983 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
13984 * from the base secret and the per_commitment_point.
13986 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
13987 * generated (ie our own).
13989 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
13992 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
13993 * from the base point and the per_commitment_key. This is the public equivalent of
13994 * derive_private_key - using only public keys to derive a public key instead of private keys.
13996 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
13997 * generated (ie our own).
13999 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
14002 * Derives a per-commitment-transaction revocation key from its constituent parts.
14004 * Only the cheating participant owns a valid witness to propagate a revoked
14005 * commitment transaction, thus per_commitment_secret always come from cheater
14006 * and revocation_base_secret always come from punisher, which is the broadcaster
14007 * of the transaction spending with this key knowledge.
14009 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
14010 * generated (ie our own).
14012 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
14015 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
14016 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
14017 * public key instead of private keys.
14019 * Only the cheating participant owns a valid witness to propagate a revoked
14020 * commitment transaction, thus per_commitment_point always come from cheater
14021 * and revocation_base_point always come from punisher, which is the broadcaster
14022 * of the transaction spending with this key knowledge.
14024 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
14025 * generated (ie our own).
14027 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
14030 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
14032 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
14035 * The broadcaster's per-commitment public key which was used to derive the other keys.
14037 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
14040 * The broadcaster's per-commitment public key which was used to derive the other keys.
14042 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14045 * The revocation key which is used to allow the broadcaster of the commitment
14046 * transaction to provide their counterparty the ability to punish them if they broadcast
14049 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
14052 * The revocation key which is used to allow the broadcaster of the commitment
14053 * transaction to provide their counterparty the ability to punish them if they broadcast
14056 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14059 * Broadcaster's HTLC Key
14061 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
14064 * Broadcaster's HTLC Key
14066 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14069 * Countersignatory's HTLC Key
14071 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
14074 * Countersignatory's HTLC Key
14076 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14079 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
14081 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
14084 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
14086 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14089 * Constructs a new TxCreationKeys given each field
14091 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);
14094 * Creates a copy of the TxCreationKeys
14096 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
14099 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
14101 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
14104 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
14106 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
14109 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
14111 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
14114 * The public key which is used to sign all commitment transactions, as it appears in the
14115 * on-chain channel lock-in 2-of-2 multisig output.
14117 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
14120 * The public key which is used to sign all commitment transactions, as it appears in the
14121 * on-chain channel lock-in 2-of-2 multisig output.
14123 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14126 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
14127 * revocation keys. This is combined with the per-commitment-secret generated by the
14128 * counterparty to create a secret which the counterparty can reveal to revoke previous
14131 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
14134 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
14135 * revocation keys. This is combined with the per-commitment-secret generated by the
14136 * counterparty to create a secret which the counterparty can reveal to revoke previous
14139 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14142 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
14143 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
14144 * static across every commitment transaction.
14146 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
14149 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
14150 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
14151 * static across every commitment transaction.
14153 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14156 * The base point which is used (with derive_public_key) to derive a per-commitment payment
14157 * public key which receives non-HTLC-encumbered funds which are only available for spending
14158 * after some delay (or can be claimed via the revocation path).
14160 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
14163 * The base point which is used (with derive_public_key) to derive a per-commitment payment
14164 * public key which receives non-HTLC-encumbered funds which are only available for spending
14165 * after some delay (or can be claimed via the revocation path).
14167 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14170 * The base point which is used (with derive_public_key) to derive a per-commitment public key
14171 * which is used to encumber HTLC-in-flight outputs.
14173 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
14176 * The base point which is used (with derive_public_key) to derive a per-commitment public key
14177 * which is used to encumber HTLC-in-flight outputs.
14179 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14182 * Constructs a new ChannelPublicKeys given each field
14184 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);
14187 * Creates a copy of the ChannelPublicKeys
14189 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
14192 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
14194 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
14197 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
14199 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
14202 * Create per-state keys from channel base points and the per-commitment point.
14203 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
14205 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);
14208 * Generate per-state keys from channel static keys.
14209 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
14211 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);
14214 * A script either spendable by the revocation
14215 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
14216 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
14218 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
14221 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
14223 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
14226 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
14227 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
14228 * need to compare this value to whether the commitment transaction in question is that of
14229 * the counterparty or our own.
14231 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
14234 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
14235 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
14236 * need to compare this value to whether the commitment transaction in question is that of
14237 * the counterparty or our own.
14239 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
14242 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
14243 * this divided by 1000.
14245 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
14248 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
14249 * this divided by 1000.
14251 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
14254 * The CLTV lock-time at which this HTLC expires.
14256 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
14259 * The CLTV lock-time at which this HTLC expires.
14261 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
14264 * The hash of the preimage which unlocks this HTLC.
14266 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
14269 * The hash of the preimage which unlocks this HTLC.
14271 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14274 * The position within the commitment transactions' outputs. This may be None if the value is
14275 * below the dust limit (in which case no output appears in the commitment transaction and the
14276 * value is spent to additional transaction fees).
14278 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
14281 * The position within the commitment transactions' outputs. This may be None if the value is
14282 * below the dust limit (in which case no output appears in the commitment transaction and the
14283 * value is spent to additional transaction fees).
14285 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
14288 * Constructs a new HTLCOutputInCommitment given each field
14290 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);
14293 * Creates a copy of the HTLCOutputInCommitment
14295 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
14298 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
14300 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
14303 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
14305 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
14308 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
14309 * does not need to have its previous_output_index filled.
14311 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys);
14314 * Gets the redeemscript for a funding output from the two funding public keys.
14315 * Note that the order of funding public keys does not matter.
14317 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
14320 * panics if htlc.transaction_output_index.is_none()!
14322 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);
14325 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
14327 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
14330 * Holder public keys
14332 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14335 * Holder public keys
14337 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
14340 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
14342 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14345 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
14347 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
14350 * Whether the holder is the initiator of this channel.
14351 * This is an input to the commitment number obscure factor computation.
14353 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14356 * Whether the holder is the initiator of this channel.
14357 * This is an input to the commitment number obscure factor computation.
14359 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
14362 * The late-bound counterparty channel transaction parameters.
14363 * These parameters are populated at the point in the protocol where the counterparty provides them.
14365 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14368 * The late-bound counterparty channel transaction parameters.
14369 * These parameters are populated at the point in the protocol where the counterparty provides them.
14371 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
14374 * The late-bound funding outpoint
14376 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14379 * The late-bound funding outpoint
14381 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
14384 * Constructs a new ChannelTransactionParameters given each field
14386 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);
14389 * Creates a copy of the ChannelTransactionParameters
14391 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
14394 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
14396 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
14399 * Counter-party public keys
14401 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
14404 * Counter-party public keys
14406 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
14409 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
14411 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
14414 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
14416 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
14419 * Constructs a new CounterpartyChannelTransactionParameters given each field
14421 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
14424 * Creates a copy of the CounterpartyChannelTransactionParameters
14426 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
14429 * Whether the late bound parameters are populated.
14431 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
14434 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
14435 * given that the holder is the broadcaster.
14437 * self.is_populated() must be true before calling this function.
14439 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
14442 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
14443 * given that the counterparty is the broadcaster.
14445 * self.is_populated() must be true before calling this function.
14447 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
14450 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
14452 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
14455 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
14457 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
14460 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
14462 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
14465 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
14467 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
14470 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
14472 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
14475 * Get the channel pubkeys for the broadcaster
14477 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14480 * Get the channel pubkeys for the countersignatory
14482 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14485 * Get the contest delay applicable to the transactions.
14486 * Note that the contest delay was selected by the countersignatory.
14488 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14491 * Whether the channel is outbound from the broadcaster.
14493 * The boolean representing the side that initiated the channel is
14494 * an input to the commitment number obscure factor computation.
14496 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14499 * The funding outpoint
14501 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14504 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
14506 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
14509 * Our counterparty's signature for the transaction
14511 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
14514 * Our counterparty's signature for the transaction
14516 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
14519 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
14521 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
14524 * Creates a copy of the HolderCommitmentTransaction
14526 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
14529 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
14531 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
14534 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
14536 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
14539 * Create a new holder transaction with the given counterparty signatures.
14540 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
14542 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);
14545 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
14547 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
14550 * The commitment transaction
14552 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
14555 * The commitment transaction
14557 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
14560 * The txid for the commitment transaction.
14562 * This is provided as a performance optimization, instead of calling transaction.txid()
14565 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
14568 * The txid for the commitment transaction.
14570 * This is provided as a performance optimization, instead of calling transaction.txid()
14573 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14576 * Constructs a new BuiltCommitmentTransaction given each field
14578 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
14581 * Creates a copy of the BuiltCommitmentTransaction
14583 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
14586 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
14588 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
14591 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
14593 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
14596 * Get the SIGHASH_ALL sighash value of the transaction.
14598 * This can be used to verify a signature.
14600 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);
14603 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
14604 * because we are about to broadcast a holder transaction.
14606 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);
14609 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
14611 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
14614 * Creates a copy of the CommitmentTransaction
14616 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
14619 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
14621 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
14624 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
14626 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
14629 * The backwards-counting commitment number
14631 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14634 * The value to be sent to the broadcaster
14636 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14639 * The value to be sent to the counterparty
14641 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14644 * The feerate paid per 1000-weight-unit in this commitment transaction.
14646 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14649 * Trust our pre-built transaction and derived transaction creation public keys.
14651 * Applies a wrapper which allows access to these fields.
14653 * This should only be used if you fully trust the builder of this object. It should not
14654 *\tbe used by an external signer - instead use the verify function.
14656 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14659 * Verify our pre-built transaction and derived transaction creation public keys.
14661 * Applies a wrapper which allows access to these fields.
14663 * An external validating signer must call this method before signing
14664 * or using the built transaction.
14666 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);
14669 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
14671 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
14674 * The transaction ID of the built Bitcoin transaction
14676 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
14679 * The pre-built Bitcoin commitment transaction
14681 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
14684 * The pre-calculated transaction creation public keys.
14686 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
14689 * Get a signature for each HTLC which was included in the commitment transaction (ie for
14690 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
14692 * The returned Vec has one entry for each HTLC, and in the same order.
14694 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);
14697 * Get the transaction number obscure factor
14699 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
14702 * Creates a copy of the InitFeatures
14704 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
14707 * Creates a copy of the NodeFeatures
14709 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
14712 * Creates a copy of the ChannelFeatures
14714 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
14717 * Creates a copy of the InvoiceFeatures
14719 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
14722 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
14724 void InitFeatures_free(struct LDKInitFeatures this_obj);
14727 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
14729 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
14732 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
14734 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
14737 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
14739 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
14742 * Create a blank Features with no features set
14744 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
14747 * Creates a Features with the bits set which are known by the implementation
14749 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
14752 * Create a blank Features with no features set
14754 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
14757 * Creates a Features with the bits set which are known by the implementation
14759 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
14762 * Create a blank Features with no features set
14764 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
14767 * Creates a Features with the bits set which are known by the implementation
14769 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
14772 * Create a blank Features with no features set
14774 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
14777 * Creates a Features with the bits set which are known by the implementation
14779 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
14782 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
14784 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
14787 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
14789 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
14792 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
14794 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
14797 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
14799 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
14802 * Read a InitFeatures from a byte array, created by InitFeatures_write
14804 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
14807 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
14809 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
14812 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
14814 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
14817 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
14819 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
14822 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
14824 void RouteHop_free(struct LDKRouteHop this_obj);
14827 * The node_id of the node at this hop.
14829 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
14832 * The node_id of the node at this hop.
14834 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14837 * The node_announcement features of the node at this hop. For the last hop, these may be
14838 * amended to match the features present in the invoice this node generated.
14840 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
14843 * The node_announcement features of the node at this hop. For the last hop, these may be
14844 * amended to match the features present in the invoice this node generated.
14846 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
14849 * The channel that should be used from the previous hop to reach this node.
14851 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
14854 * The channel that should be used from the previous hop to reach this node.
14856 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
14859 * The channel_announcement features of the channel that should be used from the previous hop
14860 * to reach this node.
14862 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
14865 * The channel_announcement features of the channel that should be used from the previous hop
14866 * to reach this node.
14868 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
14871 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
14872 * For the last hop, this should be the full value of the payment (might be more than
14873 * requested if we had to match htlc_minimum_msat).
14875 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
14878 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
14879 * For the last hop, this should be the full value of the payment (might be more than
14880 * requested if we had to match htlc_minimum_msat).
14882 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
14885 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
14886 * expected at the destination, in excess of the current block height.
14888 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
14891 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
14892 * expected at the destination, in excess of the current block height.
14894 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
14897 * Constructs a new RouteHop given each field
14899 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);
14902 * Creates a copy of the RouteHop
14904 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
14907 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
14909 void Route_free(struct LDKRoute this_obj);
14912 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
14913 * last RouteHop in each path must be the same.
14914 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
14915 * destination. Thus, this must always be at least length one. While the maximum length of any
14916 * given path is variable, keeping the length of any path to less than 20 should currently
14917 * ensure it is viable.
14919 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
14922 * Constructs a new Route given each field
14924 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
14927 * Creates a copy of the Route
14929 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
14932 * Serialize the Route object into a byte array which can be read by Route_read
14934 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
14937 * Read a Route from a byte array, created by Route_write
14939 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
14942 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
14944 void RouteHint_free(struct LDKRouteHint this_obj);
14947 * The node_id of the non-target end of the route
14949 struct LDKPublicKey RouteHint_get_src_node_id(const struct LDKRouteHint *NONNULL_PTR this_ptr);
14952 * The node_id of the non-target end of the route
14954 void RouteHint_set_src_node_id(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14957 * The short_channel_id of this channel
14959 uint64_t RouteHint_get_short_channel_id(const struct LDKRouteHint *NONNULL_PTR this_ptr);
14962 * The short_channel_id of this channel
14964 void RouteHint_set_short_channel_id(struct LDKRouteHint *NONNULL_PTR this_ptr, uint64_t val);
14967 * The fees which must be paid to use this channel
14969 struct LDKRoutingFees RouteHint_get_fees(const struct LDKRouteHint *NONNULL_PTR this_ptr);
14972 * The fees which must be paid to use this channel
14974 void RouteHint_set_fees(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
14977 * The difference in CLTV values between this node and the next node.
14979 uint16_t RouteHint_get_cltv_expiry_delta(const struct LDKRouteHint *NONNULL_PTR this_ptr);
14982 * The difference in CLTV values between this node and the next node.
14984 void RouteHint_set_cltv_expiry_delta(struct LDKRouteHint *NONNULL_PTR this_ptr, uint16_t val);
14987 * The minimum value, in msat, which must be relayed to the next hop.
14989 struct LDKCOption_u64Z RouteHint_get_htlc_minimum_msat(const struct LDKRouteHint *NONNULL_PTR this_ptr);
14992 * The minimum value, in msat, which must be relayed to the next hop.
14994 void RouteHint_set_htlc_minimum_msat(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
14997 * The maximum value in msat available for routing with a single HTLC.
14999 struct LDKCOption_u64Z RouteHint_get_htlc_maximum_msat(const struct LDKRouteHint *NONNULL_PTR this_ptr);
15002 * The maximum value in msat available for routing with a single HTLC.
15004 void RouteHint_set_htlc_maximum_msat(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
15007 * Constructs a new RouteHint given each field
15009 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);
15012 * Creates a copy of the RouteHint
15014 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
15017 * Gets a route from us (payer) to the given target node (payee).
15019 * If the payee provided features in their invoice, they should be provided via payee_features.
15020 * Without this, MPP will only be used if the payee's features are available in the network graph.
15022 * Extra routing hops between known nodes and the target will be used if they are included in
15025 * If some channels aren't announced, it may be useful to fill in a first_hops with the
15026 * results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
15027 * view of our local channels (from net_graph_msg_handler) will be ignored, and only those
15028 * in first_hops will be used.
15030 * Panics if first_hops contains channels without short_channel_ids
15031 * (ChannelManager::list_usable_channels will never include such channels).
15033 * The fees on channels from us to next-hops are ignored (as they are assumed to all be
15034 * equal), however the enabled/disabled bit on such channels as well as the
15035 * htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
15037 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);
15040 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
15042 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
15045 * Creates a copy of the NetworkGraph
15047 struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
15050 * Frees any resources used by the LockedNetworkGraph, if is_owned is set and inner is non-NULL.
15052 void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj);
15055 * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
15057 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
15060 * Creates a new tracker of the actual state of the network of channels and nodes,
15061 * assuming a fresh network graph.
15062 * Chain monitor is used to make sure announced channels exist on-chain,
15063 * channel data is correct, and that the announcement is signed with
15064 * channel owners' keys.
15066 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger);
15069 * Creates a new tracker of the actual state of the network of channels and nodes,
15070 * assuming an existing Network Graph.
15072 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph);
15075 * Adds a provider used to check new announcements. Does not affect
15076 * existing announcements unless they are updated.
15077 * Add, update or remove the provider would replace the current one.
15079 void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKAccess *chain_access);
15082 * Take a read lock on the network_graph and return it in the C-bindings
15083 * newtype helper. This is likely only useful when called via the C
15084 * bindings as you can call `self.network_graph.read().unwrap()` in Rust
15087 MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
15090 * Get a reference to the NetworkGraph which this read-lock contains.
15092 MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg);
15095 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
15096 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
15098 struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
15101 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
15102 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
15104 struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
15107 * Frees any resources used by the DirectionalChannelInfo, if is_owned is set and inner is non-NULL.
15109 void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_obj);
15112 * When the last update to the channel direction was issued.
15113 * Value is opaque, as set in the announcement.
15115 uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15118 * When the last update to the channel direction was issued.
15119 * Value is opaque, as set in the announcement.
15121 void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val);
15124 * Whether the channel can be currently used for payments (in this one direction).
15126 bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15129 * Whether the channel can be currently used for payments (in this one direction).
15131 void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, bool val);
15134 * The difference in CLTV values that you must have when routing through this channel.
15136 uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15139 * The difference in CLTV values that you must have when routing through this channel.
15141 void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint16_t val);
15144 * The minimum value, which must be relayed to the next hop via the channel
15146 uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15149 * The minimum value, which must be relayed to the next hop via the channel
15151 void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val);
15154 * The maximum value which may be relayed to the next hop via the channel.
15156 struct LDKCOption_u64Z DirectionalChannelInfo_get_htlc_maximum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15159 * The maximum value which may be relayed to the next hop via the channel.
15161 void DirectionalChannelInfo_set_htlc_maximum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
15164 * Fees charged when the channel is used for routing
15166 struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15169 * Fees charged when the channel is used for routing
15171 void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
15174 * Most recent update for the channel received from the network
15175 * Mostly redundant with the data we store in fields explicitly.
15176 * Everything else is useful only for sending out for initial routing sync.
15177 * Not stored if contains excess data to prevent DoS.
15179 struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
15182 * Most recent update for the channel received from the network
15183 * Mostly redundant with the data we store in fields explicitly.
15184 * Everything else is useful only for sending out for initial routing sync.
15185 * Not stored if contains excess data to prevent DoS.
15187 void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
15190 * Constructs a new DirectionalChannelInfo given each field
15192 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);
15195 * Creates a copy of the DirectionalChannelInfo
15197 struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig);
15200 * Serialize the DirectionalChannelInfo object into a byte array which can be read by DirectionalChannelInfo_read
15202 struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj);
15205 * Read a DirectionalChannelInfo from a byte array, created by DirectionalChannelInfo_write
15207 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser);
15210 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
15212 void ChannelInfo_free(struct LDKChannelInfo this_obj);
15215 * Protocol features of a channel communicated during its announcement
15217 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15220 * Protocol features of a channel communicated during its announcement
15222 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
15225 * Source node of the first direction of a channel
15227 struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15230 * Source node of the first direction of a channel
15232 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15235 * Details about the first direction of a channel
15237 struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15240 * Details about the first direction of a channel
15242 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
15245 * Source node of the second direction of a channel
15247 struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15250 * Source node of the second direction of a channel
15252 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15255 * Details about the second direction of a channel
15257 struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15260 * Details about the second direction of a channel
15262 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
15265 * The channel capacity as seen on-chain, if chain lookup is available.
15267 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15270 * The channel capacity as seen on-chain, if chain lookup is available.
15272 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
15275 * An initial announcement of the channel
15276 * Mostly redundant with the data we store in fields explicitly.
15277 * Everything else is useful only for sending out for initial routing sync.
15278 * Not stored if contains excess data to prevent DoS.
15280 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15283 * An initial announcement of the channel
15284 * Mostly redundant with the data we store in fields explicitly.
15285 * Everything else is useful only for sending out for initial routing sync.
15286 * Not stored if contains excess data to prevent DoS.
15288 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
15291 * Constructs a new ChannelInfo given each field
15293 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);
15296 * Creates a copy of the ChannelInfo
15298 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
15301 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
15303 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
15306 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
15308 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
15311 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
15313 void RoutingFees_free(struct LDKRoutingFees this_obj);
15316 * Flat routing fee in satoshis
15318 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
15321 * Flat routing fee in satoshis
15323 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
15326 * Liquidity-based routing fee in millionths of a routed amount.
15327 * In other words, 10000 is 1%.
15329 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
15332 * Liquidity-based routing fee in millionths of a routed amount.
15333 * In other words, 10000 is 1%.
15335 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
15338 * Constructs a new RoutingFees given each field
15340 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
15343 * Creates a copy of the RoutingFees
15345 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
15348 * Read a RoutingFees from a byte array, created by RoutingFees_write
15350 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
15353 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
15355 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
15358 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
15360 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
15363 * Protocol features the node announced support for
15365 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
15368 * Protocol features the node announced support for
15370 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
15373 * When the last known update to the node state was issued.
15374 * Value is opaque, as set in the announcement.
15376 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
15379 * When the last known update to the node state was issued.
15380 * Value is opaque, as set in the announcement.
15382 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
15385 * Color assigned to the node
15387 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
15390 * Color assigned to the node
15392 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
15395 * Moniker assigned to the node.
15396 * May be invalid or malicious (eg control chars),
15397 * should not be exposed to the user.
15399 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
15402 * Moniker assigned to the node.
15403 * May be invalid or malicious (eg control chars),
15404 * should not be exposed to the user.
15406 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15409 * Internet-level addresses via which one can connect to the node
15411 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
15414 * An initial announcement of the node
15415 * Mostly redundant with the data we store in fields explicitly.
15416 * Everything else is useful only for sending out for initial routing sync.
15417 * Not stored if contains excess data to prevent DoS.
15419 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
15422 * An initial announcement of the node
15423 * Mostly redundant with the data we store in fields explicitly.
15424 * Everything else is useful only for sending out for initial routing sync.
15425 * Not stored if contains excess data to prevent DoS.
15427 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
15430 * Constructs a new NodeAnnouncementInfo given each field
15432 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);
15435 * Creates a copy of the NodeAnnouncementInfo
15437 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
15440 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
15442 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
15445 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
15447 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
15450 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
15452 void NodeInfo_free(struct LDKNodeInfo this_obj);
15455 * All valid channels a node has announced
15457 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
15460 * Lowest fees enabling routing via any of the enabled, known channels to a node.
15461 * The two fields (flat and proportional fee) are independent,
15462 * meaning they don't have to refer to the same channel.
15464 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
15467 * Lowest fees enabling routing via any of the enabled, known channels to a node.
15468 * The two fields (flat and proportional fee) are independent,
15469 * meaning they don't have to refer to the same channel.
15471 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
15474 * More information about a node from node_announcement.
15475 * Optional because we store a Node entry after learning about it from
15476 * a channel announcement, but before receiving a node announcement.
15478 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
15481 * More information about a node from node_announcement.
15482 * Optional because we store a Node entry after learning about it from
15483 * a channel announcement, but before receiving a node announcement.
15485 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
15488 * Constructs a new NodeInfo given each field
15490 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
15493 * Creates a copy of the NodeInfo
15495 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
15498 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
15500 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
15503 * Read a NodeInfo from a byte array, created by NodeInfo_write
15505 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
15508 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
15510 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
15513 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
15515 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
15518 * Creates a new, empty, network graph.
15520 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
15523 * For an already known node (from channel announcements), update its stored properties from a
15524 * given node announcement.
15526 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
15527 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
15528 * routing messages from a source using a protocol other than the lightning P2P protocol.
15530 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
15533 * For an already known node (from channel announcements), update its stored properties from a
15534 * given node announcement without verifying the associated signatures. Because we aren't
15535 * given the associated signatures here we cannot relay the node announcement to any of our
15538 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
15541 * Store or update channel info from a channel announcement.
15543 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
15544 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
15545 * routing messages from a source using a protocol other than the lightning P2P protocol.
15547 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
15548 * the corresponding UTXO exists on chain and is correctly-formatted.
15550 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);
15553 * Store or update channel info from a channel announcement without verifying the associated
15554 * signatures. Because we aren't given the associated signatures here we cannot relay the
15555 * channel announcement to any of our peers.
15557 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
15558 * the corresponding UTXO exists on chain and is correctly-formatted.
15560 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);
15563 * Close a channel if a corresponding HTLC fail was sent.
15564 * If permanent, removes a channel from the local storage.
15565 * May cause the removal of nodes too, if this was their last channel.
15566 * If not permanent, makes channels unavailable for routing.
15568 void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
15571 * For an already known (from announcement) channel, update info about one of the directions
15574 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
15575 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
15576 * routing messages from a source using a protocol other than the lightning P2P protocol.
15578 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
15581 * For an already known (from announcement) channel, update info about one of the directions
15582 * of the channel without verifying the associated signatures. Because we aren't given the
15583 * associated signatures here we cannot relay the channel update to any of our peers.
15585 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
15587 /* Text to put at the end of the generated file */