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
293 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
295 typedef struct LDKSecretKey {
297 * The bytes of the secret key
303 * The contents of CResult_SecretKeyErrorZ
305 typedef union LDKCResult_SecretKeyErrorZPtr {
307 * A pointer to the contents in the success state.
308 * Reading from this pointer when `result_ok` is not set is undefined.
310 struct LDKSecretKey *result;
312 * A pointer to the contents in the error state.
313 * Reading from this pointer when `result_ok` is set is undefined.
315 enum LDKSecp256k1Error *err;
316 } LDKCResult_SecretKeyErrorZPtr;
319 * A CResult_SecretKeyErrorZ represents the result of a fallible operation,
320 * containing a crate::c_types::SecretKey on success and a crate::c_types::Secp256k1Error on failure.
321 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
323 typedef struct LDKCResult_SecretKeyErrorZ {
325 * The contents of this CResult_SecretKeyErrorZ, accessible via either
326 * `err` or `result` depending on the state of `result_ok`.
328 union LDKCResult_SecretKeyErrorZPtr contents;
330 * Whether this CResult_SecretKeyErrorZ represents a success state.
333 } LDKCResult_SecretKeyErrorZ;
336 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
338 typedef struct LDKPublicKey {
340 * The bytes of the public key
342 uint8_t compressed_form[33];
346 * The contents of CResult_PublicKeyErrorZ
348 typedef union LDKCResult_PublicKeyErrorZPtr {
350 * A pointer to the contents in the success state.
351 * Reading from this pointer when `result_ok` is not set is undefined.
353 struct LDKPublicKey *result;
355 * A pointer to the contents in the error state.
356 * Reading from this pointer when `result_ok` is set is undefined.
358 enum LDKSecp256k1Error *err;
359 } LDKCResult_PublicKeyErrorZPtr;
362 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
363 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
364 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
366 typedef struct LDKCResult_PublicKeyErrorZ {
368 * The contents of this CResult_PublicKeyErrorZ, accessible via either
369 * `err` or `result` depending on the state of `result_ok`.
371 union LDKCResult_PublicKeyErrorZPtr contents;
373 * Whether this CResult_PublicKeyErrorZ represents a success state.
376 } LDKCResult_PublicKeyErrorZ;
381 * The set of public keys which are used in the creation of one commitment transaction.
382 * These are derived from the channel base keys and per-commitment data.
384 * A broadcaster key is provided from potential broadcaster of the computed transaction.
385 * A countersignatory key is coming from a protocol participant unable to broadcast the
388 * These keys are assumed to be good, either because the code derived them from
389 * channel basepoints via the new function, or they were obtained via
390 * CommitmentTransaction.trust().keys() because we trusted the source of the
391 * pre-calculated keys.
393 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
395 * A pointer to the opaque Rust object.
396 * Nearly everywhere, inner must be non-null, however in places where
397 * the Rust equivalent takes an Option, it may be set to null to indicate None.
399 LDKnativeTxCreationKeys *inner;
401 * Indicates that this is the only struct which contains the same pointer.
402 * Rust functions which take ownership of an object provided via an argument require
403 * this to be true and invalidate the object pointed to by inner.
411 * An error in decoding a message or struct.
413 typedef struct MUST_USE_STRUCT LDKDecodeError {
415 * A pointer to the opaque Rust object.
416 * Nearly everywhere, inner must be non-null, however in places where
417 * the Rust equivalent takes an Option, it may be set to null to indicate None.
419 LDKnativeDecodeError *inner;
421 * Indicates that this is the only struct which contains the same pointer.
422 * Rust functions which take ownership of an object provided via an argument require
423 * this to be true and invalidate the object pointed to by inner.
429 * The contents of CResult_TxCreationKeysDecodeErrorZ
431 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
433 * A pointer to the contents in the success state.
434 * Reading from this pointer when `result_ok` is not set is undefined.
436 struct LDKTxCreationKeys *result;
438 * A pointer to the contents in the error state.
439 * Reading from this pointer when `result_ok` is set is undefined.
441 struct LDKDecodeError *err;
442 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
445 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
446 * containing a crate::ln::chan_utils::TxCreationKeys on success and a crate::ln::msgs::DecodeError on failure.
447 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
449 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
451 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
452 * `err` or `result` depending on the state of `result_ok`.
454 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
456 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
459 } LDKCResult_TxCreationKeysDecodeErrorZ;
464 * One counterparty's public keys which do not change over the life of a channel.
466 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
468 * A pointer to the opaque Rust object.
469 * Nearly everywhere, inner must be non-null, however in places where
470 * the Rust equivalent takes an Option, it may be set to null to indicate None.
472 LDKnativeChannelPublicKeys *inner;
474 * Indicates that this is the only struct which contains the same pointer.
475 * Rust functions which take ownership of an object provided via an argument require
476 * this to be true and invalidate the object pointed to by inner.
479 } LDKChannelPublicKeys;
482 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
484 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
486 * A pointer to the contents in the success state.
487 * Reading from this pointer when `result_ok` is not set is undefined.
489 struct LDKChannelPublicKeys *result;
491 * A pointer to the contents in the error state.
492 * Reading from this pointer when `result_ok` is set is undefined.
494 struct LDKDecodeError *err;
495 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
498 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
499 * containing a crate::ln::chan_utils::ChannelPublicKeys on success and a crate::ln::msgs::DecodeError on failure.
500 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
502 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
504 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
505 * `err` or `result` depending on the state of `result_ok`.
507 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
509 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
512 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
515 * The contents of CResult_TxCreationKeysErrorZ
517 typedef union LDKCResult_TxCreationKeysErrorZPtr {
519 * A pointer to the contents in the success state.
520 * Reading from this pointer when `result_ok` is not set is undefined.
522 struct LDKTxCreationKeys *result;
524 * A pointer to the contents in the error state.
525 * Reading from this pointer when `result_ok` is set is undefined.
527 enum LDKSecp256k1Error *err;
528 } LDKCResult_TxCreationKeysErrorZPtr;
531 * A CResult_TxCreationKeysErrorZ represents the result of a fallible operation,
532 * containing a crate::ln::chan_utils::TxCreationKeys on success and a crate::c_types::Secp256k1Error on failure.
533 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
535 typedef struct LDKCResult_TxCreationKeysErrorZ {
537 * The contents of this CResult_TxCreationKeysErrorZ, accessible via either
538 * `err` or `result` depending on the state of `result_ok`.
540 union LDKCResult_TxCreationKeysErrorZPtr contents;
542 * Whether this CResult_TxCreationKeysErrorZ represents a success state.
545 } LDKCResult_TxCreationKeysErrorZ;
548 * An enum which can either contain a u32 or not
550 typedef enum LDKCOption_u32Z_Tag {
552 * When we're in this state, this COption_u32Z contains a u32
554 LDKCOption_u32Z_Some,
556 * When we're in this state, this COption_u32Z contains nothing
558 LDKCOption_u32Z_None,
560 * Must be last for serialization purposes
562 LDKCOption_u32Z_Sentinel,
563 } LDKCOption_u32Z_Tag;
565 typedef struct LDKCOption_u32Z {
566 LDKCOption_u32Z_Tag tag;
577 * Information about an HTLC as it appears in a commitment transaction
579 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
581 * A pointer to the opaque Rust object.
582 * Nearly everywhere, inner must be non-null, however in places where
583 * the Rust equivalent takes an Option, it may be set to null to indicate None.
585 LDKnativeHTLCOutputInCommitment *inner;
587 * Indicates that this is the only struct which contains the same pointer.
588 * Rust functions which take ownership of an object provided via an argument require
589 * this to be true and invalidate the object pointed to by inner.
592 } LDKHTLCOutputInCommitment;
595 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
597 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
599 * A pointer to the contents in the success state.
600 * Reading from this pointer when `result_ok` is not set is undefined.
602 struct LDKHTLCOutputInCommitment *result;
604 * A pointer to the contents in the error state.
605 * Reading from this pointer when `result_ok` is set is undefined.
607 struct LDKDecodeError *err;
608 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
611 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
612 * containing a crate::ln::chan_utils::HTLCOutputInCommitment on success and a crate::ln::msgs::DecodeError on failure.
613 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
615 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
617 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
618 * `err` or `result` depending on the state of `result_ok`.
620 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
622 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
625 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
630 * Late-bound per-channel counterparty data used to build transactions.
632 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
634 * A pointer to the opaque Rust object.
635 * Nearly everywhere, inner must be non-null, however in places where
636 * the Rust equivalent takes an Option, it may be set to null to indicate None.
638 LDKnativeCounterpartyChannelTransactionParameters *inner;
640 * Indicates that this is the only struct which contains the same pointer.
641 * Rust functions which take ownership of an object provided via an argument require
642 * this to be true and invalidate the object pointed to by inner.
645 } LDKCounterpartyChannelTransactionParameters;
648 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
650 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
652 * A pointer to the contents in the success state.
653 * Reading from this pointer when `result_ok` is not set is undefined.
655 struct LDKCounterpartyChannelTransactionParameters *result;
657 * A pointer to the contents in the error state.
658 * Reading from this pointer when `result_ok` is set is undefined.
660 struct LDKDecodeError *err;
661 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
664 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
665 * containing a crate::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::ln::msgs::DecodeError on failure.
666 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
668 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
670 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
671 * `err` or `result` depending on the state of `result_ok`.
673 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
675 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
678 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
683 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
684 * The fields are organized by holder/counterparty.
686 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
687 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
689 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
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 LDKnativeChannelTransactionParameters *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 } LDKChannelTransactionParameters;
705 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
707 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
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 LDKChannelTransactionParameters *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_ChannelTransactionParametersDecodeErrorZPtr;
721 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
722 * containing a crate::ln::chan_utils::ChannelTransactionParameters on success and a crate::ln::msgs::DecodeError on failure.
723 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
725 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
727 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
728 * `err` or `result` depending on the state of `result_ok`.
730 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
732 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
735 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
738 * Represents a secp256k1 signature serialized as two 32-byte numbers
740 typedef struct LDKSignature {
742 * The bytes of the signature in "compact" form
744 uint8_t compact_form[64];
748 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
749 * This corresponds to std::vector in C++
751 typedef struct LDKCVec_SignatureZ {
753 * The elements in the array.
754 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
756 struct LDKSignature *data;
758 * The number of elements pointed to by `data`.
761 } LDKCVec_SignatureZ;
766 * Information needed to build and sign a holder's commitment transaction.
768 * The transaction is only signed once we are ready to broadcast.
770 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
772 * A pointer to the opaque Rust object.
773 * Nearly everywhere, inner must be non-null, however in places where
774 * the Rust equivalent takes an Option, it may be set to null to indicate None.
776 LDKnativeHolderCommitmentTransaction *inner;
778 * Indicates that this is the only struct which contains the same pointer.
779 * Rust functions which take ownership of an object provided via an argument require
780 * this to be true and invalidate the object pointed to by inner.
783 } LDKHolderCommitmentTransaction;
786 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
788 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
790 * A pointer to the contents in the success state.
791 * Reading from this pointer when `result_ok` is not set is undefined.
793 struct LDKHolderCommitmentTransaction *result;
795 * A pointer to the contents in the error state.
796 * Reading from this pointer when `result_ok` is set is undefined.
798 struct LDKDecodeError *err;
799 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
802 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
803 * containing a crate::ln::chan_utils::HolderCommitmentTransaction on success and a crate::ln::msgs::DecodeError on failure.
804 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
806 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
808 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
809 * `err` or `result` depending on the state of `result_ok`.
811 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
813 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
816 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
821 * A pre-built Bitcoin commitment transaction and its txid.
823 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
825 * A pointer to the opaque Rust object.
826 * Nearly everywhere, inner must be non-null, however in places where
827 * the Rust equivalent takes an Option, it may be set to null to indicate None.
829 LDKnativeBuiltCommitmentTransaction *inner;
831 * Indicates that this is the only struct which contains the same pointer.
832 * Rust functions which take ownership of an object provided via an argument require
833 * this to be true and invalidate the object pointed to by inner.
836 } LDKBuiltCommitmentTransaction;
839 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
841 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
843 * A pointer to the contents in the success state.
844 * Reading from this pointer when `result_ok` is not set is undefined.
846 struct LDKBuiltCommitmentTransaction *result;
848 * A pointer to the contents in the error state.
849 * Reading from this pointer when `result_ok` is set is undefined.
851 struct LDKDecodeError *err;
852 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
855 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
856 * containing a crate::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::ln::msgs::DecodeError on failure.
857 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
859 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
861 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
862 * `err` or `result` depending on the state of `result_ok`.
864 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
866 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
869 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
874 * This class tracks the per-transaction information needed to build a commitment transaction and to
875 * actually build it and sign. It is used for holder transactions that we sign only when needed
876 * and for transactions we sign for the counterparty.
878 * This class can be used inside a signer implementation to generate a signature given the relevant
881 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
883 * A pointer to the opaque Rust object.
884 * Nearly everywhere, inner must be non-null, however in places where
885 * the Rust equivalent takes an Option, it may be set to null to indicate None.
887 LDKnativeCommitmentTransaction *inner;
889 * Indicates that this is the only struct which contains the same pointer.
890 * Rust functions which take ownership of an object provided via an argument require
891 * this to be true and invalidate the object pointed to by inner.
894 } LDKCommitmentTransaction;
897 * The contents of CResult_CommitmentTransactionDecodeErrorZ
899 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
901 * A pointer to the contents in the success state.
902 * Reading from this pointer when `result_ok` is not set is undefined.
904 struct LDKCommitmentTransaction *result;
906 * A pointer to the contents in the error state.
907 * Reading from this pointer when `result_ok` is set is undefined.
909 struct LDKDecodeError *err;
910 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
913 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
914 * containing a crate::ln::chan_utils::CommitmentTransaction on success and a crate::ln::msgs::DecodeError on failure.
915 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
917 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
919 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
920 * `err` or `result` depending on the state of `result_ok`.
922 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
924 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
927 } LDKCResult_CommitmentTransactionDecodeErrorZ;
932 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
933 * transaction and the transaction creation keys) are trusted.
935 * See trust() and verify() functions on CommitmentTransaction.
937 * This structure implements Deref.
939 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
941 * A pointer to the opaque Rust object.
942 * Nearly everywhere, inner must be non-null, however in places where
943 * the Rust equivalent takes an Option, it may be set to null to indicate None.
945 LDKnativeTrustedCommitmentTransaction *inner;
947 * Indicates that this is the only struct which contains the same pointer.
948 * Rust functions which take ownership of an object provided via an argument require
949 * this to be true and invalidate the object pointed to by inner.
952 } LDKTrustedCommitmentTransaction;
955 * The contents of CResult_TrustedCommitmentTransactionNoneZ
957 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
959 * A pointer to the contents in the success state.
960 * Reading from this pointer when `result_ok` is not set is undefined.
962 struct LDKTrustedCommitmentTransaction *result;
964 * Note that this value is always NULL, as there are no contents in the Err variant
967 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
970 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
971 * containing a crate::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
972 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
974 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
976 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
977 * `err` or `result` depending on the state of `result_ok`.
979 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
981 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
984 } LDKCResult_TrustedCommitmentTransactionNoneZ;
987 * The contents of CResult_CVec_SignatureZNoneZ
989 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
991 * A pointer to the contents in the success state.
992 * Reading from this pointer when `result_ok` is not set is undefined.
994 struct LDKCVec_SignatureZ *result;
996 * Note that this value is always NULL, as there are no contents in the Err variant
999 } LDKCResult_CVec_SignatureZNoneZPtr;
1002 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
1003 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
1004 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1006 typedef struct LDKCResult_CVec_SignatureZNoneZ {
1008 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
1009 * `err` or `result` depending on the state of `result_ok`.
1011 union LDKCResult_CVec_SignatureZNoneZPtr contents;
1013 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
1016 } LDKCResult_CVec_SignatureZNoneZ;
1021 * An accept_channel message to be sent or received from a peer
1023 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
1025 * A pointer to the opaque Rust object.
1026 * Nearly everywhere, inner must be non-null, however in places where
1027 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1029 LDKnativeAcceptChannel *inner;
1031 * Indicates that this is the only struct which contains the same pointer.
1032 * Rust functions which take ownership of an object provided via an argument require
1033 * this to be true and invalidate the object pointed to by inner.
1041 * An open_channel message to be sent or received from a peer
1043 typedef struct MUST_USE_STRUCT LDKOpenChannel {
1045 * A pointer to the opaque Rust object.
1046 * Nearly everywhere, inner must be non-null, however in places where
1047 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1049 LDKnativeOpenChannel *inner;
1051 * Indicates that this is the only struct which contains the same pointer.
1052 * Rust functions which take ownership of an object provided via an argument require
1053 * this to be true and invalidate the object pointed to by inner.
1061 * A funding_created message to be sent or received from a peer
1063 typedef struct MUST_USE_STRUCT LDKFundingCreated {
1065 * A pointer to the opaque Rust object.
1066 * Nearly everywhere, inner must be non-null, however in places where
1067 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1069 LDKnativeFundingCreated *inner;
1071 * Indicates that this is the only struct which contains the same pointer.
1072 * Rust functions which take ownership of an object provided via an argument require
1073 * this to be true and invalidate the object pointed to by inner.
1076 } LDKFundingCreated;
1081 * A funding_signed message to be sent or received from a peer
1083 typedef struct MUST_USE_STRUCT LDKFundingSigned {
1085 * A pointer to the opaque Rust object.
1086 * Nearly everywhere, inner must be non-null, however in places where
1087 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1089 LDKnativeFundingSigned *inner;
1091 * Indicates that this is the only struct which contains the same pointer.
1092 * Rust functions which take ownership of an object provided via an argument require
1093 * this to be true and invalidate the object pointed to by inner.
1101 * A funding_locked message to be sent or received from a peer
1103 typedef struct MUST_USE_STRUCT LDKFundingLocked {
1105 * A pointer to the opaque Rust object.
1106 * Nearly everywhere, inner must be non-null, however in places where
1107 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1109 LDKnativeFundingLocked *inner;
1111 * Indicates that this is the only struct which contains the same pointer.
1112 * Rust functions which take ownership of an object provided via an argument require
1113 * this to be true and invalidate the object pointed to by inner.
1121 * An announcement_signatures message to be sent or received from a peer
1123 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
1125 * A pointer to the opaque Rust object.
1126 * Nearly everywhere, inner must be non-null, however in places where
1127 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1129 LDKnativeAnnouncementSignatures *inner;
1131 * Indicates that this is the only struct which contains the same pointer.
1132 * Rust functions which take ownership of an object provided via an argument require
1133 * this to be true and invalidate the object pointed to by inner.
1136 } LDKAnnouncementSignatures;
1141 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
1142 * transaction updates if they were pending.
1144 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
1146 * A pointer to the opaque Rust object.
1147 * Nearly everywhere, inner must be non-null, however in places where
1148 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1150 LDKnativeCommitmentUpdate *inner;
1152 * Indicates that this is the only struct which contains the same pointer.
1153 * Rust functions which take ownership of an object provided via an argument require
1154 * this to be true and invalidate the object pointed to by inner.
1157 } LDKCommitmentUpdate;
1162 * A revoke_and_ack message to be sent or received from a peer
1164 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
1166 * A pointer to the opaque Rust object.
1167 * Nearly everywhere, inner must be non-null, however in places where
1168 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1170 LDKnativeRevokeAndACK *inner;
1172 * Indicates that this is the only struct which contains the same pointer.
1173 * Rust functions which take ownership of an object provided via an argument require
1174 * this to be true and invalidate the object pointed to by inner.
1182 * A closing_signed message to be sent or received from a peer
1184 typedef struct MUST_USE_STRUCT LDKClosingSigned {
1186 * A pointer to the opaque Rust object.
1187 * Nearly everywhere, inner must be non-null, however in places where
1188 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1190 LDKnativeClosingSigned *inner;
1192 * Indicates that this is the only struct which contains the same pointer.
1193 * Rust functions which take ownership of an object provided via an argument require
1194 * this to be true and invalidate the object pointed to by inner.
1202 * A shutdown message to be sent or received from a peer
1204 typedef struct MUST_USE_STRUCT LDKShutdown {
1206 * A pointer to the opaque Rust object.
1207 * Nearly everywhere, inner must be non-null, however in places where
1208 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1210 LDKnativeShutdown *inner;
1212 * Indicates that this is the only struct which contains the same pointer.
1213 * Rust functions which take ownership of an object provided via an argument require
1214 * this to be true and invalidate the object pointed to by inner.
1222 * A channel_reestablish message to be sent or received from a peer
1224 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
1226 * A pointer to the opaque Rust object.
1227 * Nearly everywhere, inner must be non-null, however in places where
1228 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1230 LDKnativeChannelReestablish *inner;
1232 * Indicates that this is the only struct which contains the same pointer.
1233 * Rust functions which take ownership of an object provided via an argument require
1234 * this to be true and invalidate the object pointed to by inner.
1237 } LDKChannelReestablish;
1242 * A channel_announcement message to be sent or received from a peer
1244 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
1246 * A pointer to the opaque Rust object.
1247 * Nearly everywhere, inner must be non-null, however in places where
1248 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1250 LDKnativeChannelAnnouncement *inner;
1252 * Indicates that this is the only struct which contains the same pointer.
1253 * Rust functions which take ownership of an object provided via an argument require
1254 * this to be true and invalidate the object pointed to by inner.
1257 } LDKChannelAnnouncement;
1262 * A channel_update message to be sent or received from a peer
1264 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
1266 * A pointer to the opaque Rust object.
1267 * Nearly everywhere, inner must be non-null, however in places where
1268 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1270 LDKnativeChannelUpdate *inner;
1272 * Indicates that this is the only struct which contains the same pointer.
1273 * Rust functions which take ownership of an object provided via an argument require
1274 * this to be true and invalidate the object pointed to by inner.
1282 * A node_announcement message to be sent or received from a peer
1284 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
1286 * A pointer to the opaque Rust object.
1287 * Nearly everywhere, inner must be non-null, however in places where
1288 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1290 LDKnativeNodeAnnouncement *inner;
1292 * Indicates that this is the only struct which contains the same pointer.
1293 * Rust functions which take ownership of an object provided via an argument require
1294 * this to be true and invalidate the object pointed to by inner.
1297 } LDKNodeAnnouncement;
1302 * An error message to be sent or received from a peer
1304 typedef struct MUST_USE_STRUCT LDKErrorMessage {
1306 * A pointer to the opaque Rust object.
1307 * Nearly everywhere, inner must be non-null, however in places where
1308 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1310 LDKnativeErrorMessage *inner;
1312 * Indicates that this is the only struct which contains the same pointer.
1313 * Rust functions which take ownership of an object provided via an argument require
1314 * this to be true and invalidate the object pointed to by inner.
1320 * Used to put an error message in a LightningError
1322 typedef enum LDKErrorAction_Tag {
1324 * The peer took some action which made us think they were useless. Disconnect them.
1326 LDKErrorAction_DisconnectPeer,
1328 * The peer did something harmless that we weren't able to process, just log and ignore
1330 LDKErrorAction_IgnoreError,
1332 * The peer did something incorrect. Tell them.
1334 LDKErrorAction_SendErrorMessage,
1336 * Must be last for serialization purposes
1338 LDKErrorAction_Sentinel,
1339 } LDKErrorAction_Tag;
1341 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
1343 * An error message which we should make an effort to send before we disconnect.
1345 struct LDKErrorMessage msg;
1346 } LDKErrorAction_LDKDisconnectPeer_Body;
1348 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
1350 * The message to send.
1352 struct LDKErrorMessage msg;
1353 } LDKErrorAction_LDKSendErrorMessage_Body;
1355 typedef struct MUST_USE_STRUCT LDKErrorAction {
1356 LDKErrorAction_Tag tag;
1358 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
1359 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
1364 * The information we received from a peer along the route of a payment we originated. This is
1365 * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
1366 * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
1368 typedef enum LDKHTLCFailChannelUpdate_Tag {
1370 * We received an error which included a full ChannelUpdate message.
1372 LDKHTLCFailChannelUpdate_ChannelUpdateMessage,
1374 * We received an error which indicated only that a channel has been closed
1376 LDKHTLCFailChannelUpdate_ChannelClosed,
1378 * We received an error which indicated only that a node has failed
1380 LDKHTLCFailChannelUpdate_NodeFailure,
1382 * Must be last for serialization purposes
1384 LDKHTLCFailChannelUpdate_Sentinel,
1385 } LDKHTLCFailChannelUpdate_Tag;
1387 typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body {
1389 * The unwrapped message we received
1391 struct LDKChannelUpdate msg;
1392 } LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
1394 typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
1396 * The short_channel_id which has now closed.
1398 uint64_t short_channel_id;
1400 * when this true, this channel should be permanently removed from the
1401 * consideration. Otherwise, this channel can be restored as new channel_update is received
1404 } LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
1406 typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
1408 * The node_id that has failed.
1410 struct LDKPublicKey node_id;
1412 * when this true, node should be permanently removed from the
1413 * consideration. Otherwise, the channels connected to this node can be
1414 * restored as new channel_update is received
1417 } LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
1419 typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate {
1420 LDKHTLCFailChannelUpdate_Tag tag;
1422 LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message;
1423 LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed;
1424 LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure;
1426 } LDKHTLCFailChannelUpdate;
1431 * A query_channel_range message is used to query a peer for channel
1432 * UTXOs in a range of blocks. The recipient of a query makes a best
1433 * effort to reply to the query using one or more reply_channel_range
1436 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
1438 * A pointer to the opaque Rust object.
1439 * Nearly everywhere, inner must be non-null, however in places where
1440 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1442 LDKnativeQueryChannelRange *inner;
1444 * Indicates that this is the only struct which contains the same pointer.
1445 * Rust functions which take ownership of an object provided via an argument require
1446 * this to be true and invalidate the object pointed to by inner.
1449 } LDKQueryChannelRange;
1454 * A query_short_channel_ids message is used to query a peer for
1455 * routing gossip messages related to one or more short_channel_ids.
1456 * The query recipient will reply with the latest, if available,
1457 * channel_announcement, channel_update and node_announcement messages
1458 * it maintains for the requested short_channel_ids followed by a
1459 * reply_short_channel_ids_end message. The short_channel_ids sent in
1460 * this query are encoded. We only support encoding_type=0 uncompressed
1461 * serialization and do not support encoding_type=1 zlib serialization.
1463 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
1465 * A pointer to the opaque Rust object.
1466 * Nearly everywhere, inner must be non-null, however in places where
1467 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1469 LDKnativeQueryShortChannelIds *inner;
1471 * Indicates that this is the only struct which contains the same pointer.
1472 * Rust functions which take ownership of an object provided via an argument require
1473 * this to be true and invalidate the object pointed to by inner.
1476 } LDKQueryShortChannelIds;
1481 * A reply_channel_range message is a reply to a query_channel_range
1482 * message. Multiple reply_channel_range messages can be sent in reply
1483 * to a single query_channel_range message. The query recipient makes a
1484 * best effort to respond based on their local network view which may
1485 * not be a perfect view of the network. The short_channel_ids in the
1486 * reply are encoded. We only support encoding_type=0 uncompressed
1487 * serialization and do not support encoding_type=1 zlib serialization.
1489 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
1491 * A pointer to the opaque Rust object.
1492 * Nearly everywhere, inner must be non-null, however in places where
1493 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1495 LDKnativeReplyChannelRange *inner;
1497 * Indicates that this is the only struct which contains the same pointer.
1498 * Rust functions which take ownership of an object provided via an argument require
1499 * this to be true and invalidate the object pointed to by inner.
1502 } LDKReplyChannelRange;
1505 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
1506 * broadcast to most peers).
1507 * These events are handled by PeerManager::process_events if you are using a PeerManager.
1509 typedef enum LDKMessageSendEvent_Tag {
1511 * Used to indicate that we've accepted a channel open and should send the accept_channel
1512 * message provided to the given peer.
1514 LDKMessageSendEvent_SendAcceptChannel,
1516 * Used to indicate that we've initiated a channel open and should send the open_channel
1517 * message provided to the given peer.
1519 LDKMessageSendEvent_SendOpenChannel,
1521 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
1523 LDKMessageSendEvent_SendFundingCreated,
1525 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
1527 LDKMessageSendEvent_SendFundingSigned,
1529 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
1531 LDKMessageSendEvent_SendFundingLocked,
1533 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
1535 LDKMessageSendEvent_SendAnnouncementSignatures,
1537 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
1538 * message should be sent to the peer with the given node_id.
1540 LDKMessageSendEvent_UpdateHTLCs,
1542 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
1544 LDKMessageSendEvent_SendRevokeAndACK,
1546 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
1548 LDKMessageSendEvent_SendClosingSigned,
1550 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
1552 LDKMessageSendEvent_SendShutdown,
1554 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
1556 LDKMessageSendEvent_SendChannelReestablish,
1558 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
1559 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
1561 * Note that after doing so, you very likely (unless you did so very recently) want to call
1562 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
1563 * This ensures that any nodes which see our channel_announcement also have a relevant
1564 * node_announcement, including relevant feature flags which may be important for routing
1567 LDKMessageSendEvent_BroadcastChannelAnnouncement,
1569 * Used to indicate that a node_announcement should be broadcast to all peers.
1571 LDKMessageSendEvent_BroadcastNodeAnnouncement,
1573 * Used to indicate that a channel_update should be broadcast to all peers.
1575 LDKMessageSendEvent_BroadcastChannelUpdate,
1577 * Broadcast an error downstream to be handled
1579 LDKMessageSendEvent_HandleError,
1581 * When a payment fails we may receive updates back from the hop where it failed. In such
1582 * cases this event is generated so that we can inform the network graph of this information.
1584 LDKMessageSendEvent_PaymentFailureNetworkUpdate,
1586 * Query a peer for channels with funding transaction UTXOs in a block range.
1588 LDKMessageSendEvent_SendChannelRangeQuery,
1590 * Request routing gossip messages from a peer for a list of channels identified by
1591 * their short_channel_ids.
1593 LDKMessageSendEvent_SendShortIdsQuery,
1595 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
1596 * emitted during processing of the query.
1598 LDKMessageSendEvent_SendReplyChannelRange,
1600 * Must be last for serialization purposes
1602 LDKMessageSendEvent_Sentinel,
1603 } LDKMessageSendEvent_Tag;
1605 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
1607 * The node_id of the node which should receive this message
1609 struct LDKPublicKey node_id;
1611 * The message which should be sent.
1613 struct LDKAcceptChannel msg;
1614 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
1616 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
1618 * The node_id of the node which should receive this message
1620 struct LDKPublicKey node_id;
1622 * The message which should be sent.
1624 struct LDKOpenChannel msg;
1625 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
1627 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
1629 * The node_id of the node which should receive this message
1631 struct LDKPublicKey node_id;
1633 * The message which should be sent.
1635 struct LDKFundingCreated msg;
1636 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
1638 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
1640 * The node_id of the node which should receive this message
1642 struct LDKPublicKey node_id;
1644 * The message which should be sent.
1646 struct LDKFundingSigned msg;
1647 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
1649 typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
1651 * The node_id of the node which should receive these message(s)
1653 struct LDKPublicKey node_id;
1655 * The funding_locked message which should be sent.
1657 struct LDKFundingLocked msg;
1658 } LDKMessageSendEvent_LDKSendFundingLocked_Body;
1660 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
1662 * The node_id of the node which should receive these message(s)
1664 struct LDKPublicKey node_id;
1666 * The announcement_signatures message which should be sent.
1668 struct LDKAnnouncementSignatures msg;
1669 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
1671 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
1673 * The node_id of the node which should receive these message(s)
1675 struct LDKPublicKey node_id;
1677 * The update messages which should be sent. ALL messages in the struct should be sent!
1679 struct LDKCommitmentUpdate updates;
1680 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
1682 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
1684 * The node_id of the node which should receive this message
1686 struct LDKPublicKey node_id;
1688 * The message which should be sent.
1690 struct LDKRevokeAndACK msg;
1691 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
1693 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
1695 * The node_id of the node which should receive this message
1697 struct LDKPublicKey node_id;
1699 * The message which should be sent.
1701 struct LDKClosingSigned msg;
1702 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
1704 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
1706 * The node_id of the node which should receive this message
1708 struct LDKPublicKey node_id;
1710 * The message which should be sent.
1712 struct LDKShutdown msg;
1713 } LDKMessageSendEvent_LDKSendShutdown_Body;
1715 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
1717 * The node_id of the node which should receive this message
1719 struct LDKPublicKey node_id;
1721 * The message which should be sent.
1723 struct LDKChannelReestablish msg;
1724 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
1726 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
1728 * The channel_announcement which should be sent.
1730 struct LDKChannelAnnouncement msg;
1732 * The followup channel_update which should be sent.
1734 struct LDKChannelUpdate update_msg;
1735 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
1737 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
1739 * The node_announcement which should be sent.
1741 struct LDKNodeAnnouncement msg;
1742 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
1744 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
1746 * The channel_update which should be sent.
1748 struct LDKChannelUpdate msg;
1749 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
1751 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
1753 * The node_id of the node which should receive this message
1755 struct LDKPublicKey node_id;
1757 * The action which should be taken.
1759 struct LDKErrorAction action;
1760 } LDKMessageSendEvent_LDKHandleError_Body;
1762 typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
1764 * The channel/node update which should be sent to NetGraphMsgHandler
1766 struct LDKHTLCFailChannelUpdate update;
1767 } LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
1769 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
1771 * The node_id of this message recipient
1773 struct LDKPublicKey node_id;
1775 * The query_channel_range which should be sent.
1777 struct LDKQueryChannelRange msg;
1778 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
1780 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
1782 * The node_id of this message recipient
1784 struct LDKPublicKey node_id;
1786 * The query_short_channel_ids which should be sent.
1788 struct LDKQueryShortChannelIds msg;
1789 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
1791 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
1793 * The node_id of this message recipient
1795 struct LDKPublicKey node_id;
1797 * The reply_channel_range which should be sent.
1799 struct LDKReplyChannelRange msg;
1800 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
1802 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
1803 LDKMessageSendEvent_Tag tag;
1805 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
1806 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
1807 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
1808 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
1809 LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
1810 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
1811 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
1812 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
1813 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
1814 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
1815 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
1816 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
1817 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
1818 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
1819 LDKMessageSendEvent_LDKHandleError_Body handle_error;
1820 LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update;
1821 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
1822 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
1823 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
1825 } LDKMessageSendEvent;
1828 * A dynamically-allocated array of crate::util::events::MessageSendEvents of arbitrary size.
1829 * This corresponds to std::vector in C++
1831 typedef struct LDKCVec_MessageSendEventZ {
1833 * The elements in the array.
1834 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1836 struct LDKMessageSendEvent *data;
1838 * The number of elements pointed to by `data`.
1841 } LDKCVec_MessageSendEventZ;
1846 * An Err type for failure to process messages.
1848 typedef struct MUST_USE_STRUCT LDKLightningError {
1850 * A pointer to the opaque Rust object.
1851 * Nearly everywhere, inner must be non-null, however in places where
1852 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1854 LDKnativeLightningError *inner;
1856 * Indicates that this is the only struct which contains the same pointer.
1857 * Rust functions which take ownership of an object provided via an argument require
1858 * this to be true and invalidate the object pointed to by inner.
1861 } LDKLightningError;
1864 * The contents of CResult_boolLightningErrorZ
1866 typedef union LDKCResult_boolLightningErrorZPtr {
1868 * A pointer to the contents in the success state.
1869 * Reading from this pointer when `result_ok` is not set is undefined.
1873 * A pointer to the contents in the error state.
1874 * Reading from this pointer when `result_ok` is set is undefined.
1876 struct LDKLightningError *err;
1877 } LDKCResult_boolLightningErrorZPtr;
1880 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
1881 * containing a bool on success and a crate::ln::msgs::LightningError on failure.
1882 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1884 typedef struct LDKCResult_boolLightningErrorZ {
1886 * The contents of this CResult_boolLightningErrorZ, accessible via either
1887 * `err` or `result` depending on the state of `result_ok`.
1889 union LDKCResult_boolLightningErrorZPtr contents;
1891 * Whether this CResult_boolLightningErrorZ represents a success state.
1894 } LDKCResult_boolLightningErrorZ;
1897 * A tuple of 3 elements. See the individual fields for the types contained.
1899 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
1901 * The element at position 0
1903 struct LDKChannelAnnouncement a;
1905 * The element at position 1
1907 struct LDKChannelUpdate b;
1909 * The element at position 2
1911 struct LDKChannelUpdate c;
1912 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
1915 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
1916 * This corresponds to std::vector in C++
1918 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
1920 * The elements in the array.
1921 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1923 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
1925 * The number of elements pointed to by `data`.
1928 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
1931 * A dynamically-allocated array of crate::ln::msgs::NodeAnnouncements of arbitrary size.
1932 * This corresponds to std::vector in C++
1934 typedef struct LDKCVec_NodeAnnouncementZ {
1936 * The elements in the array.
1937 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1939 struct LDKNodeAnnouncement *data;
1941 * The number of elements pointed to by `data`.
1944 } LDKCVec_NodeAnnouncementZ;
1947 * The contents of CResult_NoneLightningErrorZ
1949 typedef union LDKCResult_NoneLightningErrorZPtr {
1951 * Note that this value is always NULL, as there are no contents in the OK variant
1955 * A pointer to the contents in the error state.
1956 * Reading from this pointer when `result_ok` is set is undefined.
1958 struct LDKLightningError *err;
1959 } LDKCResult_NoneLightningErrorZPtr;
1962 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
1963 * containing a () on success and a crate::ln::msgs::LightningError on failure.
1964 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1966 typedef struct LDKCResult_NoneLightningErrorZ {
1968 * The contents of this CResult_NoneLightningErrorZ, accessible via either
1969 * `err` or `result` depending on the state of `result_ok`.
1971 union LDKCResult_NoneLightningErrorZPtr contents;
1973 * Whether this CResult_NoneLightningErrorZ represents a success state.
1976 } LDKCResult_NoneLightningErrorZ;
1979 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
1980 * This corresponds to std::vector in C++
1982 typedef struct LDKCVec_PublicKeyZ {
1984 * The elements in the array.
1985 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1987 struct LDKPublicKey *data;
1989 * The number of elements pointed to by `data`.
1992 } LDKCVec_PublicKeyZ;
1997 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
1998 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
2001 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
2003 * A pointer to the opaque Rust object.
2004 * Nearly everywhere, inner must be non-null, however in places where
2005 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2007 LDKnativePeerHandleError *inner;
2009 * Indicates that this is the only struct which contains the same pointer.
2010 * Rust functions which take ownership of an object provided via an argument require
2011 * this to be true and invalidate the object pointed to by inner.
2014 } LDKPeerHandleError;
2017 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
2019 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
2021 * A pointer to the contents in the success state.
2022 * Reading from this pointer when `result_ok` is not set is undefined.
2024 struct LDKCVec_u8Z *result;
2026 * A pointer to the contents in the error state.
2027 * Reading from this pointer when `result_ok` is set is undefined.
2029 struct LDKPeerHandleError *err;
2030 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
2033 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
2034 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::ln::peer_handler::PeerHandleError on failure.
2035 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2037 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
2039 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
2040 * `err` or `result` depending on the state of `result_ok`.
2042 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
2044 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
2047 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
2050 * The contents of CResult_NonePeerHandleErrorZ
2052 typedef union LDKCResult_NonePeerHandleErrorZPtr {
2054 * Note that this value is always NULL, as there are no contents in the OK variant
2058 * A pointer to the contents in the error state.
2059 * Reading from this pointer when `result_ok` is set is undefined.
2061 struct LDKPeerHandleError *err;
2062 } LDKCResult_NonePeerHandleErrorZPtr;
2065 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
2066 * containing a () on success and a crate::ln::peer_handler::PeerHandleError on failure.
2067 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2069 typedef struct LDKCResult_NonePeerHandleErrorZ {
2071 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
2072 * `err` or `result` depending on the state of `result_ok`.
2074 union LDKCResult_NonePeerHandleErrorZPtr contents;
2076 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
2079 } LDKCResult_NonePeerHandleErrorZ;
2082 * The contents of CResult_boolPeerHandleErrorZ
2084 typedef union LDKCResult_boolPeerHandleErrorZPtr {
2086 * A pointer to the contents in the success state.
2087 * Reading from this pointer when `result_ok` is not set is undefined.
2091 * A pointer to the contents in the error state.
2092 * Reading from this pointer when `result_ok` is set is undefined.
2094 struct LDKPeerHandleError *err;
2095 } LDKCResult_boolPeerHandleErrorZPtr;
2098 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
2099 * containing a bool on success and a crate::ln::peer_handler::PeerHandleError on failure.
2100 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2102 typedef struct LDKCResult_boolPeerHandleErrorZ {
2104 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
2105 * `err` or `result` depending on the state of `result_ok`.
2107 union LDKCResult_boolPeerHandleErrorZPtr contents;
2109 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
2112 } LDKCResult_boolPeerHandleErrorZ;
2117 * Features used within an `init` message.
2119 typedef struct MUST_USE_STRUCT LDKInitFeatures {
2121 * A pointer to the opaque Rust object.
2122 * Nearly everywhere, inner must be non-null, however in places where
2123 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2125 LDKnativeInitFeatures *inner;
2127 * Indicates that this is the only struct which contains the same pointer.
2128 * Rust functions which take ownership of an object provided via an argument require
2129 * this to be true and invalidate the object pointed to by inner.
2135 * The contents of CResult_InitFeaturesDecodeErrorZ
2137 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
2139 * A pointer to the contents in the success state.
2140 * Reading from this pointer when `result_ok` is not set is undefined.
2142 struct LDKInitFeatures *result;
2144 * A pointer to the contents in the error state.
2145 * Reading from this pointer when `result_ok` is set is undefined.
2147 struct LDKDecodeError *err;
2148 } LDKCResult_InitFeaturesDecodeErrorZPtr;
2151 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
2152 * containing a crate::ln::features::InitFeatures on success and a crate::ln::msgs::DecodeError on failure.
2153 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2155 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
2157 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
2158 * `err` or `result` depending on the state of `result_ok`.
2160 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
2162 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
2165 } LDKCResult_InitFeaturesDecodeErrorZ;
2170 * Features used within a `node_announcement` message.
2172 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
2174 * A pointer to the opaque Rust object.
2175 * Nearly everywhere, inner must be non-null, however in places where
2176 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2178 LDKnativeNodeFeatures *inner;
2180 * Indicates that this is the only struct which contains the same pointer.
2181 * Rust functions which take ownership of an object provided via an argument require
2182 * this to be true and invalidate the object pointed to by inner.
2188 * The contents of CResult_NodeFeaturesDecodeErrorZ
2190 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
2192 * A pointer to the contents in the success state.
2193 * Reading from this pointer when `result_ok` is not set is undefined.
2195 struct LDKNodeFeatures *result;
2197 * A pointer to the contents in the error state.
2198 * Reading from this pointer when `result_ok` is set is undefined.
2200 struct LDKDecodeError *err;
2201 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
2204 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
2205 * containing a crate::ln::features::NodeFeatures on success and a crate::ln::msgs::DecodeError on failure.
2206 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2208 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
2210 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
2211 * `err` or `result` depending on the state of `result_ok`.
2213 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
2215 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
2218 } LDKCResult_NodeFeaturesDecodeErrorZ;
2223 * Features used within a `channel_announcement` message.
2225 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
2227 * A pointer to the opaque Rust object.
2228 * Nearly everywhere, inner must be non-null, however in places where
2229 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2231 LDKnativeChannelFeatures *inner;
2233 * Indicates that this is the only struct which contains the same pointer.
2234 * Rust functions which take ownership of an object provided via an argument require
2235 * this to be true and invalidate the object pointed to by inner.
2238 } LDKChannelFeatures;
2241 * The contents of CResult_ChannelFeaturesDecodeErrorZ
2243 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
2245 * A pointer to the contents in the success state.
2246 * Reading from this pointer when `result_ok` is not set is undefined.
2248 struct LDKChannelFeatures *result;
2250 * A pointer to the contents in the error state.
2251 * Reading from this pointer when `result_ok` is set is undefined.
2253 struct LDKDecodeError *err;
2254 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
2257 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
2258 * containing a crate::ln::features::ChannelFeatures on success and a crate::ln::msgs::DecodeError on failure.
2259 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2261 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
2263 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
2264 * `err` or `result` depending on the state of `result_ok`.
2266 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
2268 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
2271 } LDKCResult_ChannelFeaturesDecodeErrorZ;
2276 * Features used within an invoice.
2278 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
2280 * A pointer to the opaque Rust object.
2281 * Nearly everywhere, inner must be non-null, however in places where
2282 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2284 LDKnativeInvoiceFeatures *inner;
2286 * Indicates that this is the only struct which contains the same pointer.
2287 * Rust functions which take ownership of an object provided via an argument require
2288 * this to be true and invalidate the object pointed to by inner.
2291 } LDKInvoiceFeatures;
2294 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
2296 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
2298 * A pointer to the contents in the success state.
2299 * Reading from this pointer when `result_ok` is not set is undefined.
2301 struct LDKInvoiceFeatures *result;
2303 * A pointer to the contents in the error state.
2304 * Reading from this pointer when `result_ok` is set is undefined.
2306 struct LDKDecodeError *err;
2307 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
2310 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
2311 * containing a crate::ln::features::InvoiceFeatures on success and a crate::ln::msgs::DecodeError on failure.
2312 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2314 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
2316 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
2317 * `err` or `result` depending on the state of `result_ok`.
2319 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
2321 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
2324 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
2329 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
2330 * with our counterparty.
2332 typedef struct MUST_USE_STRUCT LDKChannelConfig {
2334 * A pointer to the opaque Rust object.
2335 * Nearly everywhere, inner must be non-null, however in places where
2336 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2338 LDKnativeChannelConfig *inner;
2340 * Indicates that this is the only struct which contains the same pointer.
2341 * Rust functions which take ownership of an object provided via an argument require
2342 * this to be true and invalidate the object pointed to by inner.
2348 * The contents of CResult_ChannelConfigDecodeErrorZ
2350 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
2352 * A pointer to the contents in the success state.
2353 * Reading from this pointer when `result_ok` is not set is undefined.
2355 struct LDKChannelConfig *result;
2357 * A pointer to the contents in the error state.
2358 * Reading from this pointer when `result_ok` is set is undefined.
2360 struct LDKDecodeError *err;
2361 } LDKCResult_ChannelConfigDecodeErrorZPtr;
2364 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
2365 * containing a crate::util::config::ChannelConfig on success and a crate::ln::msgs::DecodeError on failure.
2366 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2368 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
2370 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
2371 * `err` or `result` depending on the state of `result_ok`.
2373 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
2375 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
2378 } LDKCResult_ChannelConfigDecodeErrorZ;
2381 * An enum which can either contain a u64 or not
2383 typedef enum LDKCOption_u64Z_Tag {
2385 * When we're in this state, this COption_u64Z contains a u64
2387 LDKCOption_u64Z_Some,
2389 * When we're in this state, this COption_u64Z contains nothing
2391 LDKCOption_u64Z_None,
2393 * Must be last for serialization purposes
2395 LDKCOption_u64Z_Sentinel,
2396 } LDKCOption_u64Z_Tag;
2398 typedef struct LDKCOption_u64Z {
2399 LDKCOption_u64Z_Tag tag;
2410 * Details about one direction of a channel. Received
2411 * within a channel update.
2413 typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
2415 * A pointer to the opaque Rust object.
2416 * Nearly everywhere, inner must be non-null, however in places where
2417 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2419 LDKnativeDirectionalChannelInfo *inner;
2421 * Indicates that this is the only struct which contains the same pointer.
2422 * Rust functions which take ownership of an object provided via an argument require
2423 * this to be true and invalidate the object pointed to by inner.
2426 } LDKDirectionalChannelInfo;
2429 * The contents of CResult_DirectionalChannelInfoDecodeErrorZ
2431 typedef union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr {
2433 * A pointer to the contents in the success state.
2434 * Reading from this pointer when `result_ok` is not set is undefined.
2436 struct LDKDirectionalChannelInfo *result;
2438 * A pointer to the contents in the error state.
2439 * Reading from this pointer when `result_ok` is set is undefined.
2441 struct LDKDecodeError *err;
2442 } LDKCResult_DirectionalChannelInfoDecodeErrorZPtr;
2445 * A CResult_DirectionalChannelInfoDecodeErrorZ represents the result of a fallible operation,
2446 * containing a crate::routing::network_graph::DirectionalChannelInfo on success and a crate::ln::msgs::DecodeError on failure.
2447 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2449 typedef struct LDKCResult_DirectionalChannelInfoDecodeErrorZ {
2451 * The contents of this CResult_DirectionalChannelInfoDecodeErrorZ, accessible via either
2452 * `err` or `result` depending on the state of `result_ok`.
2454 union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr contents;
2456 * Whether this CResult_DirectionalChannelInfoDecodeErrorZ represents a success state.
2459 } LDKCResult_DirectionalChannelInfoDecodeErrorZ;
2464 * Details about a channel (both directions).
2465 * Received within a channel announcement.
2467 typedef struct MUST_USE_STRUCT LDKChannelInfo {
2469 * A pointer to the opaque Rust object.
2470 * Nearly everywhere, inner must be non-null, however in places where
2471 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2473 LDKnativeChannelInfo *inner;
2475 * Indicates that this is the only struct which contains the same pointer.
2476 * Rust functions which take ownership of an object provided via an argument require
2477 * this to be true and invalidate the object pointed to by inner.
2483 * The contents of CResult_ChannelInfoDecodeErrorZ
2485 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
2487 * A pointer to the contents in the success state.
2488 * Reading from this pointer when `result_ok` is not set is undefined.
2490 struct LDKChannelInfo *result;
2492 * A pointer to the contents in the error state.
2493 * Reading from this pointer when `result_ok` is set is undefined.
2495 struct LDKDecodeError *err;
2496 } LDKCResult_ChannelInfoDecodeErrorZPtr;
2499 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
2500 * containing a crate::routing::network_graph::ChannelInfo on success and a crate::ln::msgs::DecodeError on failure.
2501 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2503 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
2505 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
2506 * `err` or `result` depending on the state of `result_ok`.
2508 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
2510 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
2513 } LDKCResult_ChannelInfoDecodeErrorZ;
2518 * Fees for routing via a given channel or a node
2520 typedef struct MUST_USE_STRUCT LDKRoutingFees {
2522 * A pointer to the opaque Rust object.
2523 * Nearly everywhere, inner must be non-null, however in places where
2524 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2526 LDKnativeRoutingFees *inner;
2528 * Indicates that this is the only struct which contains the same pointer.
2529 * Rust functions which take ownership of an object provided via an argument require
2530 * this to be true and invalidate the object pointed to by inner.
2536 * The contents of CResult_RoutingFeesDecodeErrorZ
2538 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
2540 * A pointer to the contents in the success state.
2541 * Reading from this pointer when `result_ok` is not set is undefined.
2543 struct LDKRoutingFees *result;
2545 * A pointer to the contents in the error state.
2546 * Reading from this pointer when `result_ok` is set is undefined.
2548 struct LDKDecodeError *err;
2549 } LDKCResult_RoutingFeesDecodeErrorZPtr;
2552 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
2553 * containing a crate::routing::network_graph::RoutingFees on success and a crate::ln::msgs::DecodeError on failure.
2554 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2556 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
2558 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
2559 * `err` or `result` depending on the state of `result_ok`.
2561 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
2563 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
2566 } LDKCResult_RoutingFeesDecodeErrorZ;
2569 * A 4-byte byte array.
2571 typedef struct LDKFourBytes {
2579 * A 16-byte byte array.
2581 typedef struct LDKSixteenBytes {
2589 * A 10-byte byte array.
2591 typedef struct LDKTenBytes {
2599 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
2600 * look up the corresponding function in rust-lightning's docs.
2602 typedef struct LDKThirtyTwoBytes {
2604 * The thirty-two bytes
2607 } LDKThirtyTwoBytes;
2610 * An address which can be used to connect to a remote peer
2612 typedef enum LDKNetAddress_Tag {
2614 * An IPv4 address/port on which the peer is listening.
2618 * An IPv6 address/port on which the peer is listening.
2622 * An old-style Tor onion address/port on which the peer is listening.
2624 LDKNetAddress_OnionV2,
2626 * A new-style Tor onion address/port on which the peer is listening.
2627 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
2628 * wrap as base32 and append \".onion\".
2630 LDKNetAddress_OnionV3,
2632 * Must be last for serialization purposes
2634 LDKNetAddress_Sentinel,
2635 } LDKNetAddress_Tag;
2637 typedef struct LDKNetAddress_LDKIPv4_Body {
2639 * The 4-byte IPv4 address
2641 struct LDKFourBytes addr;
2643 * The port on which the node is listening
2646 } LDKNetAddress_LDKIPv4_Body;
2648 typedef struct LDKNetAddress_LDKIPv6_Body {
2650 * The 16-byte IPv6 address
2652 struct LDKSixteenBytes addr;
2654 * The port on which the node is listening
2657 } LDKNetAddress_LDKIPv6_Body;
2659 typedef struct LDKNetAddress_LDKOnionV2_Body {
2661 * The bytes (usually encoded in base32 with \".onion\" appended)
2663 struct LDKTenBytes addr;
2665 * The port on which the node is listening
2668 } LDKNetAddress_LDKOnionV2_Body;
2670 typedef struct LDKNetAddress_LDKOnionV3_Body {
2672 * The ed25519 long-term public key of the peer
2674 struct LDKThirtyTwoBytes ed25519_pubkey;
2676 * The checksum of the pubkey and version, as included in the onion address
2680 * The version byte, as defined by the Tor Onion v3 spec.
2684 * The port on which the node is listening
2687 } LDKNetAddress_LDKOnionV3_Body;
2689 typedef struct MUST_USE_STRUCT LDKNetAddress {
2690 LDKNetAddress_Tag tag;
2692 LDKNetAddress_LDKIPv4_Body i_pv4;
2693 LDKNetAddress_LDKIPv6_Body i_pv6;
2694 LDKNetAddress_LDKOnionV2_Body onion_v2;
2695 LDKNetAddress_LDKOnionV3_Body onion_v3;
2700 * A dynamically-allocated array of crate::ln::msgs::NetAddresss of arbitrary size.
2701 * This corresponds to std::vector in C++
2703 typedef struct LDKCVec_NetAddressZ {
2705 * The elements in the array.
2706 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2708 struct LDKNetAddress *data;
2710 * The number of elements pointed to by `data`.
2713 } LDKCVec_NetAddressZ;
2718 * Information received in the latest node_announcement from this node.
2720 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
2722 * A pointer to the opaque Rust object.
2723 * Nearly everywhere, inner must be non-null, however in places where
2724 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2726 LDKnativeNodeAnnouncementInfo *inner;
2728 * Indicates that this is the only struct which contains the same pointer.
2729 * Rust functions which take ownership of an object provided via an argument require
2730 * this to be true and invalidate the object pointed to by inner.
2733 } LDKNodeAnnouncementInfo;
2736 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
2738 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
2740 * A pointer to the contents in the success state.
2741 * Reading from this pointer when `result_ok` is not set is undefined.
2743 struct LDKNodeAnnouncementInfo *result;
2745 * A pointer to the contents in the error state.
2746 * Reading from this pointer when `result_ok` is set is undefined.
2748 struct LDKDecodeError *err;
2749 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
2752 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
2753 * containing a crate::routing::network_graph::NodeAnnouncementInfo on success and a crate::ln::msgs::DecodeError on failure.
2754 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2756 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
2758 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
2759 * `err` or `result` depending on the state of `result_ok`.
2761 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
2763 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
2766 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
2769 * A dynamically-allocated array of u64s of arbitrary size.
2770 * This corresponds to std::vector in C++
2772 typedef struct LDKCVec_u64Z {
2774 * The elements in the array.
2775 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2779 * The number of elements pointed to by `data`.
2787 * Details about a node in the network, known from the network announcement.
2789 typedef struct MUST_USE_STRUCT LDKNodeInfo {
2791 * A pointer to the opaque Rust object.
2792 * Nearly everywhere, inner must be non-null, however in places where
2793 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2795 LDKnativeNodeInfo *inner;
2797 * Indicates that this is the only struct which contains the same pointer.
2798 * Rust functions which take ownership of an object provided via an argument require
2799 * this to be true and invalidate the object pointed to by inner.
2805 * The contents of CResult_NodeInfoDecodeErrorZ
2807 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
2809 * A pointer to the contents in the success state.
2810 * Reading from this pointer when `result_ok` is not set is undefined.
2812 struct LDKNodeInfo *result;
2814 * A pointer to the contents in the error state.
2815 * Reading from this pointer when `result_ok` is set is undefined.
2817 struct LDKDecodeError *err;
2818 } LDKCResult_NodeInfoDecodeErrorZPtr;
2821 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
2822 * containing a crate::routing::network_graph::NodeInfo on success and a crate::ln::msgs::DecodeError on failure.
2823 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2825 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
2827 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
2828 * `err` or `result` depending on the state of `result_ok`.
2830 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
2832 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
2835 } LDKCResult_NodeInfoDecodeErrorZ;
2840 * Represents the network as nodes and channels between them
2842 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
2844 * A pointer to the opaque Rust object.
2845 * Nearly everywhere, inner must be non-null, however in places where
2846 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2848 LDKnativeNetworkGraph *inner;
2850 * Indicates that this is the only struct which contains the same pointer.
2851 * Rust functions which take ownership of an object provided via an argument require
2852 * this to be true and invalidate the object pointed to by inner.
2858 * The contents of CResult_NetworkGraphDecodeErrorZ
2860 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
2862 * A pointer to the contents in the success state.
2863 * Reading from this pointer when `result_ok` is not set is undefined.
2865 struct LDKNetworkGraph *result;
2867 * A pointer to the contents in the error state.
2868 * Reading from this pointer when `result_ok` is set is undefined.
2870 struct LDKDecodeError *err;
2871 } LDKCResult_NetworkGraphDecodeErrorZPtr;
2874 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
2875 * containing a crate::routing::network_graph::NetworkGraph on success and a crate::ln::msgs::DecodeError on failure.
2876 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2878 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
2880 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
2881 * `err` or `result` depending on the state of `result_ok`.
2883 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
2885 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
2888 } LDKCResult_NetworkGraphDecodeErrorZ;
2891 * A tuple of 2 elements. See the individual fields for the types contained.
2893 typedef struct LDKC2Tuple_usizeTransactionZ {
2895 * The element at position 0
2899 * The element at position 1
2901 struct LDKTransaction b;
2902 } LDKC2Tuple_usizeTransactionZ;
2905 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
2906 * This corresponds to std::vector in C++
2908 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
2910 * The elements in the array.
2911 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2913 struct LDKC2Tuple_usizeTransactionZ *data;
2915 * The number of elements pointed to by `data`.
2918 } LDKCVec_C2Tuple_usizeTransactionZZ;
2921 * The contents of CResult_NoneChannelMonitorUpdateErrZ
2923 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
2925 * Note that this value is always NULL, as there are no contents in the OK variant
2929 * A pointer to the contents in the error state.
2930 * Reading from this pointer when `result_ok` is set is undefined.
2932 enum LDKChannelMonitorUpdateErr *err;
2933 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
2936 * A CResult_NoneChannelMonitorUpdateErrZ represents the result of a fallible operation,
2937 * containing a () on success and a crate::chain::channelmonitor::ChannelMonitorUpdateErr on failure.
2938 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2940 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
2942 * The contents of this CResult_NoneChannelMonitorUpdateErrZ, accessible via either
2943 * `err` or `result` depending on the state of `result_ok`.
2945 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
2947 * Whether this CResult_NoneChannelMonitorUpdateErrZ represents a success state.
2950 } LDKCResult_NoneChannelMonitorUpdateErrZ;
2955 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
2956 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
2957 * preimage claim backward will lead to loss of funds.
2959 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
2961 * A pointer to the opaque Rust object.
2962 * Nearly everywhere, inner must be non-null, however in places where
2963 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2965 LDKnativeHTLCUpdate *inner;
2967 * Indicates that this is the only struct which contains the same pointer.
2968 * Rust functions which take ownership of an object provided via an argument require
2969 * this to be true and invalidate the object pointed to by inner.
2977 * A reference to a transaction output.
2979 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
2980 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
2982 typedef struct MUST_USE_STRUCT LDKOutPoint {
2984 * A pointer to the opaque Rust object.
2985 * Nearly everywhere, inner must be non-null, however in places where
2986 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2988 LDKnativeOutPoint *inner;
2990 * Indicates that this is the only struct which contains the same pointer.
2991 * Rust functions which take ownership of an object provided via an argument require
2992 * this to be true and invalidate the object pointed to by inner.
2998 * An event to be processed by the ChannelManager.
3000 typedef enum LDKMonitorEvent_Tag {
3002 * A monitor event containing an HTLCUpdate.
3004 LDKMonitorEvent_HTLCEvent,
3006 * A monitor event that the Channel's commitment transaction was broadcasted.
3008 LDKMonitorEvent_CommitmentTxBroadcasted,
3010 * Must be last for serialization purposes
3012 LDKMonitorEvent_Sentinel,
3013 } LDKMonitorEvent_Tag;
3015 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
3016 LDKMonitorEvent_Tag tag;
3019 struct LDKHTLCUpdate htlc_event;
3022 struct LDKOutPoint commitment_tx_broadcasted;
3028 * A dynamically-allocated array of crate::chain::channelmonitor::MonitorEvents of arbitrary size.
3029 * This corresponds to std::vector in C++
3031 typedef struct LDKCVec_MonitorEventZ {
3033 * The elements in the array.
3034 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3036 struct LDKMonitorEvent *data;
3038 * The number of elements pointed to by `data`.
3041 } LDKCVec_MonitorEventZ;
3046 * Information about a spendable output to a P2WSH script. See
3047 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
3049 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
3051 * A pointer to the opaque Rust object.
3052 * Nearly everywhere, inner must be non-null, however in places where
3053 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3055 LDKnativeDelayedPaymentOutputDescriptor *inner;
3057 * Indicates that this is the only struct which contains the same pointer.
3058 * Rust functions which take ownership of an object provided via an argument require
3059 * this to be true and invalidate the object pointed to by inner.
3062 } LDKDelayedPaymentOutputDescriptor;
3067 * Information about a spendable output to our \"payment key\". See
3068 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
3070 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
3072 * A pointer to the opaque Rust object.
3073 * Nearly everywhere, inner must be non-null, however in places where
3074 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3076 LDKnativeStaticPaymentOutputDescriptor *inner;
3078 * Indicates that this is the only struct which contains the same pointer.
3079 * Rust functions which take ownership of an object provided via an argument require
3080 * this to be true and invalidate the object pointed to by inner.
3083 } LDKStaticPaymentOutputDescriptor;
3086 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
3087 * claim at any point in the future) an event is generated which you must track and be able to
3088 * spend on-chain. The information needed to do this is provided in this enum, including the
3089 * outpoint describing which txid and output index is available, the full output which exists at
3090 * that txid/index, and any keys or other information required to sign.
3092 typedef enum LDKSpendableOutputDescriptor_Tag {
3094 * An output to a script which was provided via KeysInterface directly, either from
3095 * `get_destination_script()` or `get_shutdown_pubkey()`, thus you should already know how to
3096 * spend it. No secret keys are provided as rust-lightning was never given any key.
3097 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
3098 * on-chain using the payment preimage or after it has timed out.
3100 LDKSpendableOutputDescriptor_StaticOutput,
3102 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
3104 * The witness in the spending input should be:
3105 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
3107 * Note that the nSequence field in the spending input must be set to to_self_delay
3108 * (which means the transaction is not broadcastable until at least to_self_delay
3109 * blocks after the outpoint confirms).
3111 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
3112 * it is an output from an old state which we broadcast (which should never happen).
3114 * To derive the delayed_payment key which is used to sign for this input, you must pass the
3115 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
3116 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
3117 * chan_utils::derive_private_key. The public key can be generated without the secret key
3118 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
3121 * To derive the revocation_pubkey provided here (which is used in the witness
3122 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
3123 * call to Sign::ready_channel) and the provided per_commitment point
3124 * to chan_utils::derive_public_revocation_key.
3126 * The witness script which is hashed and included in the output script_pubkey may be
3127 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
3128 * (derived as above), and the to_self_delay contained here to
3129 * chan_utils::get_revokeable_redeemscript.
3131 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
3133 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
3134 * corresponds to the public key in Sign::pubkeys().payment_point).
3135 * The witness in the spending input, is, thus, simply:
3136 * <BIP 143 signature> <payment key>
3138 * These are generally the result of our counterparty having broadcast the current state,
3139 * allowing us to claim the non-HTLC-encumbered outputs immediately.
3141 LDKSpendableOutputDescriptor_StaticPaymentOutput,
3143 * Must be last for serialization purposes
3145 LDKSpendableOutputDescriptor_Sentinel,
3146 } LDKSpendableOutputDescriptor_Tag;
3148 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
3150 * The outpoint which is spendable
3152 struct LDKOutPoint outpoint;
3154 * The output which is referenced by the given outpoint.
3156 struct LDKTxOut output;
3157 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
3159 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
3160 LDKSpendableOutputDescriptor_Tag tag;
3162 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
3164 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
3167 struct LDKStaticPaymentOutputDescriptor static_payment_output;
3170 } LDKSpendableOutputDescriptor;
3173 * A dynamically-allocated array of crate::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
3174 * This corresponds to std::vector in C++
3176 typedef struct LDKCVec_SpendableOutputDescriptorZ {
3178 * The elements in the array.
3179 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3181 struct LDKSpendableOutputDescriptor *data;
3183 * The number of elements pointed to by `data`.
3186 } LDKCVec_SpendableOutputDescriptorZ;
3189 * An Event which you should probably take some action in response to.
3191 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
3192 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
3193 * written as it makes no sense to respond to it after reconnecting to peers).
3195 typedef enum LDKEvent_Tag {
3197 * Used to indicate that the client should generate a funding transaction with the given
3198 * parameters and then call ChannelManager::funding_transaction_generated.
3199 * Generated in ChannelManager message handling.
3200 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
3201 * counterparty can steal your funds!
3203 LDKEvent_FundingGenerationReady,
3205 * Indicates we've received money! Just gotta dig out that payment preimage and feed it to
3206 * ChannelManager::claim_funds to get it....
3207 * Note that if the preimage is not known or the amount paid is incorrect, you should call
3208 * ChannelManager::fail_htlc_backwards to free up resources for this HTLC and avoid
3209 * network congestion.
3210 * The amount paid should be considered 'incorrect' when it is less than or more than twice
3211 * the amount expected.
3212 * If you fail to call either ChannelManager::claim_funds or
3213 * ChannelManager::fail_htlc_backwards within the HTLC's timeout, the HTLC will be
3214 * automatically failed.
3216 LDKEvent_PaymentReceived,
3218 * Indicates an outbound payment we made succeeded (ie it made it all the way to its target
3219 * and we got back the payment preimage for it).
3220 * Note that duplicative PaymentSent Events may be generated - it is your responsibility to
3221 * deduplicate them by payment_preimage (which MUST be unique)!
3223 LDKEvent_PaymentSent,
3225 * Indicates an outbound payment we made failed. Probably some intermediary node dropped
3226 * something. You may wish to retry with a different route.
3227 * Note that duplicative PaymentFailed Events may be generated - it is your responsibility to
3228 * deduplicate them by payment_hash (which MUST be unique)!
3230 LDKEvent_PaymentFailed,
3232 * Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
3233 * time in the future.
3235 LDKEvent_PendingHTLCsForwardable,
3237 * Used to indicate that an output was generated on-chain which you should know how to spend.
3238 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
3239 * counterparty spending them due to some kind of timeout. Thus, you need to store them
3240 * somewhere and spend them when you create on-chain transactions.
3242 LDKEvent_SpendableOutputs,
3244 * Must be last for serialization purposes
3249 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
3251 * The random channel_id we picked which you'll need to pass into
3252 * ChannelManager::funding_transaction_generated.
3254 struct LDKThirtyTwoBytes temporary_channel_id;
3256 * The value, in satoshis, that the output should have.
3258 uint64_t channel_value_satoshis;
3260 * The script which should be used in the transaction output.
3262 struct LDKCVec_u8Z output_script;
3264 * The value passed in to ChannelManager::create_channel
3266 uint64_t user_channel_id;
3267 } LDKEvent_LDKFundingGenerationReady_Body;
3269 typedef struct LDKEvent_LDKPaymentReceived_Body {
3271 * The hash for which the preimage should be handed to the ChannelManager.
3273 struct LDKThirtyTwoBytes payment_hash;
3275 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
3276 * number of deanonymization attacks during the routing process.
3277 * As nodes upgrade, the invoices you provide should likely migrate to setting the
3278 * payment_secret feature to required, at which point you should fail_backwards any HTLCs
3279 * which have a None here.
3280 * Until then, however, values of None should be ignored, and only incorrect Some values
3281 * should result in an HTLC fail_backwards.
3282 * Note that, in any case, this value must be passed as-is to any fail or claim calls as
3283 * the HTLC index includes this value.
3285 struct LDKThirtyTwoBytes payment_secret;
3287 * The value, in thousandths of a satoshi, that this payment is for. Note that you must
3288 * compare this to the expected value before accepting the payment (as otherwise you are
3289 * providing proof-of-payment for less than the value you expected!).
3292 } LDKEvent_LDKPaymentReceived_Body;
3294 typedef struct LDKEvent_LDKPaymentSent_Body {
3296 * The preimage to the hash given to ChannelManager::send_payment.
3297 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
3300 struct LDKThirtyTwoBytes payment_preimage;
3301 } LDKEvent_LDKPaymentSent_Body;
3303 typedef struct LDKEvent_LDKPaymentFailed_Body {
3305 * The hash which was given to ChannelManager::send_payment.
3307 struct LDKThirtyTwoBytes payment_hash;
3309 * Indicates the payment was rejected for some reason by the recipient. This implies that
3310 * the payment has failed, not just the route in question. If this is not set, you may
3311 * retry the payment via a different route.
3313 bool rejected_by_dest;
3314 } LDKEvent_LDKPaymentFailed_Body;
3316 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
3318 * The minimum amount of time that should be waited prior to calling
3319 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
3320 * you should wait a random amount of time in roughly the range (now + time_forwardable,
3321 * now + 5*time_forwardable).
3323 uint64_t time_forwardable;
3324 } LDKEvent_LDKPendingHTLCsForwardable_Body;
3326 typedef struct LDKEvent_LDKSpendableOutputs_Body {
3328 * The outputs which you should store as spendable by you.
3330 struct LDKCVec_SpendableOutputDescriptorZ outputs;
3331 } LDKEvent_LDKSpendableOutputs_Body;
3333 typedef struct MUST_USE_STRUCT LDKEvent {
3336 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
3337 LDKEvent_LDKPaymentReceived_Body payment_received;
3338 LDKEvent_LDKPaymentSent_Body payment_sent;
3339 LDKEvent_LDKPaymentFailed_Body payment_failed;
3340 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
3341 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
3346 * A dynamically-allocated array of crate::util::events::Events of arbitrary size.
3347 * This corresponds to std::vector in C++
3349 typedef struct LDKCVec_EventZ {
3351 * The elements in the array.
3352 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3354 struct LDKEvent *data;
3356 * The number of elements pointed to by `data`.
3362 * The contents of CResult_OutPointDecodeErrorZ
3364 typedef union LDKCResult_OutPointDecodeErrorZPtr {
3366 * A pointer to the contents in the success state.
3367 * Reading from this pointer when `result_ok` is not set is undefined.
3369 struct LDKOutPoint *result;
3371 * A pointer to the contents in the error state.
3372 * Reading from this pointer when `result_ok` is set is undefined.
3374 struct LDKDecodeError *err;
3375 } LDKCResult_OutPointDecodeErrorZPtr;
3378 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
3379 * containing a crate::chain::transaction::OutPoint on success and a crate::ln::msgs::DecodeError on failure.
3380 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3382 typedef struct LDKCResult_OutPointDecodeErrorZ {
3384 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
3385 * `err` or `result` depending on the state of `result_ok`.
3387 union LDKCResult_OutPointDecodeErrorZPtr contents;
3389 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
3392 } LDKCResult_OutPointDecodeErrorZ;
3397 * An update generated by the underlying Channel itself which contains some new information the
3398 * ChannelMonitor should be made aware of.
3400 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
3402 * A pointer to the opaque Rust object.
3403 * Nearly everywhere, inner must be non-null, however in places where
3404 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3406 LDKnativeChannelMonitorUpdate *inner;
3408 * Indicates that this is the only struct which contains the same pointer.
3409 * Rust functions which take ownership of an object provided via an argument require
3410 * this to be true and invalidate the object pointed to by inner.
3413 } LDKChannelMonitorUpdate;
3416 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
3418 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
3420 * A pointer to the contents in the success state.
3421 * Reading from this pointer when `result_ok` is not set is undefined.
3423 struct LDKChannelMonitorUpdate *result;
3425 * A pointer to the contents in the error state.
3426 * Reading from this pointer when `result_ok` is set is undefined.
3428 struct LDKDecodeError *err;
3429 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
3432 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
3433 * containing a crate::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::ln::msgs::DecodeError on failure.
3434 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3436 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
3438 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
3439 * `err` or `result` depending on the state of `result_ok`.
3441 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
3443 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
3446 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
3449 * The contents of CResult_HTLCUpdateDecodeErrorZ
3451 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
3453 * A pointer to the contents in the success state.
3454 * Reading from this pointer when `result_ok` is not set is undefined.
3456 struct LDKHTLCUpdate *result;
3458 * A pointer to the contents in the error state.
3459 * Reading from this pointer when `result_ok` is set is undefined.
3461 struct LDKDecodeError *err;
3462 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
3465 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
3466 * containing a crate::chain::channelmonitor::HTLCUpdate on success and a crate::ln::msgs::DecodeError on failure.
3467 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3469 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
3471 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
3472 * `err` or `result` depending on the state of `result_ok`.
3474 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
3476 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
3479 } LDKCResult_HTLCUpdateDecodeErrorZ;
3484 * General Err type for ChannelMonitor actions. Generally, this implies that the data provided is
3485 * inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this
3486 * means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was
3488 * Contains a developer-readable error message.
3490 typedef struct MUST_USE_STRUCT LDKMonitorUpdateError {
3492 * A pointer to the opaque Rust object.
3493 * Nearly everywhere, inner must be non-null, however in places where
3494 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3496 LDKnativeMonitorUpdateError *inner;
3498 * Indicates that this is the only struct which contains the same pointer.
3499 * Rust functions which take ownership of an object provided via an argument require
3500 * this to be true and invalidate the object pointed to by inner.
3503 } LDKMonitorUpdateError;
3506 * The contents of CResult_NoneMonitorUpdateErrorZ
3508 typedef union LDKCResult_NoneMonitorUpdateErrorZPtr {
3510 * Note that this value is always NULL, as there are no contents in the OK variant
3514 * A pointer to the contents in the error state.
3515 * Reading from this pointer when `result_ok` is set is undefined.
3517 struct LDKMonitorUpdateError *err;
3518 } LDKCResult_NoneMonitorUpdateErrorZPtr;
3521 * A CResult_NoneMonitorUpdateErrorZ represents the result of a fallible operation,
3522 * containing a () on success and a crate::chain::channelmonitor::MonitorUpdateError on failure.
3523 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3525 typedef struct LDKCResult_NoneMonitorUpdateErrorZ {
3527 * The contents of this CResult_NoneMonitorUpdateErrorZ, accessible via either
3528 * `err` or `result` depending on the state of `result_ok`.
3530 union LDKCResult_NoneMonitorUpdateErrorZPtr contents;
3532 * Whether this CResult_NoneMonitorUpdateErrorZ represents a success state.
3535 } LDKCResult_NoneMonitorUpdateErrorZ;
3538 * A tuple of 2 elements. See the individual fields for the types contained.
3540 typedef struct LDKC2Tuple_OutPointScriptZ {
3542 * The element at position 0
3544 struct LDKOutPoint a;
3546 * The element at position 1
3548 struct LDKCVec_u8Z b;
3549 } LDKC2Tuple_OutPointScriptZ;
3552 * A tuple of 2 elements. See the individual fields for the types contained.
3554 typedef struct LDKC2Tuple_u32ScriptZ {
3556 * The element at position 0
3560 * The element at position 1
3562 struct LDKCVec_u8Z b;
3563 } LDKC2Tuple_u32ScriptZ;
3566 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
3567 * This corresponds to std::vector in C++
3569 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
3571 * The elements in the array.
3572 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3574 struct LDKC2Tuple_u32ScriptZ *data;
3576 * The number of elements pointed to by `data`.
3579 } LDKCVec_C2Tuple_u32ScriptZZ;
3582 * A tuple of 2 elements. See the individual fields for the types contained.
3584 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
3586 * The element at position 0
3588 struct LDKThirtyTwoBytes a;
3590 * The element at position 1
3592 struct LDKCVec_C2Tuple_u32ScriptZZ b;
3593 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
3596 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
3597 * This corresponds to std::vector in C++
3599 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
3601 * The elements in the array.
3602 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3604 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
3606 * The number of elements pointed to by `data`.
3609 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
3612 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
3613 * This corresponds to std::vector in C++
3615 typedef struct LDKCVec_TransactionZ {
3617 * The elements in the array.
3618 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3620 struct LDKTransaction *data;
3622 * The number of elements pointed to by `data`.
3625 } LDKCVec_TransactionZ;
3628 * A tuple of 2 elements. See the individual fields for the types contained.
3630 typedef struct LDKC2Tuple_u32TxOutZ {
3632 * The element at position 0
3636 * The element at position 1
3639 } LDKC2Tuple_u32TxOutZ;
3642 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
3643 * This corresponds to std::vector in C++
3645 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
3647 * The elements in the array.
3648 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3650 struct LDKC2Tuple_u32TxOutZ *data;
3652 * The number of elements pointed to by `data`.
3655 } LDKCVec_C2Tuple_u32TxOutZZ;
3658 * A tuple of 2 elements. See the individual fields for the types contained.
3660 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
3662 * The element at position 0
3664 struct LDKThirtyTwoBytes a;
3666 * The element at position 1
3668 struct LDKCVec_C2Tuple_u32TxOutZZ b;
3669 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
3672 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
3673 * This corresponds to std::vector in C++
3675 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ {
3677 * The elements in the array.
3678 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3680 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
3682 * The number of elements pointed to by `data`.
3685 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ;
3688 * A tuple of 2 elements. See the individual fields for the types contained.
3690 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
3692 * The element at position 0
3694 struct LDKSignature a;
3696 * The element at position 1
3698 struct LDKCVec_SignatureZ b;
3699 } LDKC2Tuple_SignatureCVec_SignatureZZ;
3702 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
3704 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
3706 * A pointer to the contents in the success state.
3707 * Reading from this pointer when `result_ok` is not set is undefined.
3709 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
3711 * Note that this value is always NULL, as there are no contents in the Err variant
3714 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
3717 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
3718 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
3719 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3721 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
3723 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
3724 * `err` or `result` depending on the state of `result_ok`.
3726 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
3728 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
3731 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
3734 * The contents of CResult_SignatureNoneZ
3736 typedef union LDKCResult_SignatureNoneZPtr {
3738 * A pointer to the contents in the success state.
3739 * Reading from this pointer when `result_ok` is not set is undefined.
3741 struct LDKSignature *result;
3743 * Note that this value is always NULL, as there are no contents in the Err variant
3746 } LDKCResult_SignatureNoneZPtr;
3749 * A CResult_SignatureNoneZ represents the result of a fallible operation,
3750 * containing a crate::c_types::Signature on success and a () on failure.
3751 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3753 typedef struct LDKCResult_SignatureNoneZ {
3755 * The contents of this CResult_SignatureNoneZ, accessible via either
3756 * `err` or `result` depending on the state of `result_ok`.
3758 union LDKCResult_SignatureNoneZPtr contents;
3760 * Whether this CResult_SignatureNoneZ represents a success state.
3763 } LDKCResult_SignatureNoneZ;
3768 * The unsigned part of a channel_announcement
3770 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
3772 * A pointer to the opaque Rust object.
3773 * Nearly everywhere, inner must be non-null, however in places where
3774 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3776 LDKnativeUnsignedChannelAnnouncement *inner;
3778 * Indicates that this is the only struct which contains the same pointer.
3779 * Rust functions which take ownership of an object provided via an argument require
3780 * this to be true and invalidate the object pointed to by inner.
3783 } LDKUnsignedChannelAnnouncement;
3786 * A trait to sign lightning channel transactions as described in BOLT 3.
3788 * Signing services could be implemented on a hardware wallet. In this case,
3789 * the current Sign would be a front-end on top of a communication
3790 * channel connected to your secure device and lightning key material wouldn't
3791 * reside on a hot server. Nevertheless, a this deployment would still need
3792 * to trust the ChannelManager to avoid loss of funds as this latest component
3793 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
3795 * A more secure iteration would be to use hashlock (or payment points) to pair
3796 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
3797 * at the price of more state and computation on the hardware wallet side. In the future,
3798 * we are looking forward to design such interface.
3800 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
3801 * to act, as liveness and breach reply correctness are always going to be hard requirements
3802 * of LN security model, orthogonal of key management issues.
3804 typedef struct LDKBaseSign {
3806 * An opaque pointer which is passed to your function implementations as an argument.
3807 * This has no meaning in the LDK, and can be NULL or any other value.
3811 * Gets the per-commitment point for a specific commitment number
3813 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
3815 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
3817 * Gets the commitment secret for a specific commitment number as part of the revocation process
3819 * An external signer implementation should error here if the commitment was already signed
3820 * and should refuse to sign it in the future.
3822 * May be called more than once for the same index.
3824 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
3826 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
3828 * Gets the holder's channel public keys and basepoints
3830 struct LDKChannelPublicKeys pubkeys;
3832 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
3833 * Note that this takes a pointer to this object, not the this_ptr like other methods do
3834 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
3836 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
3838 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
3839 * some SpendableOutputDescriptor types. This should be sufficient to identify this
3840 * Sign object uniquely and lookup or re-derive its keys.
3842 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
3844 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
3846 * Note that if signing fails or is rejected, the channel will be force-closed.
3848 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx);
3850 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
3851 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
3852 * latest commitment_tx when we initiate a force-close.
3853 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
3854 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
3856 * This may be called multiple times for the same transaction.
3858 * An external signer implementation should check that the commitment has not been revoked.
3860 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
3862 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
3864 * Create a signature for the given input in a transaction spending an HTLC or commitment
3865 * transaction output when our counterparty broadcasts an old state.
3867 * A justice transaction may claim multiples outputs at the same time if timelocks are
3868 * similar, but only a signature for the input at index `input` should be signed for here.
3869 * It may be called multiples time for same output(s) if a fee-bump is needed with regards
3870 * to an upcoming timelock expiration.
3872 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
3874 * per_commitment_key is revocation secret which was provided by our counterparty when they
3875 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
3876 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
3879 * htlc holds HTLC elements (hash, timelock) if the output being spent is a HTLC output, thus
3880 * changing the format of the witness script (which is committed to in the BIP 143
3883 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);
3885 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
3886 * transaction, either offered or received.
3888 * Such a transaction may claim multiples offered outputs at same time if we know the
3889 * preimage for each when we create it, but only the input at index `input` should be
3890 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
3891 * needed with regards to an upcoming timelock expiration.
3893 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
3896 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
3898 * Per_commitment_point is the dynamic point corresponding to the channel state
3899 * detected onchain. It has been generated by our counterparty and is used to derive
3900 * channel state keys, which are then included in the witness script and committed to in the
3901 * BIP 143 signature.
3903 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);
3905 * Create a signature for a (proposed) closing transaction.
3907 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
3908 * chosen to forgo their output as dust.
3910 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, struct LDKTransaction closing_tx);
3912 * Signs a channel announcement message with our funding key, proving it comes from one
3913 * of the channel participants.
3915 * Note that if this fails or is rejected, the channel will not be publicly announced and
3916 * our counterparty may (though likely will not) close the channel on us for violating the
3919 struct LDKCResult_SignatureNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
3921 * Set the counterparty static channel data, including basepoints,
3922 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
3923 * This is done as soon as the funding outpoint is known. Since these are static channel data,
3924 * they MUST NOT be allowed to change to different values once set.
3926 * channel_parameters.is_populated() MUST be true.
3928 * We bind holder_selected_contest_delay late here for API convenience.
3930 * Will be called before any signatures are applied.
3932 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
3934 * Frees any resources associated with this object given its this_arg pointer.
3935 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3937 void (*free)(void *this_arg);
3941 * A cloneable signer.
3943 * Although we require signers to be cloneable, it may be useful for developers to be able to use
3944 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
3945 * which implies Sized, into this derived trait.
3947 typedef struct LDKSign {
3949 * An opaque pointer which is passed to your function implementations as an argument.
3950 * This has no meaning in the LDK, and can be NULL or any other value.
3954 * Implementation of BaseSign for this object.
3956 struct LDKBaseSign BaseSign;
3958 * Creates a copy of the BaseSign, for a copy of this Sign.
3959 * Because BaseSign doesn't natively support copying itself, you have to provide a full copy implementation here.
3961 struct LDKBaseSign (*BaseSign_clone)(const struct LDKBaseSign *NONNULL_PTR orig_BaseSign);
3963 * Serialize the object into a byte array
3965 struct LDKCVec_u8Z (*write)(const void *this_arg);
3967 * Creates a copy of the object pointed to by this_arg, for a copy of this Sign.
3968 * Note that the ultimate copy of the Sign will have all function pointers the same as the original.
3969 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new Sign.
3971 void *(*clone)(const void *this_arg);
3973 * Frees any resources associated with this object given its this_arg pointer.
3974 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3976 void (*free)(void *this_arg);
3982 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
3983 * on-chain transactions to ensure no loss of funds occurs.
3985 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
3986 * information and are actively monitoring the chain.
3988 * Pending Events or updated HTLCs which have not yet been read out by
3989 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
3990 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
3991 * gotten are fully handled before re-serializing the new state.
3993 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
3994 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
3995 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
3996 * returned block hash and the the current chain and then reconnecting blocks to get to the
3997 * best chain) upon deserializing the object!
3999 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
4001 * A pointer to the opaque Rust object.
4002 * Nearly everywhere, inner must be non-null, however in places where
4003 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4005 LDKnativeChannelMonitor *inner;
4007 * Indicates that this is the only struct which contains the same pointer.
4008 * Rust functions which take ownership of an object provided via an argument require
4009 * this to be true and invalidate the object pointed to by inner.
4012 } LDKChannelMonitor;
4015 * A tuple of 2 elements. See the individual fields for the types contained.
4017 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
4019 * The element at position 0
4021 struct LDKThirtyTwoBytes a;
4023 * The element at position 1
4025 struct LDKChannelMonitor b;
4026 } LDKC2Tuple_BlockHashChannelMonitorZ;
4029 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
4031 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
4033 * A pointer to the contents in the success state.
4034 * Reading from this pointer when `result_ok` is not set is undefined.
4036 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
4038 * A pointer to the contents in the error state.
4039 * Reading from this pointer when `result_ok` is set is undefined.
4041 struct LDKDecodeError *err;
4042 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
4045 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
4046 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::ln::msgs::DecodeError on failure.
4047 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4049 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
4051 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
4052 * `err` or `result` depending on the state of `result_ok`.
4054 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
4056 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
4059 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
4062 * The contents of CResult_TxOutAccessErrorZ
4064 typedef union LDKCResult_TxOutAccessErrorZPtr {
4066 * A pointer to the contents in the success state.
4067 * Reading from this pointer when `result_ok` is not set is undefined.
4069 struct LDKTxOut *result;
4071 * A pointer to the contents in the error state.
4072 * Reading from this pointer when `result_ok` is set is undefined.
4074 enum LDKAccessError *err;
4075 } LDKCResult_TxOutAccessErrorZPtr;
4078 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
4079 * containing a crate::c_types::TxOut on success and a crate::chain::AccessError on failure.
4080 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4082 typedef struct LDKCResult_TxOutAccessErrorZ {
4084 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
4085 * `err` or `result` depending on the state of `result_ok`.
4087 union LDKCResult_TxOutAccessErrorZPtr contents;
4089 * Whether this CResult_TxOutAccessErrorZ represents a success state.
4092 } LDKCResult_TxOutAccessErrorZ;
4095 * An enum which can either contain a crate::c_types::derived::C2Tuple_usizeTransactionZ or not
4097 typedef enum LDKCOption_C2Tuple_usizeTransactionZZ_Tag {
4099 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains a crate::c_types::derived::C2Tuple_usizeTransactionZ
4101 LDKCOption_C2Tuple_usizeTransactionZZ_Some,
4103 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains nothing
4105 LDKCOption_C2Tuple_usizeTransactionZZ_None,
4107 * Must be last for serialization purposes
4109 LDKCOption_C2Tuple_usizeTransactionZZ_Sentinel,
4110 } LDKCOption_C2Tuple_usizeTransactionZZ_Tag;
4112 typedef struct LDKCOption_C2Tuple_usizeTransactionZZ {
4113 LDKCOption_C2Tuple_usizeTransactionZZ_Tag tag;
4116 struct LDKC2Tuple_usizeTransactionZ some;
4119 } LDKCOption_C2Tuple_usizeTransactionZZ;
4122 * A Rust str object, ie a reference to a UTF8-valid string.
4123 * This is *not* null-terminated so cannot be used directly as a C string!
4125 typedef struct LDKStr {
4127 * A pointer to the string's bytes, in UTF8 encoding
4129 const uint8_t *chars;
4131 * The number of bytes (not characters!) pointed to by `chars`
4137 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
4140 typedef enum LDKAPIError_Tag {
4142 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
4143 * are documented, but generally indicates some precondition of a function was violated.
4145 LDKAPIError_APIMisuseError,
4147 * Due to a high feerate, we were unable to complete the request.
4148 * For example, this may be returned if the feerate implies we cannot open a channel at the
4149 * requested value, but opening a larger channel would succeed.
4151 LDKAPIError_FeeRateTooHigh,
4153 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
4154 * too-many-hops, etc).
4156 LDKAPIError_RouteError,
4158 * We were unable to complete the request as the Channel required to do so is unable to
4159 * complete the request (or was not found). This can take many forms, including disconnected
4160 * peer, channel at capacity, channel shutting down, etc.
4162 LDKAPIError_ChannelUnavailable,
4164 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
4165 * attempted action to fail.
4167 LDKAPIError_MonitorUpdateFailed,
4169 * Must be last for serialization purposes
4171 LDKAPIError_Sentinel,
4174 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
4176 * A human-readable error message
4178 struct LDKCVec_u8Z err;
4179 } LDKAPIError_LDKAPIMisuseError_Body;
4181 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
4183 * A human-readable error message
4185 struct LDKCVec_u8Z err;
4187 * The feerate which was too high.
4190 } LDKAPIError_LDKFeeRateTooHigh_Body;
4192 typedef struct LDKAPIError_LDKRouteError_Body {
4194 * A human-readable error message
4197 } LDKAPIError_LDKRouteError_Body;
4199 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
4201 * A human-readable error message
4203 struct LDKCVec_u8Z err;
4204 } LDKAPIError_LDKChannelUnavailable_Body;
4206 typedef struct MUST_USE_STRUCT LDKAPIError {
4207 LDKAPIError_Tag tag;
4209 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
4210 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
4211 LDKAPIError_LDKRouteError_Body route_error;
4212 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
4217 * The contents of CResult_NoneAPIErrorZ
4219 typedef union LDKCResult_NoneAPIErrorZPtr {
4221 * Note that this value is always NULL, as there are no contents in the OK variant
4225 * A pointer to the contents in the error state.
4226 * Reading from this pointer when `result_ok` is set is undefined.
4228 struct LDKAPIError *err;
4229 } LDKCResult_NoneAPIErrorZPtr;
4232 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
4233 * containing a () on success and a crate::util::errors::APIError on failure.
4234 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4236 typedef struct LDKCResult_NoneAPIErrorZ {
4238 * The contents of this CResult_NoneAPIErrorZ, accessible via either
4239 * `err` or `result` depending on the state of `result_ok`.
4241 union LDKCResult_NoneAPIErrorZPtr contents;
4243 * Whether this CResult_NoneAPIErrorZ represents a success state.
4246 } LDKCResult_NoneAPIErrorZ;
4249 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
4250 * This corresponds to std::vector in C++
4252 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
4254 * The elements in the array.
4255 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4257 struct LDKCResult_NoneAPIErrorZ *data;
4259 * The number of elements pointed to by `data`.
4262 } LDKCVec_CResult_NoneAPIErrorZZ;
4265 * A dynamically-allocated array of crate::util::errors::APIErrors of arbitrary size.
4266 * This corresponds to std::vector in C++
4268 typedef struct LDKCVec_APIErrorZ {
4270 * The elements in the array.
4271 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4273 struct LDKAPIError *data;
4275 * The number of elements pointed to by `data`.
4278 } LDKCVec_APIErrorZ;
4283 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
4285 typedef struct MUST_USE_STRUCT LDKChannelDetails {
4287 * A pointer to the opaque Rust object.
4288 * Nearly everywhere, inner must be non-null, however in places where
4289 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4291 LDKnativeChannelDetails *inner;
4293 * Indicates that this is the only struct which contains the same pointer.
4294 * Rust functions which take ownership of an object provided via an argument require
4295 * this to be true and invalidate the object pointed to by inner.
4298 } LDKChannelDetails;
4301 * A dynamically-allocated array of crate::ln::channelmanager::ChannelDetailss of arbitrary size.
4302 * This corresponds to std::vector in C++
4304 typedef struct LDKCVec_ChannelDetailsZ {
4306 * The elements in the array.
4307 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4309 struct LDKChannelDetails *data;
4311 * The number of elements pointed to by `data`.
4314 } LDKCVec_ChannelDetailsZ;
4317 * If a payment fails to send, it can be in one of several states. This enum is returned as the
4318 * Err() type describing which state the payment is in, see the description of individual enum
4321 typedef enum LDKPaymentSendFailure_Tag {
4323 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
4324 * send the payment at all. No channel state has been changed or messages sent to peers, and
4325 * once you've changed the parameter at error, you can freely retry the payment in full.
4327 LDKPaymentSendFailure_ParameterError,
4329 * A parameter in a single path which was passed to send_payment was invalid, preventing us
4330 * from attempting to send the payment at all. No channel state has been changed or messages
4331 * sent to peers, and once you've changed the parameter at error, you can freely retry the
4334 * The results here are ordered the same as the paths in the route object which was passed to
4337 LDKPaymentSendFailure_PathParameterError,
4339 * All paths which were attempted failed to send, with no channel state change taking place.
4340 * You can freely retry the payment in full (though you probably want to do so over different
4341 * paths than the ones selected).
4343 LDKPaymentSendFailure_AllFailedRetrySafe,
4345 * Some paths which were attempted failed to send, though possibly not all. At least some
4346 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
4347 * in over-/re-payment.
4349 * The results here are ordered the same as the paths in the route object which was passed to
4350 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
4351 * retried (though there is currently no API with which to do so).
4353 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
4354 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
4355 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
4356 * with the latest update_id.
4358 LDKPaymentSendFailure_PartialFailure,
4360 * Must be last for serialization purposes
4362 LDKPaymentSendFailure_Sentinel,
4363 } LDKPaymentSendFailure_Tag;
4365 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
4366 LDKPaymentSendFailure_Tag tag;
4369 struct LDKAPIError parameter_error;
4372 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
4375 struct LDKCVec_APIErrorZ all_failed_retry_safe;
4378 struct LDKCVec_CResult_NoneAPIErrorZZ partial_failure;
4381 } LDKPaymentSendFailure;
4384 * The contents of CResult_NonePaymentSendFailureZ
4386 typedef union LDKCResult_NonePaymentSendFailureZPtr {
4388 * Note that this value is always NULL, as there are no contents in the OK variant
4392 * A pointer to the contents in the error state.
4393 * Reading from this pointer when `result_ok` is set is undefined.
4395 struct LDKPaymentSendFailure *err;
4396 } LDKCResult_NonePaymentSendFailureZPtr;
4399 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
4400 * containing a () on success and a crate::ln::channelmanager::PaymentSendFailure on failure.
4401 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4403 typedef struct LDKCResult_NonePaymentSendFailureZ {
4405 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
4406 * `err` or `result` depending on the state of `result_ok`.
4408 union LDKCResult_NonePaymentSendFailureZPtr contents;
4410 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
4413 } LDKCResult_NonePaymentSendFailureZ;
4416 * A dynamically-allocated array of crate::chain::channelmonitor::ChannelMonitors of arbitrary size.
4417 * This corresponds to std::vector in C++
4419 typedef struct LDKCVec_ChannelMonitorZ {
4421 * The elements in the array.
4422 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4424 struct LDKChannelMonitor *data;
4426 * The number of elements pointed to by `data`.
4429 } LDKCVec_ChannelMonitorZ;
4432 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
4433 * blocks are connected and disconnected.
4435 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
4436 * responsible for maintaining a set of monitors such that they can be updated accordingly as
4437 * channel state changes and HTLCs are resolved. See method documentation for specific
4440 * Implementations **must** ensure that updates are successfully applied and persisted upon method
4441 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
4442 * without taking any further action such as persisting the current state.
4444 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
4445 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
4446 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
4447 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
4448 * multiple instances.
4450 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
4451 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
4452 * [`PermanentFailure`]: channelmonitor::ChannelMonitorUpdateErr::PermanentFailure
4454 typedef struct LDKWatch {
4456 * An opaque pointer which is passed to your function implementations as an argument.
4457 * This has no meaning in the LDK, and can be NULL or any other value.
4461 * Watches a channel identified by `funding_txo` using `monitor`.
4463 * Implementations are responsible for watching the chain for the funding transaction along
4464 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
4465 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
4467 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
4468 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
4469 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
4471 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
4473 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
4475 * Implementations must call [`update_monitor`] with the given update. See
4476 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
4478 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
4479 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
4481 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
4483 * Returns any monitor events since the last call. Subsequent calls must only return new
4486 struct LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
4488 * Frees any resources associated with this object given its this_arg pointer.
4489 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4491 void (*free)(void *this_arg);
4495 * An interface to send a transaction to the Bitcoin network.
4497 typedef struct LDKBroadcasterInterface {
4499 * An opaque pointer which is passed to your function implementations as an argument.
4500 * This has no meaning in the LDK, and can be NULL or any other value.
4504 * Sends a transaction out to (hopefully) be mined.
4506 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
4508 * Frees any resources associated with this object given its this_arg pointer.
4509 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4511 void (*free)(void *this_arg);
4512 } LDKBroadcasterInterface;
4515 * The contents of CResult_SignDecodeErrorZ
4517 typedef union LDKCResult_SignDecodeErrorZPtr {
4519 * A pointer to the contents in the success state.
4520 * Reading from this pointer when `result_ok` is not set is undefined.
4522 struct LDKSign *result;
4524 * A pointer to the contents in the error state.
4525 * Reading from this pointer when `result_ok` is set is undefined.
4527 struct LDKDecodeError *err;
4528 } LDKCResult_SignDecodeErrorZPtr;
4531 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
4532 * containing a crate::chain::keysinterface::Sign on success and a crate::ln::msgs::DecodeError on failure.
4533 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4535 typedef struct LDKCResult_SignDecodeErrorZ {
4537 * The contents of this CResult_SignDecodeErrorZ, accessible via either
4538 * `err` or `result` depending on the state of `result_ok`.
4540 union LDKCResult_SignDecodeErrorZPtr contents;
4542 * Whether this CResult_SignDecodeErrorZ represents a success state.
4545 } LDKCResult_SignDecodeErrorZ;
4548 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
4549 * own the memory pointed to by data.
4551 typedef struct LDKu8slice {
4553 * A pointer to the byte buffer
4555 const uint8_t *data;
4557 * The number of bytes pointed to by `data`.
4563 * A trait to describe an object which can get user secrets and key material.
4565 typedef struct LDKKeysInterface {
4567 * An opaque pointer which is passed to your function implementations as an argument.
4568 * This has no meaning in the LDK, and can be NULL or any other value.
4572 * Get node secret key (aka node_id or network_key).
4574 * This method must return the same value each time it is called.
4576 struct LDKSecretKey (*get_node_secret)(const void *this_arg);
4578 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
4580 * This method should return a different value each time it is called, to avoid linking
4581 * on-chain funds across channels as controlled to the same user.
4583 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
4585 * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing
4588 * This method should return a different value each time it is called, to avoid linking
4589 * on-chain funds across channels as controlled to the same user.
4591 struct LDKPublicKey (*get_shutdown_pubkey)(const void *this_arg);
4593 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
4594 * restarted with some stale data!
4596 * This method must return a different value each time it is called.
4598 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
4600 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
4601 * onion packets and for temporary channel IDs. There is no requirement that these be
4602 * persisted anywhere, though they must be unique across restarts.
4604 * This method must return a different value each time it is called.
4606 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
4608 * Reads a `Signer` for this `KeysInterface` from the given input stream.
4609 * This is only called during deserialization of other objects which contain
4610 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
4611 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
4612 * contain no versioning scheme. You may wish to include your own version prefix and ensure
4613 * you've read all of the provided bytes to ensure no corruption occurred.
4615 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
4617 * Frees any resources associated with this object given its this_arg pointer.
4618 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4620 void (*free)(void *this_arg);
4624 * A trait which should be implemented to provide feerate information on a number of time
4627 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
4628 * called from inside the library in response to chain events, P2P events, or timer events).
4630 typedef struct LDKFeeEstimator {
4632 * An opaque pointer which is passed to your function implementations as an argument.
4633 * This has no meaning in the LDK, and can be NULL or any other value.
4637 * Gets estimated satoshis of fee required per 1000 Weight-Units.
4639 * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
4640 * don't put us below 1 satoshi-per-byte).
4642 * This translates to:
4643 * * satoshis-per-byte * 250
4644 * * ceil(satoshis-per-kbyte / 4)
4646 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
4648 * Frees any resources associated with this object given its this_arg pointer.
4649 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4651 void (*free)(void *this_arg);
4655 * A trait encapsulating the operations required of a logger
4657 typedef struct LDKLogger {
4659 * An opaque pointer which is passed to your function implementations as an argument.
4660 * This has no meaning in the LDK, and can be NULL or any other value.
4666 void (*log)(const void *this_arg, const char *record);
4668 * Frees any resources associated with this object given its this_arg pointer.
4669 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4671 void (*free)(void *this_arg);
4677 * Manager which keeps track of a number of channels and sends messages to the appropriate
4678 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
4680 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
4681 * to individual Channels.
4683 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
4684 * all peers during write/read (though does not modify this instance, only the instance being
4685 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
4686 * called funding_transaction_generated for outbound channels).
4688 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
4689 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
4690 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
4691 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
4692 * the serialization process). If the deserialized version is out-of-date compared to the
4693 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
4694 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
4696 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
4697 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
4698 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
4699 * block_connected() to step towards your best block) upon deserialization before using the
4702 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
4703 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
4704 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
4705 * offline for a full minute. In order to track this, you must call
4706 * timer_chan_freshness_every_min roughly once per minute, though it doesn't have to be perfect.
4708 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
4709 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
4710 * essentially you should default to using a SimpleRefChannelManager, and use a
4711 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
4712 * you're using lightning-net-tokio.
4714 typedef struct MUST_USE_STRUCT LDKChannelManager {
4716 * A pointer to the opaque Rust object.
4717 * Nearly everywhere, inner must be non-null, however in places where
4718 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4720 LDKnativeChannelManager *inner;
4722 * Indicates that this is the only struct which contains the same pointer.
4723 * Rust functions which take ownership of an object provided via an argument require
4724 * this to be true and invalidate the object pointed to by inner.
4727 } LDKChannelManager;
4730 * A tuple of 2 elements. See the individual fields for the types contained.
4732 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
4734 * The element at position 0
4736 struct LDKThirtyTwoBytes a;
4738 * The element at position 1
4740 struct LDKChannelManager b;
4741 } LDKC2Tuple_BlockHashChannelManagerZ;
4744 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
4746 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
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 LDKC2Tuple_BlockHashChannelManagerZ *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_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
4760 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
4761 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::ln::msgs::DecodeError on failure.
4762 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4764 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
4766 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
4767 * `err` or `result` depending on the state of `result_ok`.
4769 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
4771 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
4774 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
4777 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
4779 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
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 LDKSpendableOutputDescriptor *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_SpendableOutputDescriptorDecodeErrorZPtr;
4793 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
4794 * containing a crate::chain::keysinterface::SpendableOutputDescriptor on success and a crate::ln::msgs::DecodeError on failure.
4795 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4797 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
4799 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
4800 * `err` or `result` depending on the state of `result_ok`.
4802 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
4804 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
4807 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
4810 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
4811 * This corresponds to std::vector in C++
4813 typedef struct LDKCVec_CVec_u8ZZ {
4815 * The elements in the array.
4816 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4818 struct LDKCVec_u8Z *data;
4820 * The number of elements pointed to by `data`.
4823 } LDKCVec_CVec_u8ZZ;
4826 * The contents of CResult_CVec_CVec_u8ZZNoneZ
4828 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
4830 * A pointer to the contents in the success state.
4831 * Reading from this pointer when `result_ok` is not set is undefined.
4833 struct LDKCVec_CVec_u8ZZ *result;
4835 * Note that this value is always NULL, as there are no contents in the Err variant
4838 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
4841 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
4842 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
4843 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4845 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
4847 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
4848 * `err` or `result` depending on the state of `result_ok`.
4850 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
4852 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
4855 } LDKCResult_CVec_CVec_u8ZZNoneZ;
4860 * A simple implementation of Sign that just keeps the private keys in memory.
4862 * This implementation performs no policy checks and is insufficient by itself as
4863 * a secure external signer.
4865 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
4867 * A pointer to the opaque Rust object.
4868 * Nearly everywhere, inner must be non-null, however in places where
4869 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4871 LDKnativeInMemorySigner *inner;
4873 * Indicates that this is the only struct which contains the same pointer.
4874 * Rust functions which take ownership of an object provided via an argument require
4875 * this to be true and invalidate the object pointed to by inner.
4878 } LDKInMemorySigner;
4881 * The contents of CResult_InMemorySignerDecodeErrorZ
4883 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
4885 * A pointer to the contents in the success state.
4886 * Reading from this pointer when `result_ok` is not set is undefined.
4888 struct LDKInMemorySigner *result;
4890 * A pointer to the contents in the error state.
4891 * Reading from this pointer when `result_ok` is set is undefined.
4893 struct LDKDecodeError *err;
4894 } LDKCResult_InMemorySignerDecodeErrorZPtr;
4897 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
4898 * containing a crate::chain::keysinterface::InMemorySigner on success and a crate::ln::msgs::DecodeError on failure.
4899 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4901 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
4903 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
4904 * `err` or `result` depending on the state of `result_ok`.
4906 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
4908 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
4911 } LDKCResult_InMemorySignerDecodeErrorZ;
4914 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
4915 * This corresponds to std::vector in C++
4917 typedef struct LDKCVec_TxOutZ {
4919 * The elements in the array.
4920 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4922 struct LDKTxOut *data;
4924 * The number of elements pointed to by `data`.
4930 * The contents of CResult_TransactionNoneZ
4932 typedef union LDKCResult_TransactionNoneZPtr {
4934 * A pointer to the contents in the success state.
4935 * Reading from this pointer when `result_ok` is not set is undefined.
4937 struct LDKTransaction *result;
4939 * Note that this value is always NULL, as there are no contents in the Err variant
4942 } LDKCResult_TransactionNoneZPtr;
4945 * A CResult_TransactionNoneZ represents the result of a fallible operation,
4946 * containing a crate::c_types::Transaction on success and a () on failure.
4947 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4949 typedef struct LDKCResult_TransactionNoneZ {
4951 * The contents of this CResult_TransactionNoneZ, accessible via either
4952 * `err` or `result` depending on the state of `result_ok`.
4954 union LDKCResult_TransactionNoneZPtr contents;
4956 * Whether this CResult_TransactionNoneZ represents a success state.
4959 } LDKCResult_TransactionNoneZ;
4966 typedef struct MUST_USE_STRUCT LDKRouteHop {
4968 * A pointer to the opaque Rust object.
4969 * Nearly everywhere, inner must be non-null, however in places where
4970 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4972 LDKnativeRouteHop *inner;
4974 * Indicates that this is the only struct which contains the same pointer.
4975 * Rust functions which take ownership of an object provided via an argument require
4976 * this to be true and invalidate the object pointed to by inner.
4982 * A dynamically-allocated array of crate::routing::router::RouteHops of arbitrary size.
4983 * This corresponds to std::vector in C++
4985 typedef struct LDKCVec_RouteHopZ {
4987 * The elements in the array.
4988 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4990 struct LDKRouteHop *data;
4992 * The number of elements pointed to by `data`.
4995 } LDKCVec_RouteHopZ;
4998 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
4999 * This corresponds to std::vector in C++
5001 typedef struct LDKCVec_CVec_RouteHopZZ {
5003 * The elements in the array.
5004 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5006 struct LDKCVec_RouteHopZ *data;
5008 * The number of elements pointed to by `data`.
5011 } LDKCVec_CVec_RouteHopZZ;
5016 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
5017 * it can take multiple paths. Each path is composed of one or more hops through the network.
5019 typedef struct MUST_USE_STRUCT LDKRoute {
5021 * A pointer to the opaque Rust object.
5022 * Nearly everywhere, inner must be non-null, however in places where
5023 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5025 LDKnativeRoute *inner;
5027 * Indicates that this is the only struct which contains the same pointer.
5028 * Rust functions which take ownership of an object provided via an argument require
5029 * this to be true and invalidate the object pointed to by inner.
5035 * The contents of CResult_RouteDecodeErrorZ
5037 typedef union LDKCResult_RouteDecodeErrorZPtr {
5039 * A pointer to the contents in the success state.
5040 * Reading from this pointer when `result_ok` is not set is undefined.
5042 struct LDKRoute *result;
5044 * A pointer to the contents in the error state.
5045 * Reading from this pointer when `result_ok` is set is undefined.
5047 struct LDKDecodeError *err;
5048 } LDKCResult_RouteDecodeErrorZPtr;
5051 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
5052 * containing a crate::routing::router::Route on success and a crate::ln::msgs::DecodeError on failure.
5053 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5055 typedef struct LDKCResult_RouteDecodeErrorZ {
5057 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
5058 * `err` or `result` depending on the state of `result_ok`.
5060 union LDKCResult_RouteDecodeErrorZPtr contents;
5062 * Whether this CResult_RouteDecodeErrorZ represents a success state.
5065 } LDKCResult_RouteDecodeErrorZ;
5070 * A channel descriptor which provides a last-hop route to get_route
5072 typedef struct MUST_USE_STRUCT LDKRouteHint {
5074 * A pointer to the opaque Rust object.
5075 * Nearly everywhere, inner must be non-null, however in places where
5076 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5078 LDKnativeRouteHint *inner;
5080 * Indicates that this is the only struct which contains the same pointer.
5081 * Rust functions which take ownership of an object provided via an argument require
5082 * this to be true and invalidate the object pointed to by inner.
5088 * A dynamically-allocated array of crate::routing::router::RouteHints of arbitrary size.
5089 * This corresponds to std::vector in C++
5091 typedef struct LDKCVec_RouteHintZ {
5093 * The elements in the array.
5094 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5096 struct LDKRouteHint *data;
5098 * The number of elements pointed to by `data`.
5101 } LDKCVec_RouteHintZ;
5104 * The contents of CResult_RouteLightningErrorZ
5106 typedef union LDKCResult_RouteLightningErrorZPtr {
5108 * A pointer to the contents in the success state.
5109 * Reading from this pointer when `result_ok` is not set is undefined.
5111 struct LDKRoute *result;
5113 * A pointer to the contents in the error state.
5114 * Reading from this pointer when `result_ok` is set is undefined.
5116 struct LDKLightningError *err;
5117 } LDKCResult_RouteLightningErrorZPtr;
5120 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
5121 * containing a crate::routing::router::Route on success and a crate::ln::msgs::LightningError on failure.
5122 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5124 typedef struct LDKCResult_RouteLightningErrorZ {
5126 * The contents of this CResult_RouteLightningErrorZ, accessible via either
5127 * `err` or `result` depending on the state of `result_ok`.
5129 union LDKCResult_RouteLightningErrorZPtr contents;
5131 * Whether this CResult_RouteLightningErrorZ represents a success state.
5134 } LDKCResult_RouteLightningErrorZ;
5137 * The contents of CResult_NetAddressu8Z
5139 typedef union LDKCResult_NetAddressu8ZPtr {
5141 * A pointer to the contents in the success state.
5142 * Reading from this pointer when `result_ok` is not set is undefined.
5144 struct LDKNetAddress *result;
5146 * A pointer to the contents in the error state.
5147 * Reading from this pointer when `result_ok` is set is undefined.
5150 } LDKCResult_NetAddressu8ZPtr;
5153 * A CResult_NetAddressu8Z represents the result of a fallible operation,
5154 * containing a crate::ln::msgs::NetAddress on success and a u8 on failure.
5155 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5157 typedef struct LDKCResult_NetAddressu8Z {
5159 * The contents of this CResult_NetAddressu8Z, accessible via either
5160 * `err` or `result` depending on the state of `result_ok`.
5162 union LDKCResult_NetAddressu8ZPtr contents;
5164 * Whether this CResult_NetAddressu8Z represents a success state.
5167 } LDKCResult_NetAddressu8Z;
5170 * The contents of CResult_CResult_NetAddressu8ZDecodeErrorZ
5172 typedef union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr {
5174 * A pointer to the contents in the success state.
5175 * Reading from this pointer when `result_ok` is not set is undefined.
5177 struct LDKCResult_NetAddressu8Z *result;
5179 * A pointer to the contents in the error state.
5180 * Reading from this pointer when `result_ok` is set is undefined.
5182 struct LDKDecodeError *err;
5183 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr;
5186 * A CResult_CResult_NetAddressu8ZDecodeErrorZ represents the result of a fallible operation,
5187 * containing a crate::c_types::derived::CResult_NetAddressu8Z on success and a crate::ln::msgs::DecodeError on failure.
5188 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5190 typedef struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ {
5192 * The contents of this CResult_CResult_NetAddressu8ZDecodeErrorZ, accessible via either
5193 * `err` or `result` depending on the state of `result_ok`.
5195 union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr contents;
5197 * Whether this CResult_CResult_NetAddressu8ZDecodeErrorZ represents a success state.
5200 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZ;
5205 * An update_add_htlc message to be sent or received from a peer
5207 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
5209 * A pointer to the opaque Rust object.
5210 * Nearly everywhere, inner must be non-null, however in places where
5211 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5213 LDKnativeUpdateAddHTLC *inner;
5215 * Indicates that this is the only struct which contains the same pointer.
5216 * Rust functions which take ownership of an object provided via an argument require
5217 * this to be true and invalidate the object pointed to by inner.
5223 * A dynamically-allocated array of crate::ln::msgs::UpdateAddHTLCs of arbitrary size.
5224 * This corresponds to std::vector in C++
5226 typedef struct LDKCVec_UpdateAddHTLCZ {
5228 * The elements in the array.
5229 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5231 struct LDKUpdateAddHTLC *data;
5233 * The number of elements pointed to by `data`.
5236 } LDKCVec_UpdateAddHTLCZ;
5241 * An update_fulfill_htlc message to be sent or received from a peer
5243 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
5245 * A pointer to the opaque Rust object.
5246 * Nearly everywhere, inner must be non-null, however in places where
5247 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5249 LDKnativeUpdateFulfillHTLC *inner;
5251 * Indicates that this is the only struct which contains the same pointer.
5252 * Rust functions which take ownership of an object provided via an argument require
5253 * this to be true and invalidate the object pointed to by inner.
5256 } LDKUpdateFulfillHTLC;
5259 * A dynamically-allocated array of crate::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
5260 * This corresponds to std::vector in C++
5262 typedef struct LDKCVec_UpdateFulfillHTLCZ {
5264 * The elements in the array.
5265 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5267 struct LDKUpdateFulfillHTLC *data;
5269 * The number of elements pointed to by `data`.
5272 } LDKCVec_UpdateFulfillHTLCZ;
5277 * An update_fail_htlc message to be sent or received from a peer
5279 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
5281 * A pointer to the opaque Rust object.
5282 * Nearly everywhere, inner must be non-null, however in places where
5283 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5285 LDKnativeUpdateFailHTLC *inner;
5287 * Indicates that this is the only struct which contains the same pointer.
5288 * Rust functions which take ownership of an object provided via an argument require
5289 * this to be true and invalidate the object pointed to by inner.
5292 } LDKUpdateFailHTLC;
5295 * A dynamically-allocated array of crate::ln::msgs::UpdateFailHTLCs of arbitrary size.
5296 * This corresponds to std::vector in C++
5298 typedef struct LDKCVec_UpdateFailHTLCZ {
5300 * The elements in the array.
5301 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5303 struct LDKUpdateFailHTLC *data;
5305 * The number of elements pointed to by `data`.
5308 } LDKCVec_UpdateFailHTLCZ;
5313 * An update_fail_malformed_htlc message to be sent or received from a peer
5315 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
5317 * A pointer to the opaque Rust object.
5318 * Nearly everywhere, inner must be non-null, however in places where
5319 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5321 LDKnativeUpdateFailMalformedHTLC *inner;
5323 * Indicates that this is the only struct which contains the same pointer.
5324 * Rust functions which take ownership of an object provided via an argument require
5325 * this to be true and invalidate the object pointed to by inner.
5328 } LDKUpdateFailMalformedHTLC;
5331 * A dynamically-allocated array of crate::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
5332 * This corresponds to std::vector in C++
5334 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
5336 * The elements in the array.
5337 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5339 struct LDKUpdateFailMalformedHTLC *data;
5341 * The number of elements pointed to by `data`.
5344 } LDKCVec_UpdateFailMalformedHTLCZ;
5347 * The contents of CResult_AcceptChannelDecodeErrorZ
5349 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
5351 * A pointer to the contents in the success state.
5352 * Reading from this pointer when `result_ok` is not set is undefined.
5354 struct LDKAcceptChannel *result;
5356 * A pointer to the contents in the error state.
5357 * Reading from this pointer when `result_ok` is set is undefined.
5359 struct LDKDecodeError *err;
5360 } LDKCResult_AcceptChannelDecodeErrorZPtr;
5363 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
5364 * containing a crate::ln::msgs::AcceptChannel on success and a crate::ln::msgs::DecodeError on failure.
5365 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5367 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
5369 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
5370 * `err` or `result` depending on the state of `result_ok`.
5372 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
5374 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
5377 } LDKCResult_AcceptChannelDecodeErrorZ;
5380 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
5382 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
5384 * A pointer to the contents in the success state.
5385 * Reading from this pointer when `result_ok` is not set is undefined.
5387 struct LDKAnnouncementSignatures *result;
5389 * A pointer to the contents in the error state.
5390 * Reading from this pointer when `result_ok` is set is undefined.
5392 struct LDKDecodeError *err;
5393 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
5396 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
5397 * containing a crate::ln::msgs::AnnouncementSignatures on success and a crate::ln::msgs::DecodeError on failure.
5398 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5400 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
5402 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
5403 * `err` or `result` depending on the state of `result_ok`.
5405 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
5407 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
5410 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
5413 * The contents of CResult_ChannelReestablishDecodeErrorZ
5415 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
5417 * A pointer to the contents in the success state.
5418 * Reading from this pointer when `result_ok` is not set is undefined.
5420 struct LDKChannelReestablish *result;
5422 * A pointer to the contents in the error state.
5423 * Reading from this pointer when `result_ok` is set is undefined.
5425 struct LDKDecodeError *err;
5426 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
5429 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
5430 * containing a crate::ln::msgs::ChannelReestablish on success and a crate::ln::msgs::DecodeError on failure.
5431 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5433 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
5435 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
5436 * `err` or `result` depending on the state of `result_ok`.
5438 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
5440 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
5443 } LDKCResult_ChannelReestablishDecodeErrorZ;
5446 * The contents of CResult_ClosingSignedDecodeErrorZ
5448 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
5450 * A pointer to the contents in the success state.
5451 * Reading from this pointer when `result_ok` is not set is undefined.
5453 struct LDKClosingSigned *result;
5455 * A pointer to the contents in the error state.
5456 * Reading from this pointer when `result_ok` is set is undefined.
5458 struct LDKDecodeError *err;
5459 } LDKCResult_ClosingSignedDecodeErrorZPtr;
5462 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
5463 * containing a crate::ln::msgs::ClosingSigned on success and a crate::ln::msgs::DecodeError on failure.
5464 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5466 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
5468 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
5469 * `err` or `result` depending on the state of `result_ok`.
5471 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
5473 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
5476 } LDKCResult_ClosingSignedDecodeErrorZ;
5481 * A commitment_signed message to be sent or received from a peer
5483 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
5485 * A pointer to the opaque Rust object.
5486 * Nearly everywhere, inner must be non-null, however in places where
5487 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5489 LDKnativeCommitmentSigned *inner;
5491 * Indicates that this is the only struct which contains the same pointer.
5492 * Rust functions which take ownership of an object provided via an argument require
5493 * this to be true and invalidate the object pointed to by inner.
5496 } LDKCommitmentSigned;
5499 * The contents of CResult_CommitmentSignedDecodeErrorZ
5501 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
5503 * A pointer to the contents in the success state.
5504 * Reading from this pointer when `result_ok` is not set is undefined.
5506 struct LDKCommitmentSigned *result;
5508 * A pointer to the contents in the error state.
5509 * Reading from this pointer when `result_ok` is set is undefined.
5511 struct LDKDecodeError *err;
5512 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
5515 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
5516 * containing a crate::ln::msgs::CommitmentSigned on success and a crate::ln::msgs::DecodeError on failure.
5517 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5519 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
5521 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
5522 * `err` or `result` depending on the state of `result_ok`.
5524 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
5526 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
5529 } LDKCResult_CommitmentSignedDecodeErrorZ;
5532 * The contents of CResult_FundingCreatedDecodeErrorZ
5534 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
5536 * A pointer to the contents in the success state.
5537 * Reading from this pointer when `result_ok` is not set is undefined.
5539 struct LDKFundingCreated *result;
5541 * A pointer to the contents in the error state.
5542 * Reading from this pointer when `result_ok` is set is undefined.
5544 struct LDKDecodeError *err;
5545 } LDKCResult_FundingCreatedDecodeErrorZPtr;
5548 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
5549 * containing a crate::ln::msgs::FundingCreated on success and a crate::ln::msgs::DecodeError on failure.
5550 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5552 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
5554 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
5555 * `err` or `result` depending on the state of `result_ok`.
5557 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
5559 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
5562 } LDKCResult_FundingCreatedDecodeErrorZ;
5565 * The contents of CResult_FundingSignedDecodeErrorZ
5567 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
5569 * A pointer to the contents in the success state.
5570 * Reading from this pointer when `result_ok` is not set is undefined.
5572 struct LDKFundingSigned *result;
5574 * A pointer to the contents in the error state.
5575 * Reading from this pointer when `result_ok` is set is undefined.
5577 struct LDKDecodeError *err;
5578 } LDKCResult_FundingSignedDecodeErrorZPtr;
5581 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
5582 * containing a crate::ln::msgs::FundingSigned on success and a crate::ln::msgs::DecodeError on failure.
5583 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5585 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
5587 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
5588 * `err` or `result` depending on the state of `result_ok`.
5590 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
5592 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
5595 } LDKCResult_FundingSignedDecodeErrorZ;
5598 * The contents of CResult_FundingLockedDecodeErrorZ
5600 typedef union LDKCResult_FundingLockedDecodeErrorZPtr {
5602 * A pointer to the contents in the success state.
5603 * Reading from this pointer when `result_ok` is not set is undefined.
5605 struct LDKFundingLocked *result;
5607 * A pointer to the contents in the error state.
5608 * Reading from this pointer when `result_ok` is set is undefined.
5610 struct LDKDecodeError *err;
5611 } LDKCResult_FundingLockedDecodeErrorZPtr;
5614 * A CResult_FundingLockedDecodeErrorZ represents the result of a fallible operation,
5615 * containing a crate::ln::msgs::FundingLocked on success and a crate::ln::msgs::DecodeError on failure.
5616 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5618 typedef struct LDKCResult_FundingLockedDecodeErrorZ {
5620 * The contents of this CResult_FundingLockedDecodeErrorZ, accessible via either
5621 * `err` or `result` depending on the state of `result_ok`.
5623 union LDKCResult_FundingLockedDecodeErrorZPtr contents;
5625 * Whether this CResult_FundingLockedDecodeErrorZ represents a success state.
5628 } LDKCResult_FundingLockedDecodeErrorZ;
5633 * An init message to be sent or received from a peer
5635 typedef struct MUST_USE_STRUCT LDKInit {
5637 * A pointer to the opaque Rust object.
5638 * Nearly everywhere, inner must be non-null, however in places where
5639 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5641 LDKnativeInit *inner;
5643 * Indicates that this is the only struct which contains the same pointer.
5644 * Rust functions which take ownership of an object provided via an argument require
5645 * this to be true and invalidate the object pointed to by inner.
5651 * The contents of CResult_InitDecodeErrorZ
5653 typedef union LDKCResult_InitDecodeErrorZPtr {
5655 * A pointer to the contents in the success state.
5656 * Reading from this pointer when `result_ok` is not set is undefined.
5658 struct LDKInit *result;
5660 * A pointer to the contents in the error state.
5661 * Reading from this pointer when `result_ok` is set is undefined.
5663 struct LDKDecodeError *err;
5664 } LDKCResult_InitDecodeErrorZPtr;
5667 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
5668 * containing a crate::ln::msgs::Init on success and a crate::ln::msgs::DecodeError on failure.
5669 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5671 typedef struct LDKCResult_InitDecodeErrorZ {
5673 * The contents of this CResult_InitDecodeErrorZ, accessible via either
5674 * `err` or `result` depending on the state of `result_ok`.
5676 union LDKCResult_InitDecodeErrorZPtr contents;
5678 * Whether this CResult_InitDecodeErrorZ represents a success state.
5681 } LDKCResult_InitDecodeErrorZ;
5684 * The contents of CResult_OpenChannelDecodeErrorZ
5686 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
5688 * A pointer to the contents in the success state.
5689 * Reading from this pointer when `result_ok` is not set is undefined.
5691 struct LDKOpenChannel *result;
5693 * A pointer to the contents in the error state.
5694 * Reading from this pointer when `result_ok` is set is undefined.
5696 struct LDKDecodeError *err;
5697 } LDKCResult_OpenChannelDecodeErrorZPtr;
5700 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
5701 * containing a crate::ln::msgs::OpenChannel on success and a crate::ln::msgs::DecodeError on failure.
5702 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5704 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
5706 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
5707 * `err` or `result` depending on the state of `result_ok`.
5709 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
5711 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
5714 } LDKCResult_OpenChannelDecodeErrorZ;
5717 * The contents of CResult_RevokeAndACKDecodeErrorZ
5719 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
5721 * A pointer to the contents in the success state.
5722 * Reading from this pointer when `result_ok` is not set is undefined.
5724 struct LDKRevokeAndACK *result;
5726 * A pointer to the contents in the error state.
5727 * Reading from this pointer when `result_ok` is set is undefined.
5729 struct LDKDecodeError *err;
5730 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
5733 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
5734 * containing a crate::ln::msgs::RevokeAndACK on success and a crate::ln::msgs::DecodeError on failure.
5735 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5737 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
5739 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
5740 * `err` or `result` depending on the state of `result_ok`.
5742 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
5744 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
5747 } LDKCResult_RevokeAndACKDecodeErrorZ;
5750 * The contents of CResult_ShutdownDecodeErrorZ
5752 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
5754 * A pointer to the contents in the success state.
5755 * Reading from this pointer when `result_ok` is not set is undefined.
5757 struct LDKShutdown *result;
5759 * A pointer to the contents in the error state.
5760 * Reading from this pointer when `result_ok` is set is undefined.
5762 struct LDKDecodeError *err;
5763 } LDKCResult_ShutdownDecodeErrorZPtr;
5766 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
5767 * containing a crate::ln::msgs::Shutdown on success and a crate::ln::msgs::DecodeError on failure.
5768 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5770 typedef struct LDKCResult_ShutdownDecodeErrorZ {
5772 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
5773 * `err` or `result` depending on the state of `result_ok`.
5775 union LDKCResult_ShutdownDecodeErrorZPtr contents;
5777 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
5780 } LDKCResult_ShutdownDecodeErrorZ;
5783 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
5785 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
5787 * A pointer to the contents in the success state.
5788 * Reading from this pointer when `result_ok` is not set is undefined.
5790 struct LDKUpdateFailHTLC *result;
5792 * A pointer to the contents in the error state.
5793 * Reading from this pointer when `result_ok` is set is undefined.
5795 struct LDKDecodeError *err;
5796 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
5799 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
5800 * containing a crate::ln::msgs::UpdateFailHTLC on success and a crate::ln::msgs::DecodeError on failure.
5801 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5803 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
5805 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
5806 * `err` or `result` depending on the state of `result_ok`.
5808 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
5810 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
5813 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
5816 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
5818 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
5820 * A pointer to the contents in the success state.
5821 * Reading from this pointer when `result_ok` is not set is undefined.
5823 struct LDKUpdateFailMalformedHTLC *result;
5825 * A pointer to the contents in the error state.
5826 * Reading from this pointer when `result_ok` is set is undefined.
5828 struct LDKDecodeError *err;
5829 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
5832 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
5833 * containing a crate::ln::msgs::UpdateFailMalformedHTLC on success and a crate::ln::msgs::DecodeError on failure.
5834 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5836 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
5838 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
5839 * `err` or `result` depending on the state of `result_ok`.
5841 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
5843 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
5846 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
5851 * An update_fee message to be sent or received from a peer
5853 typedef struct MUST_USE_STRUCT LDKUpdateFee {
5855 * A pointer to the opaque Rust object.
5856 * Nearly everywhere, inner must be non-null, however in places where
5857 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5859 LDKnativeUpdateFee *inner;
5861 * Indicates that this is the only struct which contains the same pointer.
5862 * Rust functions which take ownership of an object provided via an argument require
5863 * this to be true and invalidate the object pointed to by inner.
5869 * The contents of CResult_UpdateFeeDecodeErrorZ
5871 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
5873 * A pointer to the contents in the success state.
5874 * Reading from this pointer when `result_ok` is not set is undefined.
5876 struct LDKUpdateFee *result;
5878 * A pointer to the contents in the error state.
5879 * Reading from this pointer when `result_ok` is set is undefined.
5881 struct LDKDecodeError *err;
5882 } LDKCResult_UpdateFeeDecodeErrorZPtr;
5885 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
5886 * containing a crate::ln::msgs::UpdateFee on success and a crate::ln::msgs::DecodeError on failure.
5887 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5889 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
5891 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
5892 * `err` or `result` depending on the state of `result_ok`.
5894 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
5896 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
5899 } LDKCResult_UpdateFeeDecodeErrorZ;
5902 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
5904 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
5906 * A pointer to the contents in the success state.
5907 * Reading from this pointer when `result_ok` is not set is undefined.
5909 struct LDKUpdateFulfillHTLC *result;
5911 * A pointer to the contents in the error state.
5912 * Reading from this pointer when `result_ok` is set is undefined.
5914 struct LDKDecodeError *err;
5915 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
5918 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
5919 * containing a crate::ln::msgs::UpdateFulfillHTLC on success and a crate::ln::msgs::DecodeError on failure.
5920 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5922 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
5924 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
5925 * `err` or `result` depending on the state of `result_ok`.
5927 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
5929 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
5932 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
5935 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
5937 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
5939 * A pointer to the contents in the success state.
5940 * Reading from this pointer when `result_ok` is not set is undefined.
5942 struct LDKUpdateAddHTLC *result;
5944 * A pointer to the contents in the error state.
5945 * Reading from this pointer when `result_ok` is set is undefined.
5947 struct LDKDecodeError *err;
5948 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
5951 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
5952 * containing a crate::ln::msgs::UpdateAddHTLC on success and a crate::ln::msgs::DecodeError on failure.
5953 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5955 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
5957 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
5958 * `err` or `result` depending on the state of `result_ok`.
5960 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
5962 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
5965 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
5970 * A ping message to be sent or received from a peer
5972 typedef struct MUST_USE_STRUCT LDKPing {
5974 * A pointer to the opaque Rust object.
5975 * Nearly everywhere, inner must be non-null, however in places where
5976 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5978 LDKnativePing *inner;
5980 * Indicates that this is the only struct which contains the same pointer.
5981 * Rust functions which take ownership of an object provided via an argument require
5982 * this to be true and invalidate the object pointed to by inner.
5988 * The contents of CResult_PingDecodeErrorZ
5990 typedef union LDKCResult_PingDecodeErrorZPtr {
5992 * A pointer to the contents in the success state.
5993 * Reading from this pointer when `result_ok` is not set is undefined.
5995 struct LDKPing *result;
5997 * A pointer to the contents in the error state.
5998 * Reading from this pointer when `result_ok` is set is undefined.
6000 struct LDKDecodeError *err;
6001 } LDKCResult_PingDecodeErrorZPtr;
6004 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
6005 * containing a crate::ln::msgs::Ping on success and a crate::ln::msgs::DecodeError on failure.
6006 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6008 typedef struct LDKCResult_PingDecodeErrorZ {
6010 * The contents of this CResult_PingDecodeErrorZ, accessible via either
6011 * `err` or `result` depending on the state of `result_ok`.
6013 union LDKCResult_PingDecodeErrorZPtr contents;
6015 * Whether this CResult_PingDecodeErrorZ represents a success state.
6018 } LDKCResult_PingDecodeErrorZ;
6023 * A pong message to be sent or received from a peer
6025 typedef struct MUST_USE_STRUCT LDKPong {
6027 * A pointer to the opaque Rust object.
6028 * Nearly everywhere, inner must be non-null, however in places where
6029 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6031 LDKnativePong *inner;
6033 * Indicates that this is the only struct which contains the same pointer.
6034 * Rust functions which take ownership of an object provided via an argument require
6035 * this to be true and invalidate the object pointed to by inner.
6041 * The contents of CResult_PongDecodeErrorZ
6043 typedef union LDKCResult_PongDecodeErrorZPtr {
6045 * A pointer to the contents in the success state.
6046 * Reading from this pointer when `result_ok` is not set is undefined.
6048 struct LDKPong *result;
6050 * A pointer to the contents in the error state.
6051 * Reading from this pointer when `result_ok` is set is undefined.
6053 struct LDKDecodeError *err;
6054 } LDKCResult_PongDecodeErrorZPtr;
6057 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
6058 * containing a crate::ln::msgs::Pong on success and a crate::ln::msgs::DecodeError on failure.
6059 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6061 typedef struct LDKCResult_PongDecodeErrorZ {
6063 * The contents of this CResult_PongDecodeErrorZ, accessible via either
6064 * `err` or `result` depending on the state of `result_ok`.
6066 union LDKCResult_PongDecodeErrorZPtr contents;
6068 * Whether this CResult_PongDecodeErrorZ represents a success state.
6071 } LDKCResult_PongDecodeErrorZ;
6074 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
6076 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
6078 * A pointer to the contents in the success state.
6079 * Reading from this pointer when `result_ok` is not set is undefined.
6081 struct LDKUnsignedChannelAnnouncement *result;
6083 * A pointer to the contents in the error state.
6084 * Reading from this pointer when `result_ok` is set is undefined.
6086 struct LDKDecodeError *err;
6087 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
6090 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
6091 * containing a crate::ln::msgs::UnsignedChannelAnnouncement on success and a crate::ln::msgs::DecodeError on failure.
6092 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6094 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
6096 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
6097 * `err` or `result` depending on the state of `result_ok`.
6099 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
6101 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
6104 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
6107 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
6109 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
6111 * A pointer to the contents in the success state.
6112 * Reading from this pointer when `result_ok` is not set is undefined.
6114 struct LDKChannelAnnouncement *result;
6116 * A pointer to the contents in the error state.
6117 * Reading from this pointer when `result_ok` is set is undefined.
6119 struct LDKDecodeError *err;
6120 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
6123 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
6124 * containing a crate::ln::msgs::ChannelAnnouncement on success and a crate::ln::msgs::DecodeError on failure.
6125 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6127 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
6129 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
6130 * `err` or `result` depending on the state of `result_ok`.
6132 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
6134 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
6137 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
6142 * The unsigned part of a channel_update
6144 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
6146 * A pointer to the opaque Rust object.
6147 * Nearly everywhere, inner must be non-null, however in places where
6148 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6150 LDKnativeUnsignedChannelUpdate *inner;
6152 * Indicates that this is the only struct which contains the same pointer.
6153 * Rust functions which take ownership of an object provided via an argument require
6154 * this to be true and invalidate the object pointed to by inner.
6157 } LDKUnsignedChannelUpdate;
6160 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
6162 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
6164 * A pointer to the contents in the success state.
6165 * Reading from this pointer when `result_ok` is not set is undefined.
6167 struct LDKUnsignedChannelUpdate *result;
6169 * A pointer to the contents in the error state.
6170 * Reading from this pointer when `result_ok` is set is undefined.
6172 struct LDKDecodeError *err;
6173 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
6176 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
6177 * containing a crate::ln::msgs::UnsignedChannelUpdate on success and a crate::ln::msgs::DecodeError on failure.
6178 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6180 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
6182 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
6183 * `err` or `result` depending on the state of `result_ok`.
6185 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
6187 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
6190 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
6193 * The contents of CResult_ChannelUpdateDecodeErrorZ
6195 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
6197 * A pointer to the contents in the success state.
6198 * Reading from this pointer when `result_ok` is not set is undefined.
6200 struct LDKChannelUpdate *result;
6202 * A pointer to the contents in the error state.
6203 * Reading from this pointer when `result_ok` is set is undefined.
6205 struct LDKDecodeError *err;
6206 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
6209 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
6210 * containing a crate::ln::msgs::ChannelUpdate on success and a crate::ln::msgs::DecodeError on failure.
6211 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6213 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
6215 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
6216 * `err` or `result` depending on the state of `result_ok`.
6218 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
6220 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
6223 } LDKCResult_ChannelUpdateDecodeErrorZ;
6226 * The contents of CResult_ErrorMessageDecodeErrorZ
6228 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
6230 * A pointer to the contents in the success state.
6231 * Reading from this pointer when `result_ok` is not set is undefined.
6233 struct LDKErrorMessage *result;
6235 * A pointer to the contents in the error state.
6236 * Reading from this pointer when `result_ok` is set is undefined.
6238 struct LDKDecodeError *err;
6239 } LDKCResult_ErrorMessageDecodeErrorZPtr;
6242 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
6243 * containing a crate::ln::msgs::ErrorMessage on success and a crate::ln::msgs::DecodeError on failure.
6244 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6246 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
6248 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
6249 * `err` or `result` depending on the state of `result_ok`.
6251 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
6253 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
6256 } LDKCResult_ErrorMessageDecodeErrorZ;
6261 * The unsigned part of a node_announcement
6263 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
6265 * A pointer to the opaque Rust object.
6266 * Nearly everywhere, inner must be non-null, however in places where
6267 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6269 LDKnativeUnsignedNodeAnnouncement *inner;
6271 * Indicates that this is the only struct which contains the same pointer.
6272 * Rust functions which take ownership of an object provided via an argument require
6273 * this to be true and invalidate the object pointed to by inner.
6276 } LDKUnsignedNodeAnnouncement;
6279 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
6281 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
6283 * A pointer to the contents in the success state.
6284 * Reading from this pointer when `result_ok` is not set is undefined.
6286 struct LDKUnsignedNodeAnnouncement *result;
6288 * A pointer to the contents in the error state.
6289 * Reading from this pointer when `result_ok` is set is undefined.
6291 struct LDKDecodeError *err;
6292 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
6295 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
6296 * containing a crate::ln::msgs::UnsignedNodeAnnouncement on success and a crate::ln::msgs::DecodeError on failure.
6297 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6299 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
6301 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
6302 * `err` or `result` depending on the state of `result_ok`.
6304 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
6306 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
6309 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
6312 * The contents of CResult_NodeAnnouncementDecodeErrorZ
6314 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
6316 * A pointer to the contents in the success state.
6317 * Reading from this pointer when `result_ok` is not set is undefined.
6319 struct LDKNodeAnnouncement *result;
6321 * A pointer to the contents in the error state.
6322 * Reading from this pointer when `result_ok` is set is undefined.
6324 struct LDKDecodeError *err;
6325 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
6328 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
6329 * containing a crate::ln::msgs::NodeAnnouncement on success and a crate::ln::msgs::DecodeError on failure.
6330 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6332 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
6334 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
6335 * `err` or `result` depending on the state of `result_ok`.
6337 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
6339 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
6342 } LDKCResult_NodeAnnouncementDecodeErrorZ;
6345 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
6347 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
6349 * A pointer to the contents in the success state.
6350 * Reading from this pointer when `result_ok` is not set is undefined.
6352 struct LDKQueryShortChannelIds *result;
6354 * A pointer to the contents in the error state.
6355 * Reading from this pointer when `result_ok` is set is undefined.
6357 struct LDKDecodeError *err;
6358 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
6361 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
6362 * containing a crate::ln::msgs::QueryShortChannelIds on success and a crate::ln::msgs::DecodeError on failure.
6363 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6365 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
6367 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
6368 * `err` or `result` depending on the state of `result_ok`.
6370 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
6372 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
6375 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
6380 * A reply_short_channel_ids_end message is sent as a reply to a
6381 * query_short_channel_ids message. The query recipient makes a best
6382 * effort to respond based on their local network view which may not be
6383 * a perfect view of the network.
6385 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
6387 * A pointer to the opaque Rust object.
6388 * Nearly everywhere, inner must be non-null, however in places where
6389 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6391 LDKnativeReplyShortChannelIdsEnd *inner;
6393 * Indicates that this is the only struct which contains the same pointer.
6394 * Rust functions which take ownership of an object provided via an argument require
6395 * this to be true and invalidate the object pointed to by inner.
6398 } LDKReplyShortChannelIdsEnd;
6401 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
6403 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
6405 * A pointer to the contents in the success state.
6406 * Reading from this pointer when `result_ok` is not set is undefined.
6408 struct LDKReplyShortChannelIdsEnd *result;
6410 * A pointer to the contents in the error state.
6411 * Reading from this pointer when `result_ok` is set is undefined.
6413 struct LDKDecodeError *err;
6414 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
6417 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
6418 * containing a crate::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::ln::msgs::DecodeError on failure.
6419 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6421 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
6423 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
6424 * `err` or `result` depending on the state of `result_ok`.
6426 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
6428 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
6431 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
6434 * The contents of CResult_QueryChannelRangeDecodeErrorZ
6436 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
6438 * A pointer to the contents in the success state.
6439 * Reading from this pointer when `result_ok` is not set is undefined.
6441 struct LDKQueryChannelRange *result;
6443 * A pointer to the contents in the error state.
6444 * Reading from this pointer when `result_ok` is set is undefined.
6446 struct LDKDecodeError *err;
6447 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
6450 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
6451 * containing a crate::ln::msgs::QueryChannelRange on success and a crate::ln::msgs::DecodeError on failure.
6452 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6454 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
6456 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
6457 * `err` or `result` depending on the state of `result_ok`.
6459 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
6461 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
6464 } LDKCResult_QueryChannelRangeDecodeErrorZ;
6467 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
6469 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
6471 * A pointer to the contents in the success state.
6472 * Reading from this pointer when `result_ok` is not set is undefined.
6474 struct LDKReplyChannelRange *result;
6476 * A pointer to the contents in the error state.
6477 * Reading from this pointer when `result_ok` is set is undefined.
6479 struct LDKDecodeError *err;
6480 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
6483 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
6484 * containing a crate::ln::msgs::ReplyChannelRange on success and a crate::ln::msgs::DecodeError on failure.
6485 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6487 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
6489 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
6490 * `err` or `result` depending on the state of `result_ok`.
6492 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
6494 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
6497 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
6502 * A gossip_timestamp_filter message is used by a node to request
6503 * gossip relay for messages in the requested time range when the
6504 * gossip_queries feature has been negotiated.
6506 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
6508 * A pointer to the opaque Rust object.
6509 * Nearly everywhere, inner must be non-null, however in places where
6510 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6512 LDKnativeGossipTimestampFilter *inner;
6514 * Indicates that this is the only struct which contains the same pointer.
6515 * Rust functions which take ownership of an object provided via an argument require
6516 * this to be true and invalidate the object pointed to by inner.
6519 } LDKGossipTimestampFilter;
6522 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
6524 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
6526 * A pointer to the contents in the success state.
6527 * Reading from this pointer when `result_ok` is not set is undefined.
6529 struct LDKGossipTimestampFilter *result;
6531 * A pointer to the contents in the error state.
6532 * Reading from this pointer when `result_ok` is set is undefined.
6534 struct LDKDecodeError *err;
6535 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
6538 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
6539 * containing a crate::ln::msgs::GossipTimestampFilter on success and a crate::ln::msgs::DecodeError on failure.
6540 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6542 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
6544 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
6545 * `err` or `result` depending on the state of `result_ok`.
6547 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
6549 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
6552 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
6555 * A trait indicating an object may generate message send events
6557 typedef struct LDKMessageSendEventsProvider {
6559 * An opaque pointer which is passed to your function implementations as an argument.
6560 * This has no meaning in the LDK, and can be NULL or any other value.
6564 * Gets the list of pending events which were generated by previous actions, clearing the list
6567 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
6569 * Frees any resources associated with this object given its this_arg pointer.
6570 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6572 void (*free)(void *this_arg);
6573 } LDKMessageSendEventsProvider;
6576 * A trait indicating an object may generate events
6578 typedef struct LDKEventsProvider {
6580 * An opaque pointer which is passed to your function implementations as an argument.
6581 * This has no meaning in the LDK, and can be NULL or any other value.
6585 * Gets the list of pending events which were generated by previous actions, clearing the list
6588 struct LDKCVec_EventZ (*get_and_clear_pending_events)(const void *this_arg);
6590 * Frees any resources associated with this object given its this_arg pointer.
6591 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6593 void (*free)(void *this_arg);
6594 } LDKEventsProvider;
6599 * Configuration we set when applicable.
6601 * Default::default() provides sane defaults.
6603 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
6605 * A pointer to the opaque Rust object.
6606 * Nearly everywhere, inner must be non-null, however in places where
6607 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6609 LDKnativeChannelHandshakeConfig *inner;
6611 * Indicates that this is the only struct which contains the same pointer.
6612 * Rust functions which take ownership of an object provided via an argument require
6613 * this to be true and invalidate the object pointed to by inner.
6616 } LDKChannelHandshakeConfig;
6621 * Optional channel limits which are applied during channel creation.
6623 * These limits are only applied to our counterparty's limits, not our own.
6625 * Use 0/<type>::max_value() as appropriate to skip checking.
6627 * Provides sane defaults for most configurations.
6629 * Most additional limits are disabled except those with which specify a default in individual
6630 * field documentation. Note that this may result in barely-usable channels, but since they
6631 * are applied mostly only to incoming channels that's not much of a problem.
6633 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
6635 * A pointer to the opaque Rust object.
6636 * Nearly everywhere, inner must be non-null, however in places where
6637 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6639 LDKnativeChannelHandshakeLimits *inner;
6641 * Indicates that this is the only struct which contains the same pointer.
6642 * Rust functions which take ownership of an object provided via an argument require
6643 * this to be true and invalidate the object pointed to by inner.
6646 } LDKChannelHandshakeLimits;
6651 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
6653 * Default::default() provides sane defaults for most configurations
6654 * (but currently with 0 relay fees!)
6656 typedef struct MUST_USE_STRUCT LDKUserConfig {
6658 * A pointer to the opaque Rust object.
6659 * Nearly everywhere, inner must be non-null, however in places where
6660 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6662 LDKnativeUserConfig *inner;
6664 * Indicates that this is the only struct which contains the same pointer.
6665 * Rust functions which take ownership of an object provided via an argument require
6666 * this to be true and invalidate the object pointed to by inner.
6672 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
6675 typedef struct LDKAccess {
6677 * An opaque pointer which is passed to your function implementations as an argument.
6678 * This has no meaning in the LDK, and can be NULL or any other value.
6682 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
6683 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
6686 * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
6688 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
6690 * Frees any resources associated with this object given its this_arg pointer.
6691 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6693 void (*free)(void *this_arg);
6697 * The `Listen` trait is used to be notified of when blocks have been connected or disconnected
6700 * Useful when needing to replay chain data upon startup or as new chain events occur.
6702 typedef struct LDKListen {
6704 * An opaque pointer which is passed to your function implementations as an argument.
6705 * This has no meaning in the LDK, and can be NULL or any other value.
6709 * Notifies the listener that a block was added at the given height.
6711 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
6713 * Notifies the listener that a block was removed at the given height.
6715 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
6717 * Frees any resources associated with this object given its this_arg pointer.
6718 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6720 void (*free)(void *this_arg);
6726 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
6728 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
6729 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
6730 * the return value of [`Filter::register_output`].
6732 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
6733 * may have been spent there. See [`Filter::register_output`] for details.
6735 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
6736 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
6738 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
6740 * A pointer to the opaque Rust object.
6741 * Nearly everywhere, inner must be non-null, however in places where
6742 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6744 LDKnativeWatchedOutput *inner;
6746 * Indicates that this is the only struct which contains the same pointer.
6747 * Rust functions which take ownership of an object provided via an argument require
6748 * this to be true and invalidate the object pointed to by inner.
6754 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
6757 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
6758 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
6759 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
6760 * receiving full blocks from a chain source, any further filtering is unnecessary.
6762 * After an output has been registered, subsequent block retrievals from the chain source must not
6763 * exclude any transactions matching the new criteria nor any in-block descendants of such
6766 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
6767 * should not block on I/O. Implementations should instead queue the newly monitored data to be
6768 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
6769 * invocation that has called the `Filter` must return [`TemporaryFailure`].
6771 * [`TemporaryFailure`]: channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure
6772 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
6773 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
6775 typedef struct LDKFilter {
6777 * An opaque pointer which is passed to your function implementations as an argument.
6778 * This has no meaning in the LDK, and can be NULL or any other value.
6782 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
6783 * a spending condition.
6785 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
6787 * Registers interest in spends of a transaction output.
6789 * Optionally, when `output.block_hash` is set, should return any transaction spending the
6790 * output that is found in the corresponding block along with its index.
6792 * This return value is useful for Electrum clients in order to supply in-block descendant
6793 * transactions which otherwise were not included. This is not necessary for other clients if
6794 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
6797 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
6799 * Frees any resources associated with this object given its this_arg pointer.
6800 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6802 void (*free)(void *this_arg);
6806 * `Persist` defines behavior for persisting channel monitors: this could mean
6807 * writing once to disk, and/or uploading to one or more backup services.
6809 * Note that for every new monitor, you **must** persist the new `ChannelMonitor`
6810 * to disk/backups. And, on every update, you **must** persist either the
6811 * `ChannelMonitorUpdate` or the updated monitor itself. Otherwise, there is risk
6812 * of situations such as revoking a transaction, then crashing before this
6813 * revocation can be persisted, then unintentionally broadcasting a revoked
6814 * transaction and losing money. This is a risk because previous channel states
6815 * are toxic, so it's important that whatever channel state is persisted is
6818 typedef struct LDKPersist {
6820 * An opaque pointer which is passed to your function implementations as an argument.
6821 * This has no meaning in the LDK, and can be NULL or any other value.
6825 * Persist a new channel's data. The data can be stored any way you want, but
6826 * the identifier provided by Rust-Lightning is the channel's outpoint (and
6827 * it is up to you to maintain a correct mapping between the outpoint and the
6828 * stored channel data). Note that you **must** persist every new monitor to
6829 * disk. See the `Persist` trait documentation for more details.
6831 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
6832 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
6834 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data);
6836 * Update one channel's data. The provided `ChannelMonitor` has already
6837 * applied the given update.
6839 * Note that on every update, you **must** persist either the
6840 * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See
6841 * the `Persist` trait documentation for more details.
6843 * If an implementer chooses to persist the updates only, they need to make
6844 * sure that all the updates are applied to the `ChannelMonitors` *before*
6845 * the set of channel monitors is given to the `ChannelManager`
6846 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
6847 * applying a monitor update to a monitor. If full `ChannelMonitors` are
6848 * persisted, then there is no need to persist individual updates.
6850 * Note that there could be a performance tradeoff between persisting complete
6851 * channel monitors on every update vs. persisting only updates and applying
6852 * them in batches. The size of each monitor grows `O(number of state updates)`
6853 * whereas updates are small and `O(1)`.
6855 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
6856 * [`ChannelMonitorUpdate::write`] for writing out an update, and
6857 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
6859 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);
6861 * Frees any resources associated with this object given its this_arg pointer.
6862 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6864 void (*free)(void *this_arg);
6870 * An implementation of [`chain::Watch`] for monitoring channels.
6872 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
6873 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
6874 * or used independently to monitor channels remotely. See the [module-level documentation] for
6877 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
6878 * [module-level documentation]: crate::chain::chainmonitor
6880 typedef struct MUST_USE_STRUCT LDKChainMonitor {
6882 * A pointer to the opaque Rust object.
6883 * Nearly everywhere, inner must be non-null, however in places where
6884 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6886 LDKnativeChainMonitor *inner;
6888 * Indicates that this is the only struct which contains the same pointer.
6889 * Rust functions which take ownership of an object provided via an argument require
6890 * this to be true and invalidate the object pointed to by inner.
6898 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
6899 * and derives keys from that.
6901 * Your node_id is seed/0'
6902 * ChannelMonitor closes may use seed/1'
6903 * Cooperative closes may use seed/2'
6904 * The two close keys may be needed to claim on-chain funds!
6906 typedef struct MUST_USE_STRUCT LDKKeysManager {
6908 * A pointer to the opaque Rust object.
6909 * Nearly everywhere, inner must be non-null, however in places where
6910 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6912 LDKnativeKeysManager *inner;
6914 * Indicates that this is the only struct which contains the same pointer.
6915 * Rust functions which take ownership of an object provided via an argument require
6916 * this to be true and invalidate the object pointed to by inner.
6924 * Chain-related parameters used to construct a new `ChannelManager`.
6926 * Typically, the block-specific parameters are derived from the best block hash for the network,
6927 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
6928 * are not needed when deserializing a previously constructed `ChannelManager`.
6930 typedef struct MUST_USE_STRUCT LDKChainParameters {
6932 * A pointer to the opaque Rust object.
6933 * Nearly everywhere, inner must be non-null, however in places where
6934 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6936 LDKnativeChainParameters *inner;
6938 * Indicates that this is the only struct which contains the same pointer.
6939 * Rust functions which take ownership of an object provided via an argument require
6940 * this to be true and invalidate the object pointed to by inner.
6943 } LDKChainParameters;
6946 * A 3-byte byte array.
6948 typedef struct LDKThreeBytes {
6956 * A trait to describe an object which can receive channel messages.
6958 * Messages MAY be called in parallel when they originate from different their_node_ids, however
6959 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
6961 typedef struct LDKChannelMessageHandler {
6963 * An opaque pointer which is passed to your function implementations as an argument.
6964 * This has no meaning in the LDK, and can be NULL or any other value.
6968 * Handle an incoming open_channel message from the given peer.
6970 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
6972 * Handle an incoming accept_channel message from the given peer.
6974 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
6976 * Handle an incoming funding_created message from the given peer.
6978 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
6980 * Handle an incoming funding_signed message from the given peer.
6982 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
6984 * Handle an incoming funding_locked message from the given peer.
6986 void (*handle_funding_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg);
6988 * Handle an incoming shutdown message from the given peer.
6990 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);
6992 * Handle an incoming closing_signed message from the given peer.
6994 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
6996 * Handle an incoming update_add_htlc message from the given peer.
6998 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
7000 * Handle an incoming update_fulfill_htlc message from the given peer.
7002 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
7004 * Handle an incoming update_fail_htlc message from the given peer.
7006 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
7008 * Handle an incoming update_fail_malformed_htlc message from the given peer.
7010 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
7012 * Handle an incoming commitment_signed message from the given peer.
7014 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
7016 * Handle an incoming revoke_and_ack message from the given peer.
7018 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
7020 * Handle an incoming update_fee message from the given peer.
7022 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
7024 * Handle an incoming announcement_signatures message from the given peer.
7026 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
7028 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
7029 * is believed to be possible in the future (eg they're sending us messages we don't
7030 * understand or indicate they require unknown feature bits), no_connection_possible is set
7031 * and any outstanding channels should be failed.
7033 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
7035 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
7037 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
7039 * Handle an incoming channel_reestablish message from the given peer.
7041 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
7043 * Handle an incoming channel update from the given peer.
7045 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
7047 * Handle an incoming error message from the given peer.
7049 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
7051 * Implementation of MessageSendEventsProvider for this object.
7053 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
7055 * Frees any resources associated with this object given its this_arg pointer.
7056 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7058 void (*free)(void *this_arg);
7059 } LDKChannelMessageHandler;
7064 * Arguments for the creation of a ChannelManager that are not deserialized.
7066 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
7068 * 1) Deserialize all stored ChannelMonitors.
7069 * 2) Deserialize the ChannelManager by filling in this struct and calling:
7070 * <(BlockHash, ChannelManager)>::read(reader, args)
7071 * This may result in closing some Channels if the ChannelMonitor is newer than the stored
7072 * ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted.
7073 * 3) If you are not fetching full blocks, register all relevant ChannelMonitor outpoints the same
7074 * way you would handle a `chain::Filter` call using ChannelMonitor::get_outputs_to_watch() and
7075 * ChannelMonitor::get_funding_txo().
7076 * 4) Reconnect blocks on your ChannelMonitors.
7077 * 5) Disconnect/connect blocks on the ChannelManager.
7078 * 6) Move the ChannelMonitors into your local chain::Watch.
7080 * Note that the ordering of #4-6 is not of importance, however all three must occur before you
7081 * call any other methods on the newly-deserialized ChannelManager.
7083 * Note that because some channels may be closed during deserialization, it is critical that you
7084 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
7085 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
7086 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
7087 * not force-close the same channels but consider them live), you may end up revoking a state for
7088 * which you've already broadcasted the transaction.
7090 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
7092 * A pointer to the opaque Rust object.
7093 * Nearly everywhere, inner must be non-null, however in places where
7094 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7096 LDKnativeChannelManagerReadArgs *inner;
7098 * Indicates that this is the only struct which contains the same pointer.
7099 * Rust functions which take ownership of an object provided via an argument require
7100 * this to be true and invalidate the object pointed to by inner.
7103 } LDKChannelManagerReadArgs;
7108 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
7109 * This is used to convince the recipient that the channel is at a certain commitment
7110 * number even if they lost that data due to a local failure. Of course, the peer may lie
7111 * and even later commitments may have been revoked.
7113 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
7115 * A pointer to the opaque Rust object.
7116 * Nearly everywhere, inner must be non-null, however in places where
7117 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7119 LDKnativeDataLossProtect *inner;
7121 * Indicates that this is the only struct which contains the same pointer.
7122 * Rust functions which take ownership of an object provided via an argument require
7123 * this to be true and invalidate the object pointed to by inner.
7126 } LDKDataLossProtect;
7129 * A trait to describe an object which can receive routing messages.
7131 * # Implementor DoS Warnings
7133 * For `gossip_queries` messages there are potential DoS vectors when handling
7134 * inbound queries. Implementors using an on-disk network graph should be aware of
7135 * repeated disk I/O for queries accessing different parts of the network graph.
7137 typedef struct LDKRoutingMessageHandler {
7139 * An opaque pointer which is passed to your function implementations as an argument.
7140 * This has no meaning in the LDK, and can be NULL or any other value.
7144 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
7145 * false or returning an Err otherwise.
7147 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
7149 * Handle a channel_announcement message, returning true if it should be forwarded on, false
7150 * or returning an Err otherwise.
7152 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
7154 * Handle an incoming channel_update message, returning true if it should be forwarded on,
7155 * false or returning an Err otherwise.
7157 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
7159 * Handle some updates to the route graph that we learned due to an outbound failed payment.
7161 void (*handle_htlc_fail_channel_update)(const void *this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update);
7163 * Gets a subset of the channel announcements and updates required to dump our routing table
7164 * to a remote node, starting at the short_channel_id indicated by starting_point and
7165 * including the batch_amount entries immediately higher in numerical value than starting_point.
7167 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
7169 * Gets a subset of the node announcements required to dump our routing table to a remote node,
7170 * starting at the node *after* the provided publickey and including batch_amount entries
7171 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
7172 * If None is provided for starting_point, we start at the first node.
7174 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
7176 * Called when a connection is established with a peer. This can be used to
7177 * perform routing table synchronization using a strategy defined by the
7180 void (*sync_routing_table)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
7182 * Handles the reply of a query we initiated to learn about channels
7183 * for a given range of blocks. We can expect to receive one or more
7184 * replies to a single query.
7186 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
7188 * Handles the reply of a query we initiated asking for routing gossip
7189 * messages for a list of channels. We should receive this message when
7190 * a node has completed its best effort to send us the pertaining routing
7193 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
7195 * Handles when a peer asks us to send a list of short_channel_ids
7196 * for the requested range of blocks.
7198 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
7200 * Handles when a peer asks us to send routing gossip messages for a
7201 * list of short_channel_ids.
7203 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
7205 * Implementation of MessageSendEventsProvider for this object.
7207 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
7209 * Frees any resources associated with this object given its this_arg pointer.
7210 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7212 void (*free)(void *this_arg);
7213 } LDKRoutingMessageHandler;
7218 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
7219 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
7221 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
7223 * A pointer to the opaque Rust object.
7224 * Nearly everywhere, inner must be non-null, however in places where
7225 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7227 LDKnativeIgnoringMessageHandler *inner;
7229 * Indicates that this is the only struct which contains the same pointer.
7230 * Rust functions which take ownership of an object provided via an argument require
7231 * this to be true and invalidate the object pointed to by inner.
7234 } LDKIgnoringMessageHandler;
7239 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
7240 * You can provide one of these as the route_handler in a MessageHandler.
7242 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
7244 * A pointer to the opaque Rust object.
7245 * Nearly everywhere, inner must be non-null, however in places where
7246 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7248 LDKnativeErroringMessageHandler *inner;
7250 * Indicates that this is the only struct which contains the same pointer.
7251 * Rust functions which take ownership of an object provided via an argument require
7252 * this to be true and invalidate the object pointed to by inner.
7255 } LDKErroringMessageHandler;
7260 * Provides references to trait impls which handle different types of messages.
7262 typedef struct MUST_USE_STRUCT LDKMessageHandler {
7264 * A pointer to the opaque Rust object.
7265 * Nearly everywhere, inner must be non-null, however in places where
7266 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7268 LDKnativeMessageHandler *inner;
7270 * Indicates that this is the only struct which contains the same pointer.
7271 * Rust functions which take ownership of an object provided via an argument require
7272 * this to be true and invalidate the object pointed to by inner.
7275 } LDKMessageHandler;
7278 * Provides an object which can be used to send data to and which uniquely identifies a connection
7279 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
7280 * implement Hash to meet the PeerManager API.
7282 * For efficiency, Clone should be relatively cheap for this type.
7284 * You probably want to just extend an int and put a file descriptor in a struct and implement
7285 * send_data. Note that if you are using a higher-level net library that may call close() itself,
7286 * be careful to ensure you don't have races whereby you might register a new connection with an
7287 * fd which is the same as a previous one which has yet to be removed via
7288 * PeerManager::socket_disconnected().
7290 typedef struct LDKSocketDescriptor {
7292 * An opaque pointer which is passed to your function implementations as an argument.
7293 * This has no meaning in the LDK, and can be NULL or any other value.
7297 * Attempts to send some data from the given slice to the peer.
7299 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
7300 * Note that in the disconnected case, socket_disconnected must still fire and further write
7301 * attempts may occur until that time.
7303 * If the returned size is smaller than data.len(), a write_available event must
7304 * trigger the next time more data can be written. Additionally, until the a send_data event
7305 * completes fully, no further read_events should trigger on the same peer!
7307 * If a read_event on this descriptor had previously returned true (indicating that read
7308 * events should be paused to prevent DoS in the send buffer), resume_read may be set
7309 * indicating that read events on this descriptor should resume. A resume_read of false does
7310 * *not* imply that further read events should be paused.
7312 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
7314 * Disconnect the socket pointed to by this SocketDescriptor. Once this function returns, no
7315 * more calls to write_buffer_space_avail, read_event or socket_disconnected may be made with
7316 * this descriptor. No socket_disconnected call should be generated as a result of this call,
7317 * though races may occur whereby disconnect_socket is called after a call to
7318 * socket_disconnected but prior to socket_disconnected returning.
7320 void (*disconnect_socket)(void *this_arg);
7322 * Checks if two objects are equal given this object's this_arg pointer and another object.
7324 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
7326 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
7327 * This is used, for example, for inclusion of this object in a hash map.
7329 uint64_t (*hash)(const void *this_arg);
7331 * Creates a copy of the object pointed to by this_arg, for a copy of this SocketDescriptor.
7332 * Note that the ultimate copy of the SocketDescriptor will have all function pointers the same as the original.
7333 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new SocketDescriptor.
7335 void *(*clone)(const void *this_arg);
7337 * Frees any resources associated with this object given its this_arg pointer.
7338 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7340 void (*free)(void *this_arg);
7341 } LDKSocketDescriptor;
7346 * A PeerManager manages a set of peers, described by their SocketDescriptor and marshalls socket
7347 * events into messages which it passes on to its MessageHandlers.
7349 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
7350 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
7351 * essentially you should default to using a SimpleRefPeerManager, and use a
7352 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
7353 * you're using lightning-net-tokio.
7355 typedef struct MUST_USE_STRUCT LDKPeerManager {
7357 * A pointer to the opaque Rust object.
7358 * Nearly everywhere, inner must be non-null, however in places where
7359 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7361 LDKnativePeerManager *inner;
7363 * Indicates that this is the only struct which contains the same pointer.
7364 * Rust functions which take ownership of an object provided via an argument require
7365 * this to be true and invalidate the object pointed to by inner.
7373 * Static channel fields used to build transactions given per-commitment fields, organized by
7374 * broadcaster/countersignatory.
7376 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
7377 * as_holder_broadcastable and as_counterparty_broadcastable functions.
7379 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
7381 * A pointer to the opaque Rust object.
7382 * Nearly everywhere, inner must be non-null, however in places where
7383 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7385 LDKnativeDirectedChannelTransactionParameters *inner;
7387 * Indicates that this is the only struct which contains the same pointer.
7388 * Rust functions which take ownership of an object provided via an argument require
7389 * this to be true and invalidate the object pointed to by inner.
7392 } LDKDirectedChannelTransactionParameters;
7397 * A simple newtype for RwLockReadGuard<'a, NetworkGraph>.
7398 * This exists only to make accessing a RwLock<NetworkGraph> possible from
7399 * the C bindings, as it can be done directly in Rust code.
7401 typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
7403 * A pointer to the opaque Rust object.
7404 * Nearly everywhere, inner must be non-null, however in places where
7405 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7407 LDKnativeLockedNetworkGraph *inner;
7409 * Indicates that this is the only struct which contains the same pointer.
7410 * Rust functions which take ownership of an object provided via an argument require
7411 * this to be true and invalidate the object pointed to by inner.
7414 } LDKLockedNetworkGraph;
7419 * Receives and validates network updates from peers,
7420 * stores authentic and relevant data as a network graph.
7421 * This network graph is then used for routing payments.
7422 * Provides interface to help with initial routing sync by
7423 * serving historical announcements.
7425 typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
7427 * A pointer to the opaque Rust object.
7428 * Nearly everywhere, inner must be non-null, however in places where
7429 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7431 LDKnativeNetGraphMsgHandler *inner;
7433 * Indicates that this is the only struct which contains the same pointer.
7434 * Rust functions which take ownership of an object provided via an argument require
7435 * this to be true and invalidate the object pointed to by inner.
7438 } LDKNetGraphMsgHandler;
7440 extern const uintptr_t MAX_BUF_SIZE;
7442 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
7444 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
7446 extern const uint16_t BREAKDOWN_TIMEOUT;
7448 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
7450 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
7453 * Frees the data buffer, if data_is_owned is set and datalen > 0.
7455 void Transaction_free(struct LDKTransaction _res);
7458 * Frees the data pointed to by script_pubkey.
7460 void TxOut_free(struct LDKTxOut _res);
7463 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
7465 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
7468 * Creates a new CResult_SecretKeyErrorZ in the success state.
7470 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
7473 * Creates a new CResult_SecretKeyErrorZ in the error state.
7475 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
7478 * Frees any resources used by the CResult_SecretKeyErrorZ.
7480 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
7483 * Creates a new CResult_PublicKeyErrorZ in the success state.
7485 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
7488 * Creates a new CResult_PublicKeyErrorZ in the error state.
7490 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
7493 * Frees any resources used by the CResult_PublicKeyErrorZ.
7495 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
7498 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
7500 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
7503 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
7505 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
7508 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
7510 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
7513 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
7514 * but with all dynamically-allocated buffers duplicated in new buffers.
7516 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
7519 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
7521 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
7524 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
7526 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
7529 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
7531 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
7534 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
7535 * but with all dynamically-allocated buffers duplicated in new buffers.
7537 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
7540 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
7542 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
7545 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
7547 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
7550 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
7552 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
7555 * Constructs a new COption_u32Z containing a u32
7557 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
7560 * Constructs a new COption_u32Z containing nothing
7562 struct LDKCOption_u32Z COption_u32Z_none(void);
7565 * Frees any resources associated with the u32, if we are in the Some state
7567 void COption_u32Z_free(struct LDKCOption_u32Z _res);
7570 * Creates a new COption_u32Z which has the same data as `orig`
7571 * but with all dynamically-allocated buffers duplicated in new buffers.
7573 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
7576 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
7578 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
7581 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
7583 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
7586 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
7588 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
7591 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
7592 * but with all dynamically-allocated buffers duplicated in new buffers.
7594 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
7597 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
7599 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
7602 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
7604 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
7607 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
7609 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
7612 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
7613 * but with all dynamically-allocated buffers duplicated in new buffers.
7615 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
7618 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
7620 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
7623 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
7625 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
7628 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
7630 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
7633 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
7634 * but with all dynamically-allocated buffers duplicated in new buffers.
7636 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
7639 * Frees the buffer pointed to by `data` if `datalen` is non-0.
7641 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
7644 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
7646 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
7649 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
7651 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
7654 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
7656 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
7659 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
7660 * but with all dynamically-allocated buffers duplicated in new buffers.
7662 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
7665 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
7667 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
7670 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
7672 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
7675 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
7677 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
7680 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
7681 * but with all dynamically-allocated buffers duplicated in new buffers.
7683 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
7686 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
7688 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
7691 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
7693 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
7696 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
7698 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
7701 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
7702 * but with all dynamically-allocated buffers duplicated in new buffers.
7704 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
7707 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
7709 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
7712 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
7714 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
7717 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
7719 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
7722 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
7724 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
7727 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
7729 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
7732 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
7734 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
7737 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
7738 * but with all dynamically-allocated buffers duplicated in new buffers.
7740 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
7743 * Frees the buffer pointed to by `data` if `datalen` is non-0.
7745 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
7748 * Creates a new CResult_boolLightningErrorZ in the success state.
7750 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
7753 * Creates a new CResult_boolLightningErrorZ in the error state.
7755 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
7758 * Frees any resources used by the CResult_boolLightningErrorZ.
7760 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
7763 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
7764 * but with all dynamically-allocated buffers duplicated in new buffers.
7766 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
7769 * Creates a new tuple which has the same data as `orig`
7770 * but with all dynamically-allocated buffers duplicated in new buffers.
7772 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
7775 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
7777 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
7780 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
7782 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
7785 * Frees the buffer pointed to by `data` if `datalen` is non-0.
7787 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
7790 * Frees the buffer pointed to by `data` if `datalen` is non-0.
7792 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
7795 * Creates a new CResult_NoneLightningErrorZ in the success state.
7797 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
7800 * Creates a new CResult_NoneLightningErrorZ in the error state.
7802 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
7805 * Frees any resources used by the CResult_NoneLightningErrorZ.
7807 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
7810 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
7811 * but with all dynamically-allocated buffers duplicated in new buffers.
7813 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
7816 * Frees the buffer pointed to by `data` if `datalen` is non-0.
7818 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
7821 * Frees the buffer pointed to by `data` if `datalen` is non-0.
7823 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
7826 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
7828 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
7831 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
7833 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
7836 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
7838 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
7841 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
7842 * but with all dynamically-allocated buffers duplicated in new buffers.
7844 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
7847 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
7849 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
7852 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
7854 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
7857 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
7859 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
7862 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
7863 * but with all dynamically-allocated buffers duplicated in new buffers.
7865 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
7868 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
7870 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
7873 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
7875 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
7878 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
7880 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
7883 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
7884 * but with all dynamically-allocated buffers duplicated in new buffers.
7886 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
7889 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
7891 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
7894 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
7896 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
7899 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
7901 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
7904 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
7906 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
7909 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
7911 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
7914 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
7916 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
7919 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
7921 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
7924 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
7926 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
7929 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
7931 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
7934 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
7936 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
7939 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
7941 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
7944 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
7946 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
7949 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
7951 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
7954 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
7956 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
7959 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
7961 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
7964 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
7965 * but with all dynamically-allocated buffers duplicated in new buffers.
7967 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
7970 * Constructs a new COption_u64Z containing a u64
7972 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
7975 * Constructs a new COption_u64Z containing nothing
7977 struct LDKCOption_u64Z COption_u64Z_none(void);
7980 * Frees any resources associated with the u64, if we are in the Some state
7982 void COption_u64Z_free(struct LDKCOption_u64Z _res);
7985 * Creates a new COption_u64Z which has the same data as `orig`
7986 * but with all dynamically-allocated buffers duplicated in new buffers.
7988 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
7991 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the success state.
7993 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o);
7996 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the error state.
7998 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
8001 * Frees any resources used by the CResult_DirectionalChannelInfoDecodeErrorZ.
8003 void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res);
8006 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ which has the same data as `orig`
8007 * but with all dynamically-allocated buffers duplicated in new buffers.
8009 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig);
8012 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
8014 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
8017 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
8019 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
8022 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
8024 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
8027 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
8028 * but with all dynamically-allocated buffers duplicated in new buffers.
8030 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
8033 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
8035 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
8038 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
8040 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
8043 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
8045 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
8048 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
8049 * but with all dynamically-allocated buffers duplicated in new buffers.
8051 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
8054 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8056 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
8059 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
8061 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
8064 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
8066 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
8069 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
8071 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
8074 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
8075 * but with all dynamically-allocated buffers duplicated in new buffers.
8077 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
8080 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8082 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
8085 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
8087 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
8090 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
8092 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
8095 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
8097 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
8100 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
8101 * but with all dynamically-allocated buffers duplicated in new buffers.
8103 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
8106 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
8108 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
8111 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
8113 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
8116 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
8118 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
8121 * Creates a new CResult_NetworkGraphDecodeErrorZ which has the same data as `orig`
8122 * but with all dynamically-allocated buffers duplicated in new buffers.
8124 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
8127 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
8129 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
8132 * Frees any resources used by the C2Tuple_usizeTransactionZ.
8134 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
8137 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8139 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
8142 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
8144 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
8147 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
8149 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
8152 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
8154 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
8157 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
8158 * but with all dynamically-allocated buffers duplicated in new buffers.
8160 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
8163 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8165 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
8168 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8170 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
8173 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
8175 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
8178 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
8180 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
8183 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
8185 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
8188 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
8189 * but with all dynamically-allocated buffers duplicated in new buffers.
8191 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
8194 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
8196 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
8199 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
8201 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
8204 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
8206 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
8209 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
8210 * but with all dynamically-allocated buffers duplicated in new buffers.
8212 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
8215 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
8217 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
8220 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
8222 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
8225 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
8227 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
8230 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
8231 * but with all dynamically-allocated buffers duplicated in new buffers.
8233 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
8236 * Creates a new CResult_NoneMonitorUpdateErrorZ in the success state.
8238 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
8241 * Creates a new CResult_NoneMonitorUpdateErrorZ in the error state.
8243 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e);
8246 * Frees any resources used by the CResult_NoneMonitorUpdateErrorZ.
8248 void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res);
8251 * Creates a new CResult_NoneMonitorUpdateErrorZ which has the same data as `orig`
8252 * but with all dynamically-allocated buffers duplicated in new buffers.
8254 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig);
8257 * Creates a new tuple which has the same data as `orig`
8258 * but with all dynamically-allocated buffers duplicated in new buffers.
8260 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
8263 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
8265 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
8268 * Frees any resources used by the C2Tuple_OutPointScriptZ.
8270 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
8273 * Creates a new tuple which has the same data as `orig`
8274 * but with all dynamically-allocated buffers duplicated in new buffers.
8276 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
8279 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
8281 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
8284 * Frees any resources used by the C2Tuple_u32ScriptZ.
8286 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
8289 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8291 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
8294 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
8296 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
8299 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
8301 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
8304 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8306 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
8309 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8311 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
8314 * Creates a new tuple which has the same data as `orig`
8315 * but with all dynamically-allocated buffers duplicated in new buffers.
8317 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
8320 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
8322 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
8325 * Frees any resources used by the C2Tuple_u32TxOutZ.
8327 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
8330 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8332 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
8335 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
8337 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
8340 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
8342 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
8345 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8347 void CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res);
8350 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
8352 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
8355 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
8357 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
8360 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
8362 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
8365 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
8367 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
8370 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
8372 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
8375 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8377 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
8380 * Creates a new CResult_TxOutAccessErrorZ in the success state.
8382 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
8385 * Creates a new CResult_TxOutAccessErrorZ in the error state.
8387 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
8390 * Frees any resources used by the CResult_TxOutAccessErrorZ.
8392 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
8395 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
8396 * but with all dynamically-allocated buffers duplicated in new buffers.
8398 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
8401 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ
8403 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
8406 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing
8408 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
8411 * Frees any resources associated with the crate::c_types::derived::C2Tuple_usizeTransactionZ, if we are in the Some state
8413 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
8416 * Creates a new CResult_NoneAPIErrorZ in the success state.
8418 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
8421 * Creates a new CResult_NoneAPIErrorZ in the error state.
8423 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
8426 * Frees any resources used by the CResult_NoneAPIErrorZ.
8428 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
8431 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
8432 * but with all dynamically-allocated buffers duplicated in new buffers.
8434 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
8437 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8439 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
8442 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8444 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
8447 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8449 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
8452 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
8454 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
8457 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
8459 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
8462 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
8464 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
8467 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
8468 * but with all dynamically-allocated buffers duplicated in new buffers.
8470 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
8473 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8475 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
8478 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
8480 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
8483 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
8485 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
8488 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
8490 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
8493 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
8495 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
8498 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
8500 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
8503 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
8505 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
8508 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
8510 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
8513 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
8515 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
8518 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
8519 * but with all dynamically-allocated buffers duplicated in new buffers.
8521 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
8524 * Creates a new tuple which has the same data as `orig`
8525 * but with all dynamically-allocated buffers duplicated in new buffers.
8527 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
8530 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
8532 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
8535 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
8537 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
8540 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
8542 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
8545 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
8547 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
8550 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
8552 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
8555 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
8556 * but with all dynamically-allocated buffers duplicated in new buffers.
8558 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
8561 * Creates a new CResult_SignatureNoneZ in the success state.
8563 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
8566 * Creates a new CResult_SignatureNoneZ in the error state.
8568 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
8571 * Frees any resources used by the CResult_SignatureNoneZ.
8573 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
8576 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
8577 * but with all dynamically-allocated buffers duplicated in new buffers.
8579 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
8582 * Creates a new CResult_SignDecodeErrorZ in the success state.
8584 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
8587 * Creates a new CResult_SignDecodeErrorZ in the error state.
8589 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
8592 * Frees any resources used by the CResult_SignDecodeErrorZ.
8594 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
8597 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
8598 * but with all dynamically-allocated buffers duplicated in new buffers.
8600 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
8603 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8605 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
8608 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
8610 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
8613 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
8615 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
8618 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
8620 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
8623 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
8624 * but with all dynamically-allocated buffers duplicated in new buffers.
8626 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
8629 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
8631 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
8634 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
8636 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
8639 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
8641 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
8644 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
8645 * but with all dynamically-allocated buffers duplicated in new buffers.
8647 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
8650 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8652 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
8655 * Creates a new CResult_TransactionNoneZ in the success state.
8657 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
8660 * Creates a new CResult_TransactionNoneZ in the error state.
8662 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
8665 * Frees any resources used by the CResult_TransactionNoneZ.
8667 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
8670 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8672 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
8675 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8677 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
8680 * Creates a new CResult_RouteDecodeErrorZ in the success state.
8682 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
8685 * Creates a new CResult_RouteDecodeErrorZ in the error state.
8687 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
8690 * Frees any resources used by the CResult_RouteDecodeErrorZ.
8692 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
8695 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
8696 * but with all dynamically-allocated buffers duplicated in new buffers.
8698 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
8701 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8703 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
8706 * Creates a new CResult_RouteLightningErrorZ in the success state.
8708 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
8711 * Creates a new CResult_RouteLightningErrorZ in the error state.
8713 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
8716 * Frees any resources used by the CResult_RouteLightningErrorZ.
8718 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
8721 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
8722 * but with all dynamically-allocated buffers duplicated in new buffers.
8724 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
8727 * Creates a new CResult_NetAddressu8Z in the success state.
8729 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
8732 * Creates a new CResult_NetAddressu8Z in the error state.
8734 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
8737 * Frees any resources used by the CResult_NetAddressu8Z.
8739 void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
8742 * Creates a new CResult_NetAddressu8Z which has the same data as `orig`
8743 * but with all dynamically-allocated buffers duplicated in new buffers.
8745 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
8748 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the success state.
8750 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
8753 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the error state.
8755 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
8758 * Frees any resources used by the CResult_CResult_NetAddressu8ZDecodeErrorZ.
8760 void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
8763 * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ which has the same data as `orig`
8764 * but with all dynamically-allocated buffers duplicated in new buffers.
8766 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
8769 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8771 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
8774 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8776 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
8779 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8781 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
8784 * Frees the buffer pointed to by `data` if `datalen` is non-0.
8786 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
8789 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
8791 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
8794 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
8796 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
8799 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
8801 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
8804 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
8805 * but with all dynamically-allocated buffers duplicated in new buffers.
8807 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
8810 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
8812 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
8815 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
8817 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
8820 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
8822 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
8825 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
8826 * but with all dynamically-allocated buffers duplicated in new buffers.
8828 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
8831 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
8833 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
8836 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
8838 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
8841 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
8843 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
8846 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
8847 * but with all dynamically-allocated buffers duplicated in new buffers.
8849 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
8852 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
8854 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
8857 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
8859 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
8862 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
8864 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
8867 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
8868 * but with all dynamically-allocated buffers duplicated in new buffers.
8870 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
8873 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
8875 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
8878 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
8880 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
8883 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
8885 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
8888 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
8889 * but with all dynamically-allocated buffers duplicated in new buffers.
8891 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
8894 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
8896 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
8899 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
8901 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
8904 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
8906 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
8909 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
8910 * but with all dynamically-allocated buffers duplicated in new buffers.
8912 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
8915 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
8917 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
8920 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
8922 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
8925 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
8927 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
8930 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
8931 * but with all dynamically-allocated buffers duplicated in new buffers.
8933 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
8936 * Creates a new CResult_FundingLockedDecodeErrorZ in the success state.
8938 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o);
8941 * Creates a new CResult_FundingLockedDecodeErrorZ in the error state.
8943 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e);
8946 * Frees any resources used by the CResult_FundingLockedDecodeErrorZ.
8948 void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res);
8951 * Creates a new CResult_FundingLockedDecodeErrorZ which has the same data as `orig`
8952 * but with all dynamically-allocated buffers duplicated in new buffers.
8954 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig);
8957 * Creates a new CResult_InitDecodeErrorZ in the success state.
8959 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
8962 * Creates a new CResult_InitDecodeErrorZ in the error state.
8964 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
8967 * Frees any resources used by the CResult_InitDecodeErrorZ.
8969 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
8972 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
8973 * but with all dynamically-allocated buffers duplicated in new buffers.
8975 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
8978 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
8980 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
8983 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
8985 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
8988 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
8990 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
8993 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
8994 * but with all dynamically-allocated buffers duplicated in new buffers.
8996 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
8999 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
9001 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
9004 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
9006 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
9009 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
9011 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
9014 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
9015 * but with all dynamically-allocated buffers duplicated in new buffers.
9017 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
9020 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
9022 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
9025 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
9027 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
9030 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
9032 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
9035 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
9036 * but with all dynamically-allocated buffers duplicated in new buffers.
9038 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
9041 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
9043 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
9046 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
9048 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
9051 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
9053 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
9056 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
9057 * but with all dynamically-allocated buffers duplicated in new buffers.
9059 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
9062 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
9064 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
9067 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
9069 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
9072 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
9074 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
9077 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
9078 * but with all dynamically-allocated buffers duplicated in new buffers.
9080 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
9083 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
9085 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
9088 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
9090 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
9093 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
9095 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
9098 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
9099 * but with all dynamically-allocated buffers duplicated in new buffers.
9101 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
9104 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
9106 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
9109 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
9111 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
9114 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
9116 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
9119 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
9120 * but with all dynamically-allocated buffers duplicated in new buffers.
9122 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
9125 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
9127 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
9130 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
9132 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
9135 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
9137 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
9140 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
9141 * but with all dynamically-allocated buffers duplicated in new buffers.
9143 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
9146 * Creates a new CResult_PingDecodeErrorZ in the success state.
9148 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
9151 * Creates a new CResult_PingDecodeErrorZ in the error state.
9153 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
9156 * Frees any resources used by the CResult_PingDecodeErrorZ.
9158 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
9161 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
9162 * but with all dynamically-allocated buffers duplicated in new buffers.
9164 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
9167 * Creates a new CResult_PongDecodeErrorZ in the success state.
9169 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
9172 * Creates a new CResult_PongDecodeErrorZ in the error state.
9174 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
9177 * Frees any resources used by the CResult_PongDecodeErrorZ.
9179 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
9182 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
9183 * but with all dynamically-allocated buffers duplicated in new buffers.
9185 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
9188 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
9190 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
9193 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
9195 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
9198 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
9200 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
9203 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
9204 * but with all dynamically-allocated buffers duplicated in new buffers.
9206 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
9209 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
9211 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
9214 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
9216 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
9219 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
9221 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
9224 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
9225 * but with all dynamically-allocated buffers duplicated in new buffers.
9227 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
9230 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
9232 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
9235 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
9237 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
9240 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
9242 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
9245 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
9246 * but with all dynamically-allocated buffers duplicated in new buffers.
9248 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
9251 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
9253 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
9256 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
9258 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
9261 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
9263 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
9266 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
9267 * but with all dynamically-allocated buffers duplicated in new buffers.
9269 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
9272 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
9274 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
9277 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
9279 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
9282 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
9284 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
9287 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
9288 * but with all dynamically-allocated buffers duplicated in new buffers.
9290 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
9293 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
9295 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
9298 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
9300 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
9303 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
9305 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
9308 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
9309 * but with all dynamically-allocated buffers duplicated in new buffers.
9311 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
9314 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
9316 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
9319 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
9321 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
9324 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
9326 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
9329 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
9330 * but with all dynamically-allocated buffers duplicated in new buffers.
9332 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
9335 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
9337 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
9340 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
9342 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
9345 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
9347 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
9350 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
9351 * but with all dynamically-allocated buffers duplicated in new buffers.
9353 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
9356 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
9358 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
9361 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
9363 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
9366 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
9368 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
9371 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
9372 * but with all dynamically-allocated buffers duplicated in new buffers.
9374 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
9377 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
9379 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
9382 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
9384 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
9387 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
9389 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
9392 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
9393 * but with all dynamically-allocated buffers duplicated in new buffers.
9395 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
9398 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
9400 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
9403 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
9405 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
9408 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
9410 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
9413 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
9414 * but with all dynamically-allocated buffers duplicated in new buffers.
9416 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
9419 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
9421 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
9424 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
9426 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
9429 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
9431 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
9434 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
9435 * but with all dynamically-allocated buffers duplicated in new buffers.
9437 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
9440 * Frees any resources used by the Event
9442 void Event_free(struct LDKEvent this_ptr);
9445 * Creates a copy of the Event
9447 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
9450 * Serialize the Event object into a byte array which can be read by Event_read
9452 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
9455 * Frees any resources used by the MessageSendEvent
9457 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
9460 * Creates a copy of the MessageSendEvent
9462 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
9465 * Calls the free function if one is set
9467 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
9470 * Calls the free function if one is set
9472 void EventsProvider_free(struct LDKEventsProvider this_ptr);
9475 * Frees any resources used by the APIError
9477 void APIError_free(struct LDKAPIError this_ptr);
9480 * Creates a copy of the APIError
9482 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
9485 * Creates a copy of the Level
9487 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
9490 * Returns the most verbose logging level.
9492 MUST_USE_RES enum LDKLevel Level_max(void);
9495 * Calls the free function if one is set
9497 void Logger_free(struct LDKLogger this_ptr);
9500 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
9502 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
9505 * Confirmations we will wait for before considering the channel locked in.
9506 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
9507 * equivalent limit applied to outbound channels).
9511 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
9514 * Confirmations we will wait for before considering the channel locked in.
9515 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
9516 * equivalent limit applied to outbound channels).
9520 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
9523 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
9524 * the number of blocks we have to punish our counterparty if they broadcast a revoked
9527 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
9528 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
9529 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
9530 * possibly with time in between to RBF the spending transaction).
9532 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
9533 * case of an honest unilateral channel close, which implicitly decrease the economic value of
9536 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
9537 * can tweak config to ask for more security, not less.
9539 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
9542 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
9543 * the number of blocks we have to punish our counterparty if they broadcast a revoked
9546 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
9547 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
9548 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
9549 * possibly with time in between to RBF the spending transaction).
9551 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
9552 * case of an honest unilateral channel close, which implicitly decrease the economic value of
9555 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
9556 * can tweak config to ask for more security, not less.
9558 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
9561 * Set to the smallest value HTLC we will accept to process.
9563 * This value is sent to our counterparty on channel-open and we close the channel any time
9564 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
9566 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
9569 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
9572 * Set to the smallest value HTLC we will accept to process.
9574 * This value is sent to our counterparty on channel-open and we close the channel any time
9575 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
9577 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
9580 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
9583 * Constructs a new ChannelHandshakeConfig given each field
9585 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);
9588 * Creates a copy of the ChannelHandshakeConfig
9590 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
9593 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
9595 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
9598 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
9600 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
9603 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
9604 * only applies to inbound channels.
9608 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9611 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
9612 * only applies to inbound channels.
9616 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9619 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
9620 * you to limit the maximum minimum-size they can require.
9622 * Default value: u64::max_value.
9624 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9627 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
9628 * you to limit the maximum minimum-size they can require.
9630 * Default value: u64::max_value.
9632 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9635 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
9636 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
9640 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9643 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
9644 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
9648 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9651 * The remote node will require we keep a certain amount in direct payment to ourselves at all
9652 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
9653 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
9655 * Default value: u64::max_value.
9657 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9660 * The remote node will require we keep a certain amount in direct payment to ourselves at all
9661 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
9662 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
9664 * Default value: u64::max_value.
9666 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9669 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
9670 * time. This allows you to set a minimum such value.
9674 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9677 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
9678 * time. This allows you to set a minimum such value.
9682 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
9685 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
9686 * required to always be higher than this value so this only applies to HTLC outputs (and
9687 * potentially to-self outputs before any payments have been made).
9688 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
9689 * This setting allows you to set a minimum dust limit for their commitment transactions,
9690 * reflecting the reality that tiny outputs are not considered standard transactions and will
9691 * not propagate through the Bitcoin network.
9693 * Default value: 546, the current dust limit on the Bitcoin network.
9695 uint64_t ChannelHandshakeLimits_get_min_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9698 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
9699 * required to always be higher than this value so this only applies to HTLC outputs (and
9700 * potentially to-self outputs before any payments have been made).
9701 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
9702 * This setting allows you to set a minimum dust limit for their commitment transactions,
9703 * reflecting the reality that tiny outputs are not considered standard transactions and will
9704 * not propagate through the Bitcoin network.
9706 * Default value: 546, the current dust limit on the Bitcoin network.
9708 void ChannelHandshakeLimits_set_min_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9711 * Maximum allowed threshold above which outputs will not be generated in their commitment
9713 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
9715 * Default value: u64::max_value.
9717 uint64_t ChannelHandshakeLimits_get_max_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9720 * Maximum allowed threshold above which outputs will not be generated in their commitment
9722 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
9724 * Default value: u64::max_value.
9726 void ChannelHandshakeLimits_set_max_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
9729 * Before a channel is usable the funding transaction will need to be confirmed by at least a
9730 * certain number of blocks, specified by the node which is not the funder (as the funder can
9731 * assume they aren't going to double-spend themselves).
9732 * This config allows you to set a limit on the maximum amount of time to wait.
9734 * Default value: 144, or roughly one day and only applies to outbound channels.
9736 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9739 * Before a channel is usable the funding transaction will need to be confirmed by at least a
9740 * certain number of blocks, specified by the node which is not the funder (as the funder can
9741 * assume they aren't going to double-spend themselves).
9742 * This config allows you to set a limit on the maximum amount of time to wait.
9744 * Default value: 144, or roughly one day and only applies to outbound channels.
9746 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
9749 * Set to force the incoming channel to match our announced channel preference in
9752 * Default value: true, to make the default that no announced channels are possible (which is
9753 * appropriate for any nodes which are not online very reliably).
9755 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9758 * Set to force the incoming channel to match our announced channel preference in
9761 * Default value: true, to make the default that no announced channels are possible (which is
9762 * appropriate for any nodes which are not online very reliably).
9764 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
9767 * Set to the amount of time we're willing to wait to claim money back to us.
9769 * Not checking this value would be a security issue, as our peer would be able to set it to
9770 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
9772 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
9773 * reduce the loss of having useless locked funds (if your peer accepts)
9775 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
9778 * Set to the amount of time we're willing to wait to claim money back to us.
9780 * Not checking this value would be a security issue, as our peer would be able to set it to
9781 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
9783 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
9784 * reduce the loss of having useless locked funds (if your peer accepts)
9786 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
9789 * Constructs a new ChannelHandshakeLimits given each field
9791 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);
9794 * Creates a copy of the ChannelHandshakeLimits
9796 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
9799 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
9801 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
9804 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
9806 void ChannelConfig_free(struct LDKChannelConfig this_obj);
9809 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
9810 * This may be allowed to change at runtime in a later update, however doing so must result in
9811 * update messages sent to notify all nodes of our updated relay fee.
9815 uint32_t ChannelConfig_get_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
9818 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
9819 * This may be allowed to change at runtime in a later update, however doing so must result in
9820 * update messages sent to notify all nodes of our updated relay fee.
9824 void ChannelConfig_set_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
9827 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
9828 * the channel this config applies to.
9830 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
9831 * HTLC balance when a channel appears on-chain whereas
9832 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
9833 * (non-HTLC-encumbered) balance.
9835 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
9836 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
9837 * commitment transaction at least once per this many blocks (minus some margin to allow us
9838 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
9839 * the spending transaction).
9841 * Default value: 72 (12 hours at an average of 6 blocks/hour).
9842 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
9843 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
9845 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
9847 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
9850 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
9851 * the channel this config applies to.
9853 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
9854 * HTLC balance when a channel appears on-chain whereas
9855 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
9856 * (non-HTLC-encumbered) balance.
9858 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
9859 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
9860 * commitment transaction at least once per this many blocks (minus some margin to allow us
9861 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
9862 * the spending transaction).
9864 * Default value: 72 (12 hours at an average of 6 blocks/hour).
9865 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
9866 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
9868 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
9870 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
9873 * Set to announce the channel publicly and notify all nodes that they can route via this
9876 * This should only be set to true for nodes which expect to be online reliably.
9878 * As the node which funds a channel picks this value this will only apply for new outbound
9879 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
9881 * This cannot be changed after the initial channel handshake.
9883 * Default value: false.
9885 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
9888 * Set to announce the channel publicly and notify all nodes that they can route via this
9891 * This should only be set to true for nodes which expect to be online reliably.
9893 * As the node which funds a channel picks this value this will only apply for new outbound
9894 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
9896 * This cannot be changed after the initial channel handshake.
9898 * Default value: false.
9900 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
9903 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
9904 * supports it, they will then enforce the mutual-close output to us matches what we provided
9905 * at intialization, preventing us from closing to an alternate pubkey.
9907 * This is set to true by default to provide a slight increase in security, though ultimately
9908 * any attacker who is able to take control of a channel can just as easily send the funds via
9909 * lightning payments, so we never require that our counterparties support this option.
9911 * This cannot be changed after a channel has been initialized.
9913 * Default value: true.
9915 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
9918 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
9919 * supports it, they will then enforce the mutual-close output to us matches what we provided
9920 * at intialization, preventing us from closing to an alternate pubkey.
9922 * This is set to true by default to provide a slight increase in security, though ultimately
9923 * any attacker who is able to take control of a channel can just as easily send the funds via
9924 * lightning payments, so we never require that our counterparties support this option.
9926 * This cannot be changed after a channel has been initialized.
9928 * Default value: true.
9930 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
9933 * Constructs a new ChannelConfig given each field
9935 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);
9938 * Creates a copy of the ChannelConfig
9940 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
9943 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
9945 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
9948 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
9950 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
9953 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
9955 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
9958 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
9960 void UserConfig_free(struct LDKUserConfig this_obj);
9963 * Channel config that we propose to our counterparty.
9965 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
9968 * Channel config that we propose to our counterparty.
9970 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
9973 * Limits applied to our counterparty's proposed channel config settings.
9975 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
9978 * Limits applied to our counterparty's proposed channel config settings.
9980 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
9983 * Channel config which affects behavior during channel lifetime.
9985 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
9988 * Channel config which affects behavior during channel lifetime.
9990 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
9993 * Constructs a new UserConfig given each field
9995 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);
9998 * Creates a copy of the UserConfig
10000 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
10003 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
10005 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
10008 * Creates a copy of the AccessError
10010 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
10013 * Calls the free function if one is set
10015 void Access_free(struct LDKAccess this_ptr);
10018 * Calls the free function if one is set
10020 void Listen_free(struct LDKListen this_ptr);
10023 * Calls the free function if one is set
10025 void Watch_free(struct LDKWatch this_ptr);
10028 * Calls the free function if one is set
10030 void Filter_free(struct LDKFilter this_ptr);
10033 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
10035 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
10038 * First block where the transaction output may have been spent.
10040 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
10043 * First block where the transaction output may have been spent.
10045 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10048 * Outpoint identifying the transaction output.
10050 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
10053 * Outpoint identifying the transaction output.
10055 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
10058 * Spending condition of the transaction output.
10060 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
10063 * Spending condition of the transaction output.
10065 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
10068 * Constructs a new WatchedOutput given each field
10070 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
10073 * Calls the free function if one is set
10075 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
10078 * Creates a copy of the ConfirmationTarget
10080 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
10083 * Calls the free function if one is set
10085 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
10088 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
10090 void ChainMonitor_free(struct LDKChainMonitor this_obj);
10093 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
10094 * of a channel and reacting accordingly based on transactions in the connected block. See
10095 * [`ChannelMonitor::block_connected`] for details. Any HTLCs that were resolved on chain will
10096 * be returned by [`chain::Watch::release_pending_monitor_events`].
10098 * Calls back to [`chain::Filter`] if any monitor indicated new outputs to watch. Subsequent
10099 * calls must not exclude any transactions matching the new outputs nor any in-block
10100 * descendants of such transactions. It is not necessary to re-fetch the block to obtain
10101 * updated `txdata`.
10103 void ChainMonitor_block_connected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
10106 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
10107 * of a channel based on the disconnected block. See [`ChannelMonitor::block_disconnected`] for
10110 void ChainMonitor_block_disconnected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t disconnected_height);
10113 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
10115 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
10116 * will call back to it indicating transactions and outputs of interest. This allows clients to
10117 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
10118 * always need to fetch full blocks absent another means for determining which blocks contain
10119 * transactions relevant to the watched channels.
10121 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
10124 * Constructs a new Watch which calls the relevant methods on this_arg.
10125 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
10127 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
10130 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
10131 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
10133 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
10136 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
10138 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
10141 * The sequence number of this update. Updates *must* be replayed in-order according to this
10142 * sequence number (and updates may panic if they are not). The update_id values are strictly
10143 * increasing and increase by one for each new update, with one exception specified below.
10145 * This sequence number is also used to track up to which points updates which returned
10146 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
10147 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
10149 * The only instance where update_id values are not strictly increasing is the case where we
10150 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
10151 * its docs for more details.
10153 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
10156 * The sequence number of this update. Updates *must* be replayed in-order according to this
10157 * sequence number (and updates may panic if they are not). The update_id values are strictly
10158 * increasing and increase by one for each new update, with one exception specified below.
10160 * This sequence number is also used to track up to which points updates which returned
10161 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
10162 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
10164 * The only instance where update_id values are not strictly increasing is the case where we
10165 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
10166 * its docs for more details.
10168 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
10171 * Creates a copy of the ChannelMonitorUpdate
10173 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
10176 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
10178 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
10181 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
10183 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
10186 * Creates a copy of the ChannelMonitorUpdateErr
10188 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
10191 * Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
10193 void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
10196 * Creates a copy of the MonitorUpdateError
10198 struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
10201 * Frees any resources used by the MonitorEvent
10203 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
10206 * Creates a copy of the MonitorEvent
10208 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
10211 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
10213 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
10216 * Creates a copy of the HTLCUpdate
10218 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
10221 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
10223 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
10226 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
10228 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
10231 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
10233 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
10236 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
10238 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
10241 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
10244 * panics if the given update is not the next update by update_id.
10246 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);
10249 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
10252 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10255 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
10257 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10260 * Gets a list of txids, with their output scripts (in the order they appear in the
10261 * transaction), which we must learn about spends of via block_connected().
10263 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10266 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
10267 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
10268 * have been registered.
10270 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
10273 * Get the list of HTLCs who's status has been updated on chain. This should be called by
10274 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
10276 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10279 * Gets the list of pending events which were generated by previous actions, clearing the list
10282 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
10283 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
10284 * no internal locking in ChannelMonitors.
10286 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
10289 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
10290 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
10291 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
10292 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
10293 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
10294 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
10295 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
10296 * out-of-band the other node operator to coordinate with him if option is available to you.
10297 * In any-case, choice is up to the user.
10299 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);
10302 * Processes transactions in a newly connected block, which may result in any of the following:
10303 * - update the monitor's state against resolved HTLCs
10304 * - punish the counterparty in the case of seeing a revoked commitment transaction
10305 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
10306 * - detect settled outputs for later spending
10307 * - schedule and bump any in-flight claims
10309 * Returns any new outputs to watch from `txdata`; after called, these are also included in
10310 * [`get_outputs_to_watch`].
10312 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
10314 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ 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);
10317 * Determines if the disconnected block contained any transactions of interest and updates
10320 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);
10323 * Calls the free function if one is set
10325 void Persist_free(struct LDKPersist this_ptr);
10328 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
10330 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
10333 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
10335 void OutPoint_free(struct LDKOutPoint this_obj);
10338 * The referenced transaction's txid.
10340 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
10343 * The referenced transaction's txid.
10345 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10348 * The index of the referenced output in its transaction's vout.
10350 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
10353 * The index of the referenced output in its transaction's vout.
10355 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
10358 * Constructs a new OutPoint given each field
10360 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
10363 * Creates a copy of the OutPoint
10365 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
10368 * Convert an `OutPoint` to a lightning channel id.
10370 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
10373 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
10375 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
10378 * Read a OutPoint from a byte array, created by OutPoint_write
10380 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
10383 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
10385 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
10388 * The outpoint which is spendable
10390 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10393 * The outpoint which is spendable
10395 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
10398 * Per commitment point to derive delayed_payment_key by key holder
10400 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10403 * Per commitment point to derive delayed_payment_key by key holder
10405 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10408 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
10409 * the witness_script.
10411 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10414 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
10415 * the witness_script.
10417 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
10420 * The output which is referenced by the given outpoint
10422 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
10425 * The revocation point specific to the commitment transaction which was broadcast. Used to
10426 * derive the witnessScript for this output.
10428 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10431 * The revocation point specific to the commitment transaction which was broadcast. Used to
10432 * derive the witnessScript for this output.
10434 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10437 * Arbitrary identification information returned by a call to
10438 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
10439 * the channel to spend the output.
10441 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
10444 * Arbitrary identification information returned by a call to
10445 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
10446 * the channel to spend the output.
10448 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10451 * The value of the channel which this output originated from, possibly indirectly.
10453 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10456 * The value of the channel which this output originated from, possibly indirectly.
10458 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
10461 * Constructs a new DelayedPaymentOutputDescriptor given each field
10463 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);
10466 * Creates a copy of the DelayedPaymentOutputDescriptor
10468 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
10471 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
10473 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
10476 * The outpoint which is spendable
10478 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10481 * The outpoint which is spendable
10483 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
10486 * The output which is referenced by the given outpoint
10488 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
10491 * Arbitrary identification information returned by a call to
10492 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
10493 * the channel to spend the output.
10495 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
10498 * Arbitrary identification information returned by a call to
10499 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
10500 * the channel to spend the output.
10502 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10505 * The value of the channel which this transactions spends.
10507 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
10510 * The value of the channel which this transactions spends.
10512 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
10515 * Constructs a new StaticPaymentOutputDescriptor given each field
10517 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);
10520 * Creates a copy of the StaticPaymentOutputDescriptor
10522 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
10525 * Frees any resources used by the SpendableOutputDescriptor
10527 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
10530 * Creates a copy of the SpendableOutputDescriptor
10532 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
10535 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
10537 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
10540 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
10542 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
10545 * Calls the free function if one is set
10547 void BaseSign_free(struct LDKBaseSign this_ptr);
10550 * Creates a copy of a Sign
10552 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
10555 * Calls the free function if one is set
10557 void Sign_free(struct LDKSign this_ptr);
10560 * Calls the free function if one is set
10562 void KeysInterface_free(struct LDKKeysInterface this_ptr);
10565 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
10567 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
10570 * Private key of anchor tx
10572 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10575 * Private key of anchor tx
10577 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10580 * Holder secret key for blinded revocation pubkey
10582 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10585 * Holder secret key for blinded revocation pubkey
10587 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10590 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
10592 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10595 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
10597 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10600 * Holder secret key used in HTLC tx
10602 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10605 * Holder secret key used in HTLC tx
10607 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10610 * Holder htlc secret key used in commitment tx htlc outputs
10612 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10615 * Holder htlc secret key used in commitment tx htlc outputs
10617 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
10622 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
10627 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10630 * Creates a copy of the InMemorySigner
10632 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
10635 * Create a new InMemorySigner
10637 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);
10640 * Counterparty pubkeys.
10641 * Will panic if ready_channel wasn't called.
10643 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10646 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
10647 * transactions, ie the amount of time that we have to wait to recover our funds if we
10648 * broadcast a transaction.
10649 * Will panic if ready_channel wasn't called.
10651 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10654 * The contest_delay value specified by us and applied on transactions broadcastable
10655 * by our counterparty, ie the amount of time that they have to wait to recover their funds
10656 * if they broadcast a transaction.
10657 * Will panic if ready_channel wasn't called.
10659 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10662 * Whether the holder is the initiator
10663 * Will panic if ready_channel wasn't called.
10665 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10669 * Will panic if ready_channel wasn't called.
10671 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10674 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
10675 * building transactions.
10677 * Will panic if ready_channel wasn't called.
10679 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10682 * Sign the single input of spend_tx at index `input_idx` which spends the output
10683 * described by descriptor, returning the witness stack for the input.
10685 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
10686 * or is not spending the outpoint described by `descriptor.outpoint`.
10688 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);
10691 * Sign the single input of spend_tx at index `input_idx` which spends the output
10692 * described by descriptor, returning the witness stack for the input.
10694 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
10695 * is not spending the outpoint described by `descriptor.outpoint`, or does not have a
10696 * sequence set to `descriptor.to_self_delay`.
10698 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);
10701 * Constructs a new BaseSign which calls the relevant methods on this_arg.
10702 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
10704 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10707 * Constructs a new Sign which calls the relevant methods on this_arg.
10708 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
10710 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
10713 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
10715 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
10718 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
10720 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
10723 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
10725 void KeysManager_free(struct LDKKeysManager this_obj);
10728 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
10729 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
10730 * starting_time isn't strictly required to actually be a time, but it must absolutely,
10731 * without a doubt, be unique to this instance. ie if you start multiple times with the same
10732 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
10733 * simply use the current time (with very high precision).
10735 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
10736 * obviously, starting_time should be unique every time you reload the library - it is only
10737 * used to generate new ephemeral key data (which will be stored by the individual channel if
10740 * Note that the seed is required to recover certain on-chain funds independent of
10741 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
10742 * channel, and some on-chain during-closing funds.
10744 * Note that until the 0.1 release there is no guarantee of backward compatibility between
10745 * versions. Once the library is more fully supported, the docs will be updated to include a
10746 * detailed description of the guarantee.
10748 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
10751 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
10753 * Key derivation parameters are accessible through a per-channel secrets
10754 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
10755 * onchain output detection for which a corresponding delayed_payment_key must be derived.
10757 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]);
10760 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
10761 * output to the given change destination (if sufficient change value remains). The
10762 * transaction will have a feerate, at least, of the given value.
10764 * Returns `Err(())` if the output value is greater than the input value minus required fee or
10765 * if a descriptor was duplicated.
10767 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
10769 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
10770 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
10772 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);
10775 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
10776 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
10778 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
10781 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
10783 void ChannelManager_free(struct LDKChannelManager this_obj);
10786 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
10788 void ChainParameters_free(struct LDKChainParameters this_obj);
10791 * The network for determining the `chain_hash` in Lightning messages.
10793 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
10796 * The network for determining the `chain_hash` in Lightning messages.
10798 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
10801 * The hash of the latest block successfully connected.
10803 const uint8_t (*ChainParameters_get_latest_hash(const struct LDKChainParameters *NONNULL_PTR this_ptr))[32];
10806 * The hash of the latest block successfully connected.
10808 void ChainParameters_set_latest_hash(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10811 * The height of the latest block successfully connected.
10813 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
10815 uintptr_t ChainParameters_get_latest_height(const struct LDKChainParameters *NONNULL_PTR this_ptr);
10818 * The height of the latest block successfully connected.
10820 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
10822 void ChainParameters_set_latest_height(struct LDKChainParameters *NONNULL_PTR this_ptr, uintptr_t val);
10825 * Constructs a new ChainParameters given each field
10827 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKThirtyTwoBytes latest_hash_arg, uintptr_t latest_height_arg);
10830 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
10832 void ChannelDetails_free(struct LDKChannelDetails this_obj);
10835 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
10836 * thereafter this is the txid of the funding transaction xor the funding transaction output).
10837 * Note that this means this value is *not* persistent - it can change once during the
10838 * lifetime of the channel.
10840 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
10843 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
10844 * thereafter this is the txid of the funding transaction xor the funding transaction output).
10845 * Note that this means this value is *not* persistent - it can change once during the
10846 * lifetime of the channel.
10848 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10851 * The position of the funding transaction in the chain. None if the funding transaction has
10852 * not yet been confirmed and the channel fully opened.
10854 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
10857 * The position of the funding transaction in the chain. None if the funding transaction has
10858 * not yet been confirmed and the channel fully opened.
10860 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
10863 * The node_id of our counterparty
10865 struct LDKPublicKey ChannelDetails_get_remote_network_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
10868 * The node_id of our counterparty
10870 void ChannelDetails_set_remote_network_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10873 * The Features the channel counterparty provided upon last connection.
10874 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
10875 * many routing-relevant features are present in the init context.
10877 struct LDKInitFeatures ChannelDetails_get_counterparty_features(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
10880 * The Features the channel counterparty provided upon last connection.
10881 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
10882 * many routing-relevant features are present in the init context.
10884 void ChannelDetails_set_counterparty_features(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
10887 * The value, in satoshis, of this channel as appears in the funding output
10889 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
10892 * The value, in satoshis, of this channel as appears in the funding output
10894 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
10897 * The user_id passed in to create_channel, or 0 if the channel was inbound.
10899 uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
10902 * The user_id passed in to create_channel, or 0 if the channel was inbound.
10904 void ChannelDetails_set_user_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
10907 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
10908 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
10909 * available for inclusion in new outbound HTLCs). This further does not include any pending
10910 * outgoing HTLCs which are awaiting some other resolution to be sent.
10912 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
10915 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
10916 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
10917 * available for inclusion in new outbound HTLCs). This further does not include any pending
10918 * outgoing HTLCs which are awaiting some other resolution to be sent.
10920 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
10923 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
10924 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
10925 * available for inclusion in new inbound HTLCs).
10926 * Note that there are some corner cases not fully handled here, so the actual available
10927 * inbound capacity may be slightly higher than this.
10929 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
10932 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
10933 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
10934 * available for inclusion in new inbound HTLCs).
10935 * Note that there are some corner cases not fully handled here, so the actual available
10936 * inbound capacity may be slightly higher than this.
10938 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
10941 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
10942 * the peer is connected, and (c) no monitor update failure is pending resolution.
10944 bool ChannelDetails_get_is_live(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
10947 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
10948 * the peer is connected, and (c) no monitor update failure is pending resolution.
10950 void ChannelDetails_set_is_live(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
10953 * Creates a copy of the ChannelDetails
10955 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
10958 * Frees any resources used by the PaymentSendFailure
10960 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
10963 * Creates a copy of the PaymentSendFailure
10965 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
10968 * Constructs a new ChannelManager to hold several channels and route between them.
10970 * This is the main \"logic hub\" for all channel-related actions, and implements
10971 * ChannelMessageHandler.
10973 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
10975 * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
10977 * Users need to notify the new ChannelManager when a new block is connected or
10978 * disconnected using its `block_connected` and `block_disconnected` methods, starting
10979 * from after `params.latest_hash`.
10981 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);
10984 * Creates a new outbound channel to the given remote node and with the given value.
10986 * user_id will be provided back as user_channel_id in FundingGenerationReady events to allow
10987 * tracking of which events correspond with which create_channel call. Note that the
10988 * user_channel_id defaults to 0 for inbound channels, so you may wish to avoid using 0 for
10989 * user_id here. user_id has no meaning inside of LDK, it is simply copied to events and
10990 * otherwise ignored.
10992 * If successful, will generate a SendOpenChannel message event, so you should probably poll
10993 * PeerManager::process_events afterwards.
10995 * Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
10996 * greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
10998 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);
11001 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
11002 * more information.
11004 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
11007 * Gets the list of usable channels, in random order. Useful as an argument to
11008 * get_route to ensure non-announced channels are used.
11010 * These are guaranteed to have their is_live value set to true, see the documentation for
11011 * ChannelDetails::is_live for more info on exactly what the criteria are.
11013 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
11016 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
11017 * will be accepted on the given channel, and after additional timeout/the closing of all
11018 * pending HTLCs, the channel will be closed on chain.
11020 * May generate a SendShutdown message event on success, which should be relayed.
11022 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
11025 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
11026 * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
11028 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
11031 * Force close all channels, immediately broadcasting the latest local commitment transaction
11032 * for each to the chain and rejecting new HTLCs on each.
11034 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
11037 * Sends a payment along a given route.
11039 * Value parameters are provided via the last hop in route, see documentation for RouteHop
11040 * fields for more info.
11042 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
11043 * payment), we don't do anything to stop you! We always try to ensure that if the provided
11044 * next hop knows the preimage to payment_hash they can claim an additional amount as
11045 * specified in the last hop in the route! Thus, you should probably do your own
11046 * payment_preimage tracking (which you should already be doing as they represent \"proof of
11047 * payment\") and prevent double-sends yourself.
11049 * May generate SendHTLCs message(s) event on success, which should be relayed.
11051 * Each path may have a different return value, and PaymentSendValue may return a Vec with
11052 * each entry matching the corresponding-index entry in the route paths, see
11053 * PaymentSendFailure for more info.
11055 * In general, a path may raise:
11056 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
11057 * node public key) is specified.
11058 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
11059 * (including due to previous monitor update failure or new permanent monitor update
11061 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
11062 * relevant updates.
11064 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
11065 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
11066 * different route unless you intend to pay twice!
11068 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
11069 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
11070 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
11071 * must not contain multiple paths as multi-path payments require a recipient-provided
11073 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
11074 * bit set (either as required or as available). If multiple paths are present in the Route,
11075 * we assume the invoice had the basic_mpp feature set.
11077 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);
11080 * Call this upon creation of a funding transaction for the given channel.
11082 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
11083 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
11085 * Panics if a funding transaction has already been provided for this channel.
11087 * May panic if the output found in the funding transaction is duplicative with some other
11088 * channel (note that this should be trivially prevented by using unique funding transaction
11089 * keys per-channel).
11091 * Do NOT broadcast the funding transaction yourself. When we have safely received our
11092 * counterparty's signature the funding transaction will automatically be broadcast via the
11093 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
11095 * Note that this includes RBF or similar transaction replacement strategies - lightning does
11096 * not currently support replacing a funding transaction on an existing channel. Instead,
11097 * create a new channel with a conflicting funding transaction.
11099 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);
11102 * Generates a signed node_announcement from the given arguments and creates a
11103 * BroadcastNodeAnnouncement event. Note that such messages will be ignored unless peers have
11104 * seen a channel_announcement from us (ie unless we have public channels open).
11106 * RGB is a node \"color\" and alias is a printable human-readable string to describe this node
11107 * to humans. They carry no in-protocol meaning.
11109 * addresses represent the set (possibly empty) of socket addresses on which this node accepts
11110 * incoming connections. These will be broadcast to the network, publicly tying these
11111 * addresses together. If you wish to preserve user privacy, addresses should likely contain
11112 * only Tor Onion addresses.
11114 * Panics if addresses is absurdly large (more than 500).
11116 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
11119 * Processes HTLCs which are pending waiting on random forward delay.
11121 * Should only really ever be called in response to a PendingHTLCsForwardable event.
11122 * Will likely generate further events.
11124 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
11127 * If a peer is disconnected we mark any channels with that peer as 'disabled'.
11128 * After some time, if channels are still disabled we need to broadcast a ChannelUpdate
11129 * to inform the network about the uselessness of these channels.
11131 * This method handles all the details, and must be called roughly once per minute.
11133 * Note that in some rare cases this may generate a `chain::Watch::update_channel` call.
11135 void ChannelManager_timer_chan_freshness_every_min(const struct LDKChannelManager *NONNULL_PTR this_arg);
11138 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
11139 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
11140 * along the path (including in our own channel on which we received it).
11141 * Returns false if no payment was found to fail backwards, true if the process of failing the
11142 * HTLC backwards has been started.
11144 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);
11147 * Provides a payment preimage in response to a PaymentReceived event, returning true and
11148 * generating message events for the net layer to claim the payment, if possible. Thus, you
11149 * should probably kick the net layer to go send messages if this returns true!
11151 * You must specify the expected amounts for this HTLC, and we will only claim HTLCs
11152 * available within a few percent of the expected amount. This is critical for several
11153 * reasons : a) it avoids providing senders with `proof-of-payment` (in the form of the
11154 * payment_preimage without having provided the full value and b) it avoids certain
11155 * privacy-breaking recipient-probing attacks which may reveal payment activity to
11156 * motivated attackers.
11158 * Note that the privacy concerns in (b) are not relevant in payments with a payment_secret
11159 * set. Thus, for such payments we will claim any payments which do not under-pay.
11161 * May panic if called except in response to a PaymentReceived event.
11163 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);
11166 * Gets the node_id held by this ChannelManager
11168 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
11171 * Restores a single, given channel to normal operation after a
11172 * ChannelMonitorUpdateErr::TemporaryFailure was returned from a channel monitor update
11175 * All ChannelMonitor updates up to and including highest_applied_update_id must have been
11176 * fully committed in every copy of the given channels' ChannelMonitors.
11178 * Note that there is no effect to calling with a highest_applied_update_id other than the
11179 * current latest ChannelMonitorUpdate and one call to this function after multiple
11180 * ChannelMonitorUpdateErr::TemporaryFailures is fine. The highest_applied_update_id field
11181 * exists largely only to prevent races between this and concurrent update_monitor calls.
11183 * Thus, the anticipated use is, at a high level:
11184 * 1) You register a chain::Watch with this ChannelManager,
11185 * 2) it stores each update to disk, and begins updating any remote (eg watchtower) copies of
11186 * said ChannelMonitors as it can, returning ChannelMonitorUpdateErr::TemporaryFailures
11187 * any time it cannot do so instantly,
11188 * 3) update(s) are applied to each remote copy of a ChannelMonitor,
11189 * 4) once all remote copies are updated, you call this function with the update_id that
11190 * completed, and once it is the latest the Channel will be re-enabled.
11192 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);
11195 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
11196 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
11198 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
11201 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
11202 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
11204 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
11207 * Constructs a new Listen which calls the relevant methods on this_arg.
11208 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
11210 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
11213 * Updates channel state to take note of transactions which were confirmed in the given block
11214 * at the given height.
11216 * Note that you must still call (or have called) [`update_best_block`] with the block
11217 * information which is included here.
11219 * This method may be called before or after [`update_best_block`] for a given block's
11220 * transaction data and may be called multiple times with additional transaction data for a
11223 * This method may be called for a previous block after an [`update_best_block`] call has
11224 * been made for a later block, however it must *not* be called with transaction data from a
11225 * block which is no longer in the best chain (ie where [`update_best_block`] has already
11226 * been informed about a blockchain reorganization which no longer includes the block which
11227 * corresponds to `header`).
11229 * [`update_best_block`]: `Self::update_best_block`
11231 void ChannelManager_transactions_confirmed(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKCVec_C2Tuple_usizeTransactionZZ txdata);
11234 * Updates channel state with the current best blockchain tip. You should attempt to call this
11235 * quickly after a new block becomes available, however if multiple new blocks become
11236 * available at the same time, only a single `update_best_block()` call needs to be made.
11238 * This method should also be called immediately after any block disconnections, once at the
11239 * reorganization fork point, and once with the new chain tip. Calling this method at the
11240 * blockchain reorganization fork point ensures we learn when a funding transaction which was
11241 * previously confirmed is reorganized out of the blockchain, ensuring we do not continue to
11242 * accept payments which cannot be enforced on-chain.
11244 * In both the block-connection and block-disconnection case, this method may be called either
11245 * once per block connected or disconnected, or simply at the fork point and new tip(s),
11246 * skipping any intermediary blocks.
11248 void ChannelManager_update_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height);
11251 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
11252 * indicating whether persistence is necessary. Only one listener on
11253 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
11255 * Note that the feature `allow_wallclock_use` must be enabled to use this function.
11257 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
11260 * Blocks until ChannelManager needs to be persisted. Only one listener on
11261 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
11264 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
11267 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
11268 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
11270 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
11273 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
11275 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
11278 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
11280 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
11283 * The keys provider which will give us relevant keys. Some keys will be loaded during
11284 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
11287 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11290 * The keys provider which will give us relevant keys. Some keys will be loaded during
11291 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
11294 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
11297 * The fee_estimator for use in the ChannelManager in the future.
11299 * No calls to the FeeEstimator will be made during deserialization.
11301 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11304 * The fee_estimator for use in the ChannelManager in the future.
11306 * No calls to the FeeEstimator will be made during deserialization.
11308 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
11311 * The chain::Watch for use in the ChannelManager in the future.
11313 * No calls to the chain::Watch will be made during deserialization. It is assumed that
11314 * you have deserialized ChannelMonitors separately and will add them to your
11315 * chain::Watch after deserializing this ChannelManager.
11317 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11320 * The chain::Watch for use in the ChannelManager in the future.
11322 * No calls to the chain::Watch will be made during deserialization. It is assumed that
11323 * you have deserialized ChannelMonitors separately and will add them to your
11324 * chain::Watch after deserializing this ChannelManager.
11326 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
11329 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
11330 * used to broadcast the latest local commitment transactions of channels which must be
11331 * force-closed during deserialization.
11333 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11336 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
11337 * used to broadcast the latest local commitment transactions of channels which must be
11338 * force-closed during deserialization.
11340 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
11343 * The Logger for use in the ChannelManager and which may be used to log information during
11346 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11349 * The Logger for use in the ChannelManager and which may be used to log information during
11352 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
11355 * Default settings used for new channels. Any existing channels will continue to use the
11356 * runtime settings which were stored when the ChannelManager was serialized.
11358 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
11361 * Default settings used for new channels. Any existing channels will continue to use the
11362 * runtime settings which were stored when the ChannelManager was serialized.
11364 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
11367 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
11368 * HashMap for you. This is primarily useful for C bindings where it is not practical to
11369 * populate a HashMap directly from C.
11371 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);
11374 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
11376 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
11379 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
11381 void DecodeError_free(struct LDKDecodeError this_obj);
11384 * Creates a copy of the DecodeError
11386 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
11389 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
11391 void Init_free(struct LDKInit this_obj);
11394 * The relevant features which the sender supports
11396 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
11399 * The relevant features which the sender supports
11401 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
11404 * Constructs a new Init given each field
11406 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
11409 * Creates a copy of the Init
11411 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
11414 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
11416 void ErrorMessage_free(struct LDKErrorMessage this_obj);
11419 * The channel ID involved in the error
11421 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
11424 * The channel ID involved in the error
11426 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11429 * A possibly human-readable error description.
11430 * The string should be sanitized before it is used (e.g. emitted to logs
11431 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
11432 * vulnerability in the terminal emulator or the logging subsystem.
11434 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
11437 * A possibly human-readable error description.
11438 * The string should be sanitized before it is used (e.g. emitted to logs
11439 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
11440 * vulnerability in the terminal emulator or the logging subsystem.
11442 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
11445 * Constructs a new ErrorMessage given each field
11447 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg);
11450 * Creates a copy of the ErrorMessage
11452 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
11455 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
11457 void Ping_free(struct LDKPing this_obj);
11460 * The desired response length
11462 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
11465 * The desired response length
11467 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
11470 * The ping packet size.
11471 * This field is not sent on the wire. byteslen zeros are sent.
11473 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
11476 * The ping packet size.
11477 * This field is not sent on the wire. byteslen zeros are sent.
11479 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
11482 * Constructs a new Ping given each field
11484 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
11487 * Creates a copy of the Ping
11489 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
11492 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
11494 void Pong_free(struct LDKPong this_obj);
11497 * The pong packet size.
11498 * This field is not sent on the wire. byteslen zeros are sent.
11500 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
11503 * The pong packet size.
11504 * This field is not sent on the wire. byteslen zeros are sent.
11506 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
11509 * Constructs a new Pong given each field
11511 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
11514 * Creates a copy of the Pong
11516 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
11519 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
11521 void OpenChannel_free(struct LDKOpenChannel this_obj);
11524 * The genesis hash of the blockchain where the channel is to be opened
11526 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
11529 * The genesis hash of the blockchain where the channel is to be opened
11531 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11534 * A temporary channel ID, until the funding outpoint is announced
11536 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
11539 * A temporary channel ID, until the funding outpoint is announced
11541 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11544 * The channel value
11546 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11549 * The channel value
11551 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11554 * The amount to push to the counterparty as part of the open, in milli-satoshi
11556 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11559 * The amount to push to the counterparty as part of the open, in milli-satoshi
11561 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11564 * The threshold below which outputs on transactions broadcast by sender will be omitted
11566 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11569 * The threshold below which outputs on transactions broadcast by sender will be omitted
11571 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11574 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
11576 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11579 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
11581 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11584 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
11586 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11589 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
11591 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11594 * The minimum HTLC size incoming to sender, in milli-satoshi
11596 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11599 * The minimum HTLC size incoming to sender, in milli-satoshi
11601 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
11604 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
11606 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11609 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
11611 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
11614 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
11616 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11619 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
11621 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
11624 * The maximum number of inbound HTLCs towards sender
11626 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11629 * The maximum number of inbound HTLCs towards sender
11631 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
11634 * The sender's key controlling the funding transaction
11636 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11639 * The sender's key controlling the funding transaction
11641 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11644 * Used to derive a revocation key for transactions broadcast by counterparty
11646 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11649 * Used to derive a revocation key for transactions broadcast by counterparty
11651 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11654 * A payment key to sender for transactions broadcast by counterparty
11656 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11659 * A payment key to sender for transactions broadcast by counterparty
11661 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11664 * Used to derive a payment key to sender for transactions broadcast by sender
11666 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11669 * Used to derive a payment key to sender for transactions broadcast by sender
11671 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11674 * Used to derive an HTLC payment key to sender
11676 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11679 * Used to derive an HTLC payment key to sender
11681 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11684 * The first to-be-broadcast-by-sender transaction's per commitment point
11686 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11689 * The first to-be-broadcast-by-sender transaction's per commitment point
11691 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11696 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
11701 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
11704 * Creates a copy of the OpenChannel
11706 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
11709 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
11711 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
11714 * A temporary channel ID, until the funding outpoint is announced
11716 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
11719 * A temporary channel ID, until the funding outpoint is announced
11721 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11724 * The threshold below which outputs on transactions broadcast by sender will be omitted
11726 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
11729 * The threshold below which outputs on transactions broadcast by sender will be omitted
11731 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
11734 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
11736 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
11739 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
11741 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
11744 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
11746 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
11749 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
11751 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
11754 * The minimum HTLC size incoming to sender, in milli-satoshi
11756 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
11759 * The minimum HTLC size incoming to sender, in milli-satoshi
11761 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
11764 * Minimum depth of the funding transaction before the channel is considered open
11766 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
11769 * Minimum depth of the funding transaction before the channel is considered open
11771 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
11774 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
11776 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
11779 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
11781 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
11784 * The maximum number of inbound HTLCs towards sender
11786 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
11789 * The maximum number of inbound HTLCs towards sender
11791 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
11794 * The sender's key controlling the funding transaction
11796 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
11799 * The sender's key controlling the funding transaction
11801 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11804 * Used to derive a revocation key for transactions broadcast by counterparty
11806 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
11809 * Used to derive a revocation key for transactions broadcast by counterparty
11811 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11814 * A payment key to sender for transactions broadcast by counterparty
11816 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
11819 * A payment key to sender for transactions broadcast by counterparty
11821 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11824 * Used to derive a payment key to sender for transactions broadcast by sender
11826 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
11829 * Used to derive a payment key to sender for transactions broadcast by sender
11831 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11834 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
11836 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
11839 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
11841 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11844 * The first to-be-broadcast-by-sender transaction's per commitment point
11846 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
11849 * The first to-be-broadcast-by-sender transaction's per commitment point
11851 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11854 * Creates a copy of the AcceptChannel
11856 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
11859 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
11861 void FundingCreated_free(struct LDKFundingCreated this_obj);
11864 * A temporary channel ID, until the funding is established
11866 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
11869 * A temporary channel ID, until the funding is established
11871 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11874 * The funding transaction ID
11876 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
11879 * The funding transaction ID
11881 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11884 * The specific output index funding this channel
11886 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
11889 * The specific output index funding this channel
11891 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
11894 * The signature of the channel initiator (funder) on the funding transaction
11896 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
11899 * The signature of the channel initiator (funder) on the funding transaction
11901 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
11904 * Constructs a new FundingCreated given each field
11906 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);
11909 * Creates a copy of the FundingCreated
11911 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
11914 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
11916 void FundingSigned_free(struct LDKFundingSigned this_obj);
11921 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
11926 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11929 * The signature of the channel acceptor (fundee) on the funding transaction
11931 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
11934 * The signature of the channel acceptor (fundee) on the funding transaction
11936 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
11939 * Constructs a new FundingSigned given each field
11941 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
11944 * Creates a copy of the FundingSigned
11946 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
11949 * Frees any resources used by the FundingLocked, if is_owned is set and inner is non-NULL.
11951 void FundingLocked_free(struct LDKFundingLocked this_obj);
11956 const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32];
11961 void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11964 * The per-commitment point of the second commitment transaction
11966 struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr);
11969 * The per-commitment point of the second commitment transaction
11971 void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11974 * Constructs a new FundingLocked given each field
11976 MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
11979 * Creates a copy of the FundingLocked
11981 struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
11984 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
11986 void Shutdown_free(struct LDKShutdown this_obj);
11991 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
11996 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11999 * The destination of this peer's funds on closing.
12000 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
12002 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
12005 * The destination of this peer's funds on closing.
12006 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
12008 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
12011 * Constructs a new Shutdown given each field
12013 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
12016 * Creates a copy of the Shutdown
12018 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
12021 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
12023 void ClosingSigned_free(struct LDKClosingSigned this_obj);
12028 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
12033 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12036 * The proposed total fee for the closing transaction
12038 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
12041 * The proposed total fee for the closing transaction
12043 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
12046 * A signature on the closing transaction
12048 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
12051 * A signature on the closing transaction
12053 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
12056 * Constructs a new ClosingSigned given each field
12058 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg);
12061 * Creates a copy of the ClosingSigned
12063 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
12066 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
12068 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
12073 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
12078 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12083 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
12088 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
12091 * The HTLC value in milli-satoshi
12093 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
12096 * The HTLC value in milli-satoshi
12098 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
12101 * The payment hash, the pre-image of which controls HTLC redemption
12103 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
12106 * The payment hash, the pre-image of which controls HTLC redemption
12108 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12111 * The expiry height of the HTLC
12113 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
12116 * The expiry height of the HTLC
12118 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
12121 * Creates a copy of the UpdateAddHTLC
12123 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
12126 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
12128 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
12133 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
12138 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12143 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
12148 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
12151 * The pre-image of the payment hash, allowing HTLC redemption
12153 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
12156 * The pre-image of the payment hash, allowing HTLC redemption
12158 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12161 * Constructs a new UpdateFulfillHTLC given each field
12163 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
12166 * Creates a copy of the UpdateFulfillHTLC
12168 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
12171 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
12173 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
12178 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
12183 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12188 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
12193 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
12196 * Creates a copy of the UpdateFailHTLC
12198 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
12201 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
12203 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
12208 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
12213 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12218 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
12223 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
12228 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
12233 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
12236 * Creates a copy of the UpdateFailMalformedHTLC
12238 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
12241 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
12243 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
12248 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
12253 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12256 * A signature on the commitment transaction
12258 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
12261 * A signature on the commitment transaction
12263 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
12266 * Signatures on the HTLC transactions
12268 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
12271 * Constructs a new CommitmentSigned given each field
12273 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
12276 * Creates a copy of the CommitmentSigned
12278 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
12281 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
12283 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
12288 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
12293 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12296 * The secret corresponding to the per-commitment point
12298 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
12301 * The secret corresponding to the per-commitment point
12303 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12306 * The next sender-broadcast commitment transaction's per-commitment point
12308 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
12311 * The next sender-broadcast commitment transaction's per-commitment point
12313 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12316 * Constructs a new RevokeAndACK given each field
12318 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);
12321 * Creates a copy of the RevokeAndACK
12323 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
12326 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
12328 void UpdateFee_free(struct LDKUpdateFee this_obj);
12333 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
12338 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12341 * Fee rate per 1000-weight of the transaction
12343 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
12346 * Fee rate per 1000-weight of the transaction
12348 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
12351 * Constructs a new UpdateFee given each field
12353 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
12356 * Creates a copy of the UpdateFee
12358 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
12361 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
12363 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
12366 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
12367 * belonging to the recipient
12369 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
12372 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
12373 * belonging to the recipient
12375 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12378 * The sender's per-commitment point for their current commitment transaction
12380 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
12383 * The sender's per-commitment point for their current commitment transaction
12385 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12388 * Constructs a new DataLossProtect given each field
12390 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
12393 * Creates a copy of the DataLossProtect
12395 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
12398 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
12400 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
12405 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
12410 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12413 * The next commitment number for the sender
12415 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
12418 * The next commitment number for the sender
12420 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
12423 * The next commitment number for the recipient
12425 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
12428 * The next commitment number for the recipient
12430 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
12433 * Creates a copy of the ChannelReestablish
12435 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
12438 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
12440 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
12445 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
12450 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12453 * The short channel ID
12455 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
12458 * The short channel ID
12460 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
12463 * A signature by the node key
12465 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
12468 * A signature by the node key
12470 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
12473 * A signature by the funding key
12475 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
12478 * A signature by the funding key
12480 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
12483 * Constructs a new AnnouncementSignatures given each field
12485 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);
12488 * Creates a copy of the AnnouncementSignatures
12490 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
12493 * Frees any resources used by the NetAddress
12495 void NetAddress_free(struct LDKNetAddress this_ptr);
12498 * Creates a copy of the NetAddress
12500 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
12503 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
12505 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
12508 * Read a Result from a byte array, created by Result_write
12510 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
12513 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
12515 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
12518 * The advertised features
12520 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
12523 * The advertised features
12525 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
12528 * A strictly monotonic announcement counter, with gaps allowed
12530 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
12533 * A strictly monotonic announcement counter, with gaps allowed
12535 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
12538 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
12541 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
12544 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
12547 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12550 * An RGB color for UI purposes
12552 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
12555 * An RGB color for UI purposes
12557 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
12560 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
12563 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
12566 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
12569 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12572 * List of addresses on which this node is reachable
12574 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
12577 * Creates a copy of the UnsignedNodeAnnouncement
12579 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
12582 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
12584 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
12587 * The signature by the node key
12589 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
12592 * The signature by the node key
12594 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
12597 * The actual content of the announcement
12599 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
12602 * The actual content of the announcement
12604 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
12607 * Constructs a new NodeAnnouncement given each field
12609 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
12612 * Creates a copy of the NodeAnnouncement
12614 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
12617 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
12619 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
12622 * The advertised channel features
12624 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
12627 * The advertised channel features
12629 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
12632 * The genesis hash of the blockchain where the channel is to be opened
12634 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
12637 * The genesis hash of the blockchain where the channel is to be opened
12639 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12642 * The short channel ID
12644 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
12647 * The short channel ID
12649 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
12652 * One of the two node_ids which are endpoints of this channel
12654 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
12657 * One of the two node_ids which are endpoints of this channel
12659 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12662 * The other of the two node_ids which are endpoints of this channel
12664 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
12667 * The other of the two node_ids which are endpoints of this channel
12669 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12672 * The funding key for the first node
12674 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
12677 * The funding key for the first node
12679 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12682 * The funding key for the second node
12684 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
12687 * The funding key for the second node
12689 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
12692 * Creates a copy of the UnsignedChannelAnnouncement
12694 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
12697 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
12699 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
12702 * Authentication of the announcement by the first public node
12704 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
12707 * Authentication of the announcement by the first public node
12709 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
12712 * Authentication of the announcement by the second public node
12714 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
12717 * Authentication of the announcement by the second public node
12719 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
12722 * Proof of funding UTXO ownership by the first public node
12724 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
12727 * Proof of funding UTXO ownership by the first public node
12729 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
12732 * Proof of funding UTXO ownership by the second public node
12734 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
12737 * Proof of funding UTXO ownership by the second public node
12739 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
12742 * The actual announcement
12744 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
12747 * The actual announcement
12749 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
12752 * Constructs a new ChannelAnnouncement given each field
12754 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);
12757 * Creates a copy of the ChannelAnnouncement
12759 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
12762 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
12764 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
12767 * The genesis hash of the blockchain where the channel is to be opened
12769 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
12772 * The genesis hash of the blockchain where the channel is to be opened
12774 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12777 * The short channel ID
12779 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
12782 * The short channel ID
12784 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
12787 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
12789 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
12792 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
12794 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
12799 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
12804 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
12807 * The number of blocks such that if:
12808 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
12809 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
12810 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
12811 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
12812 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
12813 * forwarding. Note that the HTLC sender is the one who originally sets this value when
12814 * constructing the route.
12816 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
12819 * The number of blocks such that if:
12820 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
12821 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
12822 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
12823 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
12824 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
12825 * forwarding. Note that the HTLC sender is the one who originally sets this value when
12826 * constructing the route.
12828 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
12831 * The minimum HTLC size incoming to sender, in milli-satoshi
12833 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
12836 * The minimum HTLC size incoming to sender, in milli-satoshi
12838 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
12841 * The base HTLC fee charged by sender, in milli-satoshi
12843 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
12846 * The base HTLC fee charged by sender, in milli-satoshi
12848 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
12851 * The amount to fee multiplier, in micro-satoshi
12853 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
12856 * The amount to fee multiplier, in micro-satoshi
12858 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
12861 * Creates a copy of the UnsignedChannelUpdate
12863 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
12866 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
12868 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
12871 * A signature of the channel update
12873 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
12876 * A signature of the channel update
12878 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
12881 * The actual channel update
12883 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
12886 * The actual channel update
12888 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
12891 * Constructs a new ChannelUpdate given each field
12893 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
12896 * Creates a copy of the ChannelUpdate
12898 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
12901 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
12903 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
12906 * The genesis hash of the blockchain being queried
12908 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
12911 * The genesis hash of the blockchain being queried
12913 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12916 * The height of the first block for the channel UTXOs being queried
12918 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
12921 * The height of the first block for the channel UTXOs being queried
12923 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
12926 * The number of blocks to include in the query results
12928 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
12931 * The number of blocks to include in the query results
12933 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
12936 * Constructs a new QueryChannelRange given each field
12938 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
12941 * Creates a copy of the QueryChannelRange
12943 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
12946 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
12948 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
12951 * The genesis hash of the blockchain being queried
12953 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
12956 * The genesis hash of the blockchain being queried
12958 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
12961 * The height of the first block in the range of the reply
12963 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
12966 * The height of the first block in the range of the reply
12968 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
12971 * The number of blocks included in the range of the reply
12973 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
12976 * The number of blocks included in the range of the reply
12978 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
12981 * True when this is the final reply for a query
12983 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
12986 * True when this is the final reply for a query
12988 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
12991 * The short_channel_ids in the channel range
12993 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
12996 * Constructs a new ReplyChannelRange given each field
12998 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);
13001 * Creates a copy of the ReplyChannelRange
13003 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
13006 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
13008 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
13011 * The genesis hash of the blockchain being queried
13013 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
13016 * The genesis hash of the blockchain being queried
13018 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13021 * The short_channel_ids that are being queried
13023 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
13026 * Constructs a new QueryShortChannelIds given each field
13028 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
13031 * Creates a copy of the QueryShortChannelIds
13033 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
13036 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
13038 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
13041 * The genesis hash of the blockchain that was queried
13043 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
13046 * The genesis hash of the blockchain that was queried
13048 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13051 * Indicates if the query recipient maintains up-to-date channel
13052 * information for the chain_hash
13054 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
13057 * Indicates if the query recipient maintains up-to-date channel
13058 * information for the chain_hash
13060 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
13063 * Constructs a new ReplyShortChannelIdsEnd given each field
13065 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
13068 * Creates a copy of the ReplyShortChannelIdsEnd
13070 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
13073 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
13075 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
13078 * The genesis hash of the blockchain for channel and node information
13080 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
13083 * The genesis hash of the blockchain for channel and node information
13085 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
13088 * The starting unix timestamp
13090 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
13093 * The starting unix timestamp
13095 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
13098 * The range of information in seconds
13100 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
13103 * The range of information in seconds
13105 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
13108 * Constructs a new GossipTimestampFilter given each field
13110 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
13113 * Creates a copy of the GossipTimestampFilter
13115 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
13118 * Frees any resources used by the ErrorAction
13120 void ErrorAction_free(struct LDKErrorAction this_ptr);
13123 * Creates a copy of the ErrorAction
13125 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
13128 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
13130 void LightningError_free(struct LDKLightningError this_obj);
13133 * A human-readable message describing the error
13135 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
13138 * A human-readable message describing the error
13140 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
13143 * The action which should be taken against the offending peer.
13145 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
13148 * The action which should be taken against the offending peer.
13150 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
13153 * Constructs a new LightningError given each field
13155 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKCVec_u8Z err_arg, struct LDKErrorAction action_arg);
13158 * Creates a copy of the LightningError
13160 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
13163 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
13165 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
13168 * update_add_htlc messages which should be sent
13170 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
13173 * update_fulfill_htlc messages which should be sent
13175 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
13178 * update_fail_htlc messages which should be sent
13180 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
13183 * update_fail_malformed_htlc messages which should be sent
13185 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
13188 * An update_fee message which should be sent
13190 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
13193 * An update_fee message which should be sent
13195 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
13198 * Finally, the commitment_signed message which should be sent
13200 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
13203 * Finally, the commitment_signed message which should be sent
13205 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
13208 * Constructs a new CommitmentUpdate given each field
13210 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);
13213 * Creates a copy of the CommitmentUpdate
13215 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
13218 * Frees any resources used by the HTLCFailChannelUpdate
13220 void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr);
13223 * Creates a copy of the HTLCFailChannelUpdate
13225 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig);
13228 * Calls the free function if one is set
13230 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
13233 * Calls the free function if one is set
13235 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
13238 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
13240 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
13243 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
13245 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
13248 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
13250 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
13253 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
13255 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
13258 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
13260 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
13263 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
13265 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
13268 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
13270 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
13273 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
13275 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
13278 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
13280 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
13283 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
13285 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
13288 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
13290 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
13293 * Read a FundingCreated from a byte array, created by FundingCreated_write
13295 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
13298 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
13300 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
13303 * Read a FundingSigned from a byte array, created by FundingSigned_write
13305 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
13308 * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
13310 struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
13313 * Read a FundingLocked from a byte array, created by FundingLocked_write
13315 struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
13318 * Serialize the Init object into a byte array which can be read by Init_read
13320 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
13323 * Read a Init from a byte array, created by Init_write
13325 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
13328 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
13330 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
13333 * Read a OpenChannel from a byte array, created by OpenChannel_write
13335 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
13338 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
13340 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
13343 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
13345 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
13348 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
13350 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
13353 * Read a Shutdown from a byte array, created by Shutdown_write
13355 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
13358 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
13360 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
13363 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
13365 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
13368 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
13370 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
13373 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
13375 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
13378 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
13380 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
13383 * Read a UpdateFee from a byte array, created by UpdateFee_write
13385 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
13388 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
13390 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
13393 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
13395 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
13398 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
13400 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
13403 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
13405 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
13408 * Serialize the Ping object into a byte array which can be read by Ping_read
13410 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
13413 * Read a Ping from a byte array, created by Ping_write
13415 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
13418 * Serialize the Pong object into a byte array which can be read by Pong_read
13420 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
13423 * Read a Pong from a byte array, created by Pong_write
13425 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
13428 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
13430 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
13433 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
13435 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
13438 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
13440 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
13443 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
13445 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
13448 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
13450 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
13453 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
13455 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
13458 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
13460 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
13463 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
13465 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
13468 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
13470 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
13473 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
13475 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
13478 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
13480 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
13483 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
13485 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
13488 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
13490 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
13493 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
13495 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
13498 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
13500 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
13503 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
13505 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
13508 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
13510 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
13513 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
13515 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
13518 *\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
13520 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
13523 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
13525 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
13528 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
13530 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
13533 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
13535 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
13538 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
13540 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
13543 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
13545 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
13548 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
13550 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
13553 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
13555 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
13558 * Constructs a new IgnoringMessageHandler given each field
13560 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
13563 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
13564 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
13566 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
13569 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
13570 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
13572 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
13575 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
13577 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
13580 * Constructs a new ErroringMessageHandler
13582 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
13585 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
13586 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
13588 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
13591 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
13592 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
13594 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
13597 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
13599 void MessageHandler_free(struct LDKMessageHandler this_obj);
13602 * A message handler which handles messages specific to channels. Usually this is just a
13603 * ChannelManager object or a ErroringMessageHandler.
13605 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
13608 * A message handler which handles messages specific to channels. Usually this is just a
13609 * ChannelManager object or a ErroringMessageHandler.
13611 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
13614 * A message handler which handles messages updating our knowledge of the network channel
13615 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
13617 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
13620 * A message handler which handles messages updating our knowledge of the network channel
13621 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
13623 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
13626 * Constructs a new MessageHandler given each field
13628 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
13631 * Creates a copy of a SocketDescriptor
13633 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
13636 * Calls the free function if one is set
13638 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
13641 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
13643 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
13646 * Used to indicate that we probably can't make any future connections to this peer, implying
13647 * we should go ahead and force-close any channels we have with it.
13649 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
13652 * Used to indicate that we probably can't make any future connections to this peer, implying
13653 * we should go ahead and force-close any channels we have with it.
13655 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
13658 * Constructs a new PeerHandleError given each field
13660 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
13663 * Creates a copy of the PeerHandleError
13665 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
13668 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
13670 void PeerManager_free(struct LDKPeerManager this_obj);
13673 * Constructs a new PeerManager with the given message handlers and node_id secret key
13674 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
13675 * cryptographically secure random bytes.
13677 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);
13680 * Get the list of node ids for peers which have completed the initial handshake.
13682 * For outbound connections, this will be the same as the their_node_id parameter passed in to
13683 * new_outbound_connection, however entries will only appear once the initial handshake has
13684 * completed and we are sure the remote peer has the private key for the given node_id.
13686 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
13689 * Indicates a new outbound connection has been established to a node with the given node_id.
13690 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
13691 * descriptor but must disconnect the connection immediately.
13693 * Returns a small number of bytes to send to the remote node (currently always 50).
13695 * Panics if descriptor is duplicative with some other descriptor which has not yet had a
13696 * socket_disconnected().
13698 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);
13701 * Indicates a new inbound connection has been established.
13703 * May refuse the connection by returning an Err, but will never write bytes to the remote end
13704 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
13705 * call socket_disconnected for the new descriptor but must disconnect the connection
13708 * Panics if descriptor is duplicative with some other descriptor which has not yet had
13709 * socket_disconnected called.
13711 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor);
13714 * Indicates that there is room to write data to the given socket descriptor.
13716 * May return an Err to indicate that the connection should be closed.
13718 * Will most likely call send_data on the descriptor passed in (or the descriptor handed into
13719 * new_*\\_connection) before returning. Thus, be very careful with reentrancy issues! The
13720 * invariants around calling write_buffer_space_avail in case a write did not fully complete
13721 * must still hold - be ready to call write_buffer_space_avail again if a write call generated
13722 * here isn't sufficient! Panics if the descriptor was not previously registered in a
13723 * new_\\*_connection event.
13725 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
13728 * Indicates that data was read from the given socket descriptor.
13730 * May return an Err to indicate that the connection should be closed.
13732 * Will *not* call back into send_data on any descriptors to avoid reentrancy complexity.
13733 * Thus, however, you almost certainly want to call process_events() after any read_event to
13734 * generate send_data calls to handle responses.
13736 * If Ok(true) is returned, further read_events should not be triggered until a send_data call
13737 * on this file descriptor has resume_read set (preventing DoS issues in the send buffer).
13739 * Panics if the descriptor was not previously registered in a new_*_connection event.
13741 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);
13744 * Checks for any events generated by our handlers and processes them. Includes sending most
13745 * response messages as well as messages generated by calls to handler functions directly (eg
13746 * functions like ChannelManager::process_pending_htlc_forward or send_payment).
13748 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
13751 * Indicates that the given socket descriptor's connection is now closed.
13753 * This must only be called if the socket has been disconnected by the peer or your own
13754 * decision to disconnect it and must NOT be called in any case where other parts of this
13755 * library (eg PeerHandleError, explicit disconnect_socket calls) instruct you to disconnect
13758 * Panics if the descriptor was not previously registered in a successful new_*_connection event.
13760 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
13763 * Disconnect a peer given its node id.
13765 * Set no_connection_possible to true to prevent any further connection with this peer,
13766 * force-closing any channels we have with it.
13768 * If a peer is connected, this will call `disconnect_socket` on the descriptor for the peer,
13769 * so be careful about reentrancy issues.
13771 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
13774 * This function should be called roughly once every 30 seconds.
13775 * It will send pings to each peer and disconnect those which did not respond to the last round of pings.
13776 * Will most likely call send_data on all of the registered descriptors, thus, be very careful with reentrancy issues!
13778 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
13781 * Build the commitment secret from the seed and the commitment number
13783 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
13786 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
13787 * from the base secret and the per_commitment_point.
13789 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
13790 * generated (ie our own).
13792 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
13795 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
13796 * from the base point and the per_commitment_key. This is the public equivalent of
13797 * derive_private_key - using only public keys to derive a public key instead of private keys.
13799 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
13800 * generated (ie our own).
13802 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
13805 * Derives a per-commitment-transaction revocation key from its constituent parts.
13807 * Only the cheating participant owns a valid witness to propagate a revoked
13808 * commitment transaction, thus per_commitment_secret always come from cheater
13809 * and revocation_base_secret always come from punisher, which is the broadcaster
13810 * of the transaction spending with this key knowledge.
13812 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
13813 * generated (ie our own).
13815 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
13818 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
13819 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
13820 * public key instead of private keys.
13822 * Only the cheating participant owns a valid witness to propagate a revoked
13823 * commitment transaction, thus per_commitment_point always come from cheater
13824 * and revocation_base_point always come from punisher, which is the broadcaster
13825 * of the transaction spending with this key knowledge.
13827 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
13828 * generated (ie our own).
13830 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
13833 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
13835 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
13838 * The broadcaster's per-commitment public key which was used to derive the other keys.
13840 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
13843 * The broadcaster's per-commitment public key which was used to derive the other keys.
13845 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13848 * The revocation key which is used to allow the broadcaster of the commitment
13849 * transaction to provide their counterparty the ability to punish them if they broadcast
13852 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
13855 * The revocation key which is used to allow the broadcaster of the commitment
13856 * transaction to provide their counterparty the ability to punish them if they broadcast
13859 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13862 * Broadcaster's HTLC Key
13864 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
13867 * Broadcaster's HTLC Key
13869 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13872 * Countersignatory's HTLC Key
13874 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
13877 * Countersignatory's HTLC Key
13879 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13882 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
13884 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
13887 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
13889 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13892 * Constructs a new TxCreationKeys given each field
13894 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);
13897 * Creates a copy of the TxCreationKeys
13899 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
13902 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
13904 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
13907 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
13909 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
13912 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
13914 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
13917 * The public key which is used to sign all commitment transactions, as it appears in the
13918 * on-chain channel lock-in 2-of-2 multisig output.
13920 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
13923 * The public key which is used to sign all commitment transactions, as it appears in the
13924 * on-chain channel lock-in 2-of-2 multisig output.
13926 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13929 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
13930 * revocation keys. This is combined with the per-commitment-secret generated by the
13931 * counterparty to create a secret which the counterparty can reveal to revoke previous
13934 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
13937 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
13938 * revocation keys. This is combined with the per-commitment-secret generated by the
13939 * counterparty to create a secret which the counterparty can reveal to revoke previous
13942 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13945 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
13946 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
13947 * static across every commitment transaction.
13949 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
13952 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
13953 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
13954 * static across every commitment transaction.
13956 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13959 * The base point which is used (with derive_public_key) to derive a per-commitment payment
13960 * public key which receives non-HTLC-encumbered funds which are only available for spending
13961 * after some delay (or can be claimed via the revocation path).
13963 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
13966 * The base point which is used (with derive_public_key) to derive a per-commitment payment
13967 * public key which receives non-HTLC-encumbered funds which are only available for spending
13968 * after some delay (or can be claimed via the revocation path).
13970 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13973 * The base point which is used (with derive_public_key) to derive a per-commitment public key
13974 * which is used to encumber HTLC-in-flight outputs.
13976 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
13979 * The base point which is used (with derive_public_key) to derive a per-commitment public key
13980 * which is used to encumber HTLC-in-flight outputs.
13982 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
13985 * Constructs a new ChannelPublicKeys given each field
13987 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);
13990 * Creates a copy of the ChannelPublicKeys
13992 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
13995 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
13997 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
14000 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
14002 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
14005 * Create per-state keys from channel base points and the per-commitment point.
14006 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
14008 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);
14011 * Generate per-state keys from channel static keys.
14012 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
14014 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);
14017 * A script either spendable by the revocation
14018 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
14019 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
14021 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
14024 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
14026 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
14029 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
14030 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
14031 * need to compare this value to whether the commitment transaction in question is that of
14032 * the counterparty or our own.
14034 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
14037 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
14038 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
14039 * need to compare this value to whether the commitment transaction in question is that of
14040 * the counterparty or our own.
14042 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
14045 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
14046 * this divided by 1000.
14048 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
14051 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
14052 * this divided by 1000.
14054 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
14057 * The CLTV lock-time at which this HTLC expires.
14059 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
14062 * The CLTV lock-time at which this HTLC expires.
14064 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
14067 * The hash of the preimage which unlocks this HTLC.
14069 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
14072 * The hash of the preimage which unlocks this HTLC.
14074 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14077 * The position within the commitment transactions' outputs. This may be None if the value is
14078 * below the dust limit (in which case no output appears in the commitment transaction and the
14079 * value is spent to additional transaction fees).
14081 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
14084 * The position within the commitment transactions' outputs. This may be None if the value is
14085 * below the dust limit (in which case no output appears in the commitment transaction and the
14086 * value is spent to additional transaction fees).
14088 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
14091 * Constructs a new HTLCOutputInCommitment given each field
14093 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);
14096 * Creates a copy of the HTLCOutputInCommitment
14098 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
14101 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
14103 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
14106 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
14108 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
14111 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
14112 * does not need to have its previous_output_index filled.
14114 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys);
14117 * Gets the redeemscript for a funding output from the two funding public keys.
14118 * Note that the order of funding public keys does not matter.
14120 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
14123 * panics if htlc.transaction_output_index.is_none()!
14125 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);
14128 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
14130 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
14133 * Holder public keys
14135 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14138 * Holder public keys
14140 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
14143 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
14145 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14148 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
14150 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
14153 * Whether the holder is the initiator of this channel.
14154 * This is an input to the commitment number obscure factor computation.
14156 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14159 * Whether the holder is the initiator of this channel.
14160 * This is an input to the commitment number obscure factor computation.
14162 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
14165 * The late-bound counterparty channel transaction parameters.
14166 * These parameters are populated at the point in the protocol where the counterparty provides them.
14168 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14171 * The late-bound counterparty channel transaction parameters.
14172 * These parameters are populated at the point in the protocol where the counterparty provides them.
14174 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
14177 * The late-bound funding outpoint
14179 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
14182 * The late-bound funding outpoint
14184 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
14187 * Constructs a new ChannelTransactionParameters given each field
14189 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);
14192 * Creates a copy of the ChannelTransactionParameters
14194 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
14197 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
14199 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
14202 * Counter-party public keys
14204 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
14207 * Counter-party public keys
14209 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
14212 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
14214 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
14217 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
14219 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
14222 * Constructs a new CounterpartyChannelTransactionParameters given each field
14224 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
14227 * Creates a copy of the CounterpartyChannelTransactionParameters
14229 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
14232 * Whether the late bound parameters are populated.
14234 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
14237 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
14238 * given that the holder is the broadcaster.
14240 * self.is_populated() must be true before calling this function.
14242 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
14245 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
14246 * given that the counterparty is the broadcaster.
14248 * self.is_populated() must be true before calling this function.
14250 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
14253 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
14255 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
14258 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
14260 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
14263 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
14265 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
14268 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
14270 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
14273 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
14275 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
14278 * Get the channel pubkeys for the broadcaster
14280 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14283 * Get the channel pubkeys for the countersignatory
14285 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14288 * Get the contest delay applicable to the transactions.
14289 * Note that the contest delay was selected by the countersignatory.
14291 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14294 * Whether the channel is outbound from the broadcaster.
14296 * The boolean representing the side that initiated the channel is
14297 * an input to the commitment number obscure factor computation.
14299 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14302 * The funding outpoint
14304 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
14307 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
14309 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
14312 * Our counterparty's signature for the transaction
14314 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
14317 * Our counterparty's signature for the transaction
14319 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
14322 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
14324 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
14327 * Creates a copy of the HolderCommitmentTransaction
14329 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
14332 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
14334 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
14337 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
14339 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
14342 * Create a new holder transaction with the given counterparty signatures.
14343 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
14345 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);
14348 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
14350 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
14353 * The commitment transaction
14355 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
14358 * The commitment transaction
14360 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
14363 * The txid for the commitment transaction.
14365 * This is provided as a performance optimization, instead of calling transaction.txid()
14368 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
14371 * The txid for the commitment transaction.
14373 * This is provided as a performance optimization, instead of calling transaction.txid()
14376 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
14379 * Constructs a new BuiltCommitmentTransaction given each field
14381 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
14384 * Creates a copy of the BuiltCommitmentTransaction
14386 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
14389 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
14391 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
14394 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
14396 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
14399 * Get the SIGHASH_ALL sighash value of the transaction.
14401 * This can be used to verify a signature.
14403 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);
14406 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
14407 * because we are about to broadcast a holder transaction.
14409 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);
14412 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
14414 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
14417 * Creates a copy of the CommitmentTransaction
14419 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
14422 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
14424 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
14427 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
14429 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
14432 * The backwards-counting commitment number
14434 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14437 * The value to be sent to the broadcaster
14439 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14442 * The value to be sent to the counterparty
14444 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14447 * The feerate paid per 1000-weight-unit in this commitment transaction.
14449 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14452 * Trust our pre-built transaction and derived transaction creation public keys.
14454 * Applies a wrapper which allows access to these fields.
14456 * This should only be used if you fully trust the builder of this object. It should not
14457 *\tbe used by an external signer - instead use the verify function.
14459 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
14462 * Verify our pre-built transaction and derived transaction creation public keys.
14464 * Applies a wrapper which allows access to these fields.
14466 * An external validating signer must call this method before signing
14467 * or using the built transaction.
14469 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);
14472 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
14474 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
14477 * The transaction ID of the built Bitcoin transaction
14479 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
14482 * The pre-built Bitcoin commitment transaction
14484 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
14487 * The pre-calculated transaction creation public keys.
14489 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
14492 * Get a signature for each HTLC which was included in the commitment transaction (ie for
14493 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
14495 * The returned Vec has one entry for each HTLC, and in the same order.
14497 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);
14500 * Get the transaction number obscure factor
14502 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
14505 * Creates a copy of the InitFeatures
14507 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
14510 * Creates a copy of the NodeFeatures
14512 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
14515 * Creates a copy of the ChannelFeatures
14517 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
14520 * Creates a copy of the InvoiceFeatures
14522 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
14525 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
14527 void InitFeatures_free(struct LDKInitFeatures this_obj);
14530 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
14532 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
14535 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
14537 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
14540 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
14542 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
14545 * Create a blank Features with no features set
14547 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
14550 * Creates a Features with the bits set which are known by the implementation
14552 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
14555 * Create a blank Features with no features set
14557 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
14560 * Creates a Features with the bits set which are known by the implementation
14562 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
14565 * Create a blank Features with no features set
14567 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
14570 * Creates a Features with the bits set which are known by the implementation
14572 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
14575 * Create a blank Features with no features set
14577 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
14580 * Creates a Features with the bits set which are known by the implementation
14582 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
14585 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
14587 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
14590 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
14592 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
14595 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
14597 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
14600 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
14602 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
14605 * Read a InitFeatures from a byte array, created by InitFeatures_write
14607 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
14610 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
14612 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
14615 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
14617 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
14620 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
14622 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
14625 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
14627 void RouteHop_free(struct LDKRouteHop this_obj);
14630 * The node_id of the node at this hop.
14632 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
14635 * The node_id of the node at this hop.
14637 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14640 * The node_announcement features of the node at this hop. For the last hop, these may be
14641 * amended to match the features present in the invoice this node generated.
14643 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
14646 * The node_announcement features of the node at this hop. For the last hop, these may be
14647 * amended to match the features present in the invoice this node generated.
14649 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
14652 * The channel that should be used from the previous hop to reach this node.
14654 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
14657 * The channel that should be used from the previous hop to reach this node.
14659 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
14662 * The channel_announcement features of the channel that should be used from the previous hop
14663 * to reach this node.
14665 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
14668 * The channel_announcement features of the channel that should be used from the previous hop
14669 * to reach this node.
14671 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
14674 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
14675 * For the last hop, this should be the full value of the payment (might be more than
14676 * requested if we had to match htlc_minimum_msat).
14678 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
14681 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
14682 * For the last hop, this should be the full value of the payment (might be more than
14683 * requested if we had to match htlc_minimum_msat).
14685 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
14688 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
14689 * expected at the destination, in excess of the current block height.
14691 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
14694 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
14695 * expected at the destination, in excess of the current block height.
14697 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
14700 * Constructs a new RouteHop given each field
14702 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);
14705 * Creates a copy of the RouteHop
14707 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
14710 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
14712 void Route_free(struct LDKRoute this_obj);
14715 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
14716 * last RouteHop in each path must be the same.
14717 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
14718 * destination. Thus, this must always be at least length one. While the maximum length of any
14719 * given path is variable, keeping the length of any path to less than 20 should currently
14720 * ensure it is viable.
14722 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
14725 * Constructs a new Route given each field
14727 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
14730 * Creates a copy of the Route
14732 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
14735 * Serialize the Route object into a byte array which can be read by Route_read
14737 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
14740 * Read a Route from a byte array, created by Route_write
14742 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
14745 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
14747 void RouteHint_free(struct LDKRouteHint this_obj);
14750 * The node_id of the non-target end of the route
14752 struct LDKPublicKey RouteHint_get_src_node_id(const struct LDKRouteHint *NONNULL_PTR this_ptr);
14755 * The node_id of the non-target end of the route
14757 void RouteHint_set_src_node_id(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
14760 * The short_channel_id of this channel
14762 uint64_t RouteHint_get_short_channel_id(const struct LDKRouteHint *NONNULL_PTR this_ptr);
14765 * The short_channel_id of this channel
14767 void RouteHint_set_short_channel_id(struct LDKRouteHint *NONNULL_PTR this_ptr, uint64_t val);
14770 * The fees which must be paid to use this channel
14772 struct LDKRoutingFees RouteHint_get_fees(const struct LDKRouteHint *NONNULL_PTR this_ptr);
14775 * The fees which must be paid to use this channel
14777 void RouteHint_set_fees(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
14780 * The difference in CLTV values between this node and the next node.
14782 uint16_t RouteHint_get_cltv_expiry_delta(const struct LDKRouteHint *NONNULL_PTR this_ptr);
14785 * The difference in CLTV values between this node and the next node.
14787 void RouteHint_set_cltv_expiry_delta(struct LDKRouteHint *NONNULL_PTR this_ptr, uint16_t val);
14790 * The minimum value, in msat, which must be relayed to the next hop.
14792 struct LDKCOption_u64Z RouteHint_get_htlc_minimum_msat(const struct LDKRouteHint *NONNULL_PTR this_ptr);
14795 * The minimum value, in msat, which must be relayed to the next hop.
14797 void RouteHint_set_htlc_minimum_msat(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
14800 * The maximum value in msat available for routing with a single HTLC.
14802 struct LDKCOption_u64Z RouteHint_get_htlc_maximum_msat(const struct LDKRouteHint *NONNULL_PTR this_ptr);
14805 * The maximum value in msat available for routing with a single HTLC.
14807 void RouteHint_set_htlc_maximum_msat(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
14810 * Constructs a new RouteHint given each field
14812 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);
14815 * Creates a copy of the RouteHint
14817 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
14820 * Gets a route from us (payer) to the given target node (payee).
14822 * If the payee provided features in their invoice, they should be provided via payee_features.
14823 * Without this, MPP will only be used if the payee's features are available in the network graph.
14825 * Extra routing hops between known nodes and the target will be used if they are included in
14828 * If some channels aren't announced, it may be useful to fill in a first_hops with the
14829 * results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
14830 * view of our local channels (from net_graph_msg_handler) will be ignored, and only those
14831 * in first_hops will be used.
14833 * Panics if first_hops contains channels without short_channel_ids
14834 * (ChannelManager::list_usable_channels will never include such channels).
14836 * The fees on channels from us to next-hops are ignored (as they are assumed to all be
14837 * equal), however the enabled/disabled bit on such channels as well as the
14838 * htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
14840 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);
14843 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
14845 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
14848 * Creates a copy of the NetworkGraph
14850 struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
14853 * Frees any resources used by the LockedNetworkGraph, if is_owned is set and inner is non-NULL.
14855 void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj);
14858 * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
14860 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
14863 * Creates a new tracker of the actual state of the network of channels and nodes,
14864 * assuming a fresh network graph.
14865 * Chain monitor is used to make sure announced channels exist on-chain,
14866 * channel data is correct, and that the announcement is signed with
14867 * channel owners' keys.
14869 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger);
14872 * Creates a new tracker of the actual state of the network of channels and nodes,
14873 * assuming an existing Network Graph.
14875 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph);
14878 * Adds a provider used to check new announcements. Does not affect
14879 * existing announcements unless they are updated.
14880 * Add, update or remove the provider would replace the current one.
14882 void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKAccess *chain_access);
14885 * Take a read lock on the network_graph and return it in the C-bindings
14886 * newtype helper. This is likely only useful when called via the C
14887 * bindings as you can call `self.network_graph.read().unwrap()` in Rust
14890 MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
14893 * Get a reference to the NetworkGraph which this read-lock contains.
14895 MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg);
14898 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
14899 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
14901 struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
14904 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
14905 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
14907 struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
14910 * Frees any resources used by the DirectionalChannelInfo, if is_owned is set and inner is non-NULL.
14912 void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_obj);
14915 * When the last update to the channel direction was issued.
14916 * Value is opaque, as set in the announcement.
14918 uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
14921 * When the last update to the channel direction was issued.
14922 * Value is opaque, as set in the announcement.
14924 void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val);
14927 * Whether the channel can be currently used for payments (in this one direction).
14929 bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
14932 * Whether the channel can be currently used for payments (in this one direction).
14934 void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, bool val);
14937 * The difference in CLTV values that you must have when routing through this channel.
14939 uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
14942 * The difference in CLTV values that you must have when routing through this channel.
14944 void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint16_t val);
14947 * The minimum value, which must be relayed to the next hop via the channel
14949 uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
14952 * The minimum value, which must be relayed to the next hop via the channel
14954 void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val);
14957 * The maximum value which may be relayed to the next hop via the channel.
14959 struct LDKCOption_u64Z DirectionalChannelInfo_get_htlc_maximum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
14962 * The maximum value which may be relayed to the next hop via the channel.
14964 void DirectionalChannelInfo_set_htlc_maximum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
14967 * Fees charged when the channel is used for routing
14969 struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
14972 * Fees charged when the channel is used for routing
14974 void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
14977 * Most recent update for the channel received from the network
14978 * Mostly redundant with the data we store in fields explicitly.
14979 * Everything else is useful only for sending out for initial routing sync.
14980 * Not stored if contains excess data to prevent DoS.
14982 struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
14985 * Most recent update for the channel received from the network
14986 * Mostly redundant with the data we store in fields explicitly.
14987 * Everything else is useful only for sending out for initial routing sync.
14988 * Not stored if contains excess data to prevent DoS.
14990 void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
14993 * Constructs a new DirectionalChannelInfo given each field
14995 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);
14998 * Creates a copy of the DirectionalChannelInfo
15000 struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig);
15003 * Serialize the DirectionalChannelInfo object into a byte array which can be read by DirectionalChannelInfo_read
15005 struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj);
15008 * Read a DirectionalChannelInfo from a byte array, created by DirectionalChannelInfo_write
15010 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser);
15013 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
15015 void ChannelInfo_free(struct LDKChannelInfo this_obj);
15018 * Protocol features of a channel communicated during its announcement
15020 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15023 * Protocol features of a channel communicated during its announcement
15025 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
15028 * Source node of the first direction of a channel
15030 struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15033 * Source node of the first direction of a channel
15035 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15038 * Details about the first direction of a channel
15040 struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15043 * Details about the first direction of a channel
15045 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
15048 * Source node of the second direction of a channel
15050 struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15053 * Source node of the second direction of a channel
15055 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
15058 * Details about the second direction of a channel
15060 struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15063 * Details about the second direction of a channel
15065 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
15068 * The channel capacity as seen on-chain, if chain lookup is available.
15070 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15073 * The channel capacity as seen on-chain, if chain lookup is available.
15075 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
15078 * An initial announcement of the channel
15079 * Mostly redundant with the data we store in fields explicitly.
15080 * Everything else is useful only for sending out for initial routing sync.
15081 * Not stored if contains excess data to prevent DoS.
15083 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
15086 * An initial announcement of the channel
15087 * Mostly redundant with the data we store in fields explicitly.
15088 * Everything else is useful only for sending out for initial routing sync.
15089 * Not stored if contains excess data to prevent DoS.
15091 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
15094 * Constructs a new ChannelInfo given each field
15096 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);
15099 * Creates a copy of the ChannelInfo
15101 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
15104 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
15106 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
15109 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
15111 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
15114 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
15116 void RoutingFees_free(struct LDKRoutingFees this_obj);
15119 * Flat routing fee in satoshis
15121 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
15124 * Flat routing fee in satoshis
15126 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
15129 * Liquidity-based routing fee in millionths of a routed amount.
15130 * In other words, 10000 is 1%.
15132 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
15135 * Liquidity-based routing fee in millionths of a routed amount.
15136 * In other words, 10000 is 1%.
15138 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
15141 * Constructs a new RoutingFees given each field
15143 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
15146 * Creates a copy of the RoutingFees
15148 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
15151 * Read a RoutingFees from a byte array, created by RoutingFees_write
15153 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
15156 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
15158 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
15161 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
15163 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
15166 * Protocol features the node announced support for
15168 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
15171 * Protocol features the node announced support for
15173 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
15176 * When the last known update to the node state was issued.
15177 * Value is opaque, as set in the announcement.
15179 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
15182 * When the last known update to the node state was issued.
15183 * Value is opaque, as set in the announcement.
15185 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
15188 * Color assigned to the node
15190 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
15193 * Color assigned to the node
15195 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
15198 * Moniker assigned to the node.
15199 * May be invalid or malicious (eg control chars),
15200 * should not be exposed to the user.
15202 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
15205 * Moniker assigned to the node.
15206 * May be invalid or malicious (eg control chars),
15207 * should not be exposed to the user.
15209 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
15212 * Internet-level addresses via which one can connect to the node
15214 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
15217 * An initial announcement of the node
15218 * Mostly redundant with the data we store in fields explicitly.
15219 * Everything else is useful only for sending out for initial routing sync.
15220 * Not stored if contains excess data to prevent DoS.
15222 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
15225 * An initial announcement of the node
15226 * Mostly redundant with the data we store in fields explicitly.
15227 * Everything else is useful only for sending out for initial routing sync.
15228 * Not stored if contains excess data to prevent DoS.
15230 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
15233 * Constructs a new NodeAnnouncementInfo given each field
15235 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);
15238 * Creates a copy of the NodeAnnouncementInfo
15240 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
15243 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
15245 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
15248 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
15250 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
15253 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
15255 void NodeInfo_free(struct LDKNodeInfo this_obj);
15258 * All valid channels a node has announced
15260 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
15263 * Lowest fees enabling routing via any of the enabled, known channels to a node.
15264 * The two fields (flat and proportional fee) are independent,
15265 * meaning they don't have to refer to the same channel.
15267 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
15270 * Lowest fees enabling routing via any of the enabled, known channels to a node.
15271 * The two fields (flat and proportional fee) are independent,
15272 * meaning they don't have to refer to the same channel.
15274 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
15277 * More information about a node from node_announcement.
15278 * Optional because we store a Node entry after learning about it from
15279 * a channel announcement, but before receiving a node announcement.
15281 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
15284 * More information about a node from node_announcement.
15285 * Optional because we store a Node entry after learning about it from
15286 * a channel announcement, but before receiving a node announcement.
15288 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
15291 * Constructs a new NodeInfo given each field
15293 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
15296 * Creates a copy of the NodeInfo
15298 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
15301 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
15303 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
15306 * Read a NodeInfo from a byte array, created by NodeInfo_write
15308 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
15311 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
15313 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
15316 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
15318 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
15321 * Creates a new, empty, network graph.
15323 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
15326 * For an already known node (from channel announcements), update its stored properties from a
15327 * given node announcement.
15329 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
15330 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
15331 * routing messages from a source using a protocol other than the lightning P2P protocol.
15333 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
15336 * For an already known node (from channel announcements), update its stored properties from a
15337 * given node announcement without verifying the associated signatures. Because we aren't
15338 * given the associated signatures here we cannot relay the node announcement to any of our
15341 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
15344 * Store or update channel info from a channel announcement.
15346 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
15347 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
15348 * routing messages from a source using a protocol other than the lightning P2P protocol.
15350 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
15351 * the corresponding UTXO exists on chain and is correctly-formatted.
15353 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);
15356 * Store or update channel info from a channel announcement without verifying the associated
15357 * signatures. Because we aren't given the associated signatures here we cannot relay the
15358 * channel announcement to any of our peers.
15360 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
15361 * the corresponding UTXO exists on chain and is correctly-formatted.
15363 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);
15366 * Close a channel if a corresponding HTLC fail was sent.
15367 * If permanent, removes a channel from the local storage.
15368 * May cause the removal of nodes too, if this was their last channel.
15369 * If not permanent, makes channels unavailable for routing.
15371 void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
15374 * For an already known (from announcement) channel, update info about one of the directions
15377 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
15378 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
15379 * routing messages from a source using a protocol other than the lightning P2P protocol.
15381 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
15384 * For an already known (from announcement) channel, update info about one of the directions
15385 * of the channel without verifying the associated signatures. Because we aren't given the
15386 * associated signatures here we cannot relay the channel update to any of our peers.
15388 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
15390 /* Text to put at the end of the generated file */