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
157 typedef enum LDKNetwork {
163 * Must be last for serialization purposes
168 typedef enum LDKSecp256k1Error {
169 LDKSecp256k1Error_IncorrectSignature,
170 LDKSecp256k1Error_InvalidMessage,
171 LDKSecp256k1Error_InvalidPublicKey,
172 LDKSecp256k1Error_InvalidSignature,
173 LDKSecp256k1Error_InvalidSecretKey,
174 LDKSecp256k1Error_InvalidRecoveryId,
175 LDKSecp256k1Error_InvalidTweak,
176 LDKSecp256k1Error_TweakCheckFailed,
177 LDKSecp256k1Error_NotEnoughMemory,
179 * Must be last for serialization purposes
181 LDKSecp256k1Error_Sentinel,
185 * A serialized transaction, in (pointer, length) form.
187 * This type optionally owns its own memory, and thus the semantics around access change based on
188 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
189 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
190 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
191 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
192 * you would be invalid.
194 * Note that, while it may change in the future, because transactions on the Rust side are stored
195 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
196 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
197 * `data_is_owned` either set or unset at your discretion.
199 typedef struct LDKTransaction {
201 * This is non-const for your convenience, an object passed to Rust is never written to.
208 typedef struct LDKCVec_u8Z {
214 * A transaction output including a scriptPubKey and value.
215 * This type *does* own its own memory, so must be free'd appropriately.
217 typedef struct LDKTxOut {
218 struct LDKCVec_u8Z script_pubkey;
222 typedef struct LDKSecretKey {
226 typedef union LDKCResult_SecretKeyErrorZPtr {
227 struct LDKSecretKey *result;
228 enum LDKSecp256k1Error *err;
229 } LDKCResult_SecretKeyErrorZPtr;
231 typedef struct LDKCResult_SecretKeyErrorZ {
232 union LDKCResult_SecretKeyErrorZPtr contents;
234 } LDKCResult_SecretKeyErrorZ;
236 typedef struct LDKPublicKey {
237 uint8_t compressed_form[33];
240 typedef union LDKCResult_PublicKeyErrorZPtr {
241 struct LDKPublicKey *result;
242 enum LDKSecp256k1Error *err;
243 } LDKCResult_PublicKeyErrorZPtr;
245 typedef struct LDKCResult_PublicKeyErrorZ {
246 union LDKCResult_PublicKeyErrorZPtr contents;
248 } LDKCResult_PublicKeyErrorZ;
253 * The set of public keys which are used in the creation of one commitment transaction.
254 * These are derived from the channel base keys and per-commitment data.
256 * A broadcaster key is provided from potential broadcaster of the computed transaction.
257 * A countersignatory key is coming from a protocol participant unable to broadcast the
260 * These keys are assumed to be good, either because the code derived them from
261 * channel basepoints via the new function, or they were obtained via
262 * CommitmentTransaction.trust().keys() because we trusted the source of the
263 * pre-calculated keys.
265 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
267 * A pointer to the opaque Rust object.
268 * Nearly everywhere, inner must be non-null, however in places where
269 * the Rust equivalent takes an Option, it may be set to null to indicate None.
271 LDKnativeTxCreationKeys *inner;
273 * Indicates that this is the only struct which contains the same pointer.
274 * Rust functions which take ownership of an object provided via an argument require
275 * this to be true and invalidate the object pointed to by inner.
283 * An error in decoding a message or struct.
285 typedef struct MUST_USE_STRUCT LDKDecodeError {
287 * A pointer to the opaque Rust object.
288 * Nearly everywhere, inner must be non-null, however in places where
289 * the Rust equivalent takes an Option, it may be set to null to indicate None.
291 LDKnativeDecodeError *inner;
293 * Indicates that this is the only struct which contains the same pointer.
294 * Rust functions which take ownership of an object provided via an argument require
295 * this to be true and invalidate the object pointed to by inner.
300 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
301 struct LDKTxCreationKeys *result;
302 struct LDKDecodeError *err;
303 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
305 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
306 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
308 } LDKCResult_TxCreationKeysDecodeErrorZ;
313 * One counterparty's public keys which do not change over the life of a channel.
315 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
317 * A pointer to the opaque Rust object.
318 * Nearly everywhere, inner must be non-null, however in places where
319 * the Rust equivalent takes an Option, it may be set to null to indicate None.
321 LDKnativeChannelPublicKeys *inner;
323 * Indicates that this is the only struct which contains the same pointer.
324 * Rust functions which take ownership of an object provided via an argument require
325 * this to be true and invalidate the object pointed to by inner.
328 } LDKChannelPublicKeys;
330 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
331 struct LDKChannelPublicKeys *result;
332 struct LDKDecodeError *err;
333 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
335 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
336 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
338 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
340 typedef union LDKCResult_TxCreationKeysErrorZPtr {
341 struct LDKTxCreationKeys *result;
342 enum LDKSecp256k1Error *err;
343 } LDKCResult_TxCreationKeysErrorZPtr;
345 typedef struct LDKCResult_TxCreationKeysErrorZ {
346 union LDKCResult_TxCreationKeysErrorZPtr contents;
348 } LDKCResult_TxCreationKeysErrorZ;
350 typedef enum LDKCOption_u32Z_Tag {
351 LDKCOption_u32Z_Some,
352 LDKCOption_u32Z_None,
354 * Must be last for serialization purposes
356 LDKCOption_u32Z_Sentinel,
357 } LDKCOption_u32Z_Tag;
359 typedef struct LDKCOption_u32Z {
360 LDKCOption_u32Z_Tag tag;
371 * Information about an HTLC as it appears in a commitment transaction
373 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
375 * A pointer to the opaque Rust object.
376 * Nearly everywhere, inner must be non-null, however in places where
377 * the Rust equivalent takes an Option, it may be set to null to indicate None.
379 LDKnativeHTLCOutputInCommitment *inner;
381 * Indicates that this is the only struct which contains the same pointer.
382 * Rust functions which take ownership of an object provided via an argument require
383 * this to be true and invalidate the object pointed to by inner.
386 } LDKHTLCOutputInCommitment;
388 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
389 struct LDKHTLCOutputInCommitment *result;
390 struct LDKDecodeError *err;
391 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
393 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
394 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
396 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
401 * Late-bound per-channel counterparty data used to build transactions.
403 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
405 * A pointer to the opaque Rust object.
406 * Nearly everywhere, inner must be non-null, however in places where
407 * the Rust equivalent takes an Option, it may be set to null to indicate None.
409 LDKnativeCounterpartyChannelTransactionParameters *inner;
411 * Indicates that this is the only struct which contains the same pointer.
412 * Rust functions which take ownership of an object provided via an argument require
413 * this to be true and invalidate the object pointed to by inner.
416 } LDKCounterpartyChannelTransactionParameters;
418 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
419 struct LDKCounterpartyChannelTransactionParameters *result;
420 struct LDKDecodeError *err;
421 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
423 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
424 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
426 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
431 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
432 * The fields are organized by holder/counterparty.
434 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
435 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
437 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
439 * A pointer to the opaque Rust object.
440 * Nearly everywhere, inner must be non-null, however in places where
441 * the Rust equivalent takes an Option, it may be set to null to indicate None.
443 LDKnativeChannelTransactionParameters *inner;
445 * Indicates that this is the only struct which contains the same pointer.
446 * Rust functions which take ownership of an object provided via an argument require
447 * this to be true and invalidate the object pointed to by inner.
450 } LDKChannelTransactionParameters;
452 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
453 struct LDKChannelTransactionParameters *result;
454 struct LDKDecodeError *err;
455 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
457 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
458 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
460 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
462 typedef struct LDKSignature {
463 uint8_t compact_form[64];
466 typedef struct LDKCVec_SignatureZ {
467 struct LDKSignature *data;
469 } LDKCVec_SignatureZ;
474 * Information needed to build and sign a holder's commitment transaction.
476 * The transaction is only signed once we are ready to broadcast.
478 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
480 * A pointer to the opaque Rust object.
481 * Nearly everywhere, inner must be non-null, however in places where
482 * the Rust equivalent takes an Option, it may be set to null to indicate None.
484 LDKnativeHolderCommitmentTransaction *inner;
486 * Indicates that this is the only struct which contains the same pointer.
487 * Rust functions which take ownership of an object provided via an argument require
488 * this to be true and invalidate the object pointed to by inner.
491 } LDKHolderCommitmentTransaction;
493 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
494 struct LDKHolderCommitmentTransaction *result;
495 struct LDKDecodeError *err;
496 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
498 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
499 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
501 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
506 * A pre-built Bitcoin commitment transaction and its txid.
508 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
510 * A pointer to the opaque Rust object.
511 * Nearly everywhere, inner must be non-null, however in places where
512 * the Rust equivalent takes an Option, it may be set to null to indicate None.
514 LDKnativeBuiltCommitmentTransaction *inner;
516 * Indicates that this is the only struct which contains the same pointer.
517 * Rust functions which take ownership of an object provided via an argument require
518 * this to be true and invalidate the object pointed to by inner.
521 } LDKBuiltCommitmentTransaction;
523 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
524 struct LDKBuiltCommitmentTransaction *result;
525 struct LDKDecodeError *err;
526 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
528 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
529 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
531 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
536 * This class tracks the per-transaction information needed to build a commitment transaction and to
537 * actually build it and sign. It is used for holder transactions that we sign only when needed
538 * and for transactions we sign for the counterparty.
540 * This class can be used inside a signer implementation to generate a signature given the relevant
543 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
545 * A pointer to the opaque Rust object.
546 * Nearly everywhere, inner must be non-null, however in places where
547 * the Rust equivalent takes an Option, it may be set to null to indicate None.
549 LDKnativeCommitmentTransaction *inner;
551 * Indicates that this is the only struct which contains the same pointer.
552 * Rust functions which take ownership of an object provided via an argument require
553 * this to be true and invalidate the object pointed to by inner.
556 } LDKCommitmentTransaction;
558 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
559 struct LDKCommitmentTransaction *result;
560 struct LDKDecodeError *err;
561 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
563 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
564 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
566 } LDKCResult_CommitmentTransactionDecodeErrorZ;
571 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
572 * transaction and the transaction creation keys) are trusted.
574 * See trust() and verify() functions on CommitmentTransaction.
576 * This structure implements Deref.
578 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
580 * A pointer to the opaque Rust object.
581 * Nearly everywhere, inner must be non-null, however in places where
582 * the Rust equivalent takes an Option, it may be set to null to indicate None.
584 LDKnativeTrustedCommitmentTransaction *inner;
586 * Indicates that this is the only struct which contains the same pointer.
587 * Rust functions which take ownership of an object provided via an argument require
588 * this to be true and invalidate the object pointed to by inner.
591 } LDKTrustedCommitmentTransaction;
593 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
594 struct LDKTrustedCommitmentTransaction *result;
596 * Note that this value is always NULL, as there are no contents in the Err variant
599 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
601 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
602 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
604 } LDKCResult_TrustedCommitmentTransactionNoneZ;
606 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
607 struct LDKCVec_SignatureZ *result;
609 * Note that this value is always NULL, as there are no contents in the Err variant
612 } LDKCResult_CVec_SignatureZNoneZPtr;
614 typedef struct LDKCResult_CVec_SignatureZNoneZ {
615 union LDKCResult_CVec_SignatureZNoneZPtr contents;
617 } LDKCResult_CVec_SignatureZNoneZ;
622 * An accept_channel message to be sent or received from a peer
624 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
626 * A pointer to the opaque Rust object.
627 * Nearly everywhere, inner must be non-null, however in places where
628 * the Rust equivalent takes an Option, it may be set to null to indicate None.
630 LDKnativeAcceptChannel *inner;
632 * Indicates that this is the only struct which contains the same pointer.
633 * Rust functions which take ownership of an object provided via an argument require
634 * this to be true and invalidate the object pointed to by inner.
642 * An open_channel message to be sent or received from a peer
644 typedef struct MUST_USE_STRUCT LDKOpenChannel {
646 * A pointer to the opaque Rust object.
647 * Nearly everywhere, inner must be non-null, however in places where
648 * the Rust equivalent takes an Option, it may be set to null to indicate None.
650 LDKnativeOpenChannel *inner;
652 * Indicates that this is the only struct which contains the same pointer.
653 * Rust functions which take ownership of an object provided via an argument require
654 * this to be true and invalidate the object pointed to by inner.
662 * A funding_created message to be sent or received from a peer
664 typedef struct MUST_USE_STRUCT LDKFundingCreated {
666 * A pointer to the opaque Rust object.
667 * Nearly everywhere, inner must be non-null, however in places where
668 * the Rust equivalent takes an Option, it may be set to null to indicate None.
670 LDKnativeFundingCreated *inner;
672 * Indicates that this is the only struct which contains the same pointer.
673 * Rust functions which take ownership of an object provided via an argument require
674 * this to be true and invalidate the object pointed to by inner.
682 * A funding_signed message to be sent or received from a peer
684 typedef struct MUST_USE_STRUCT LDKFundingSigned {
686 * A pointer to the opaque Rust object.
687 * Nearly everywhere, inner must be non-null, however in places where
688 * the Rust equivalent takes an Option, it may be set to null to indicate None.
690 LDKnativeFundingSigned *inner;
692 * Indicates that this is the only struct which contains the same pointer.
693 * Rust functions which take ownership of an object provided via an argument require
694 * this to be true and invalidate the object pointed to by inner.
702 * A funding_locked message to be sent or received from a peer
704 typedef struct MUST_USE_STRUCT LDKFundingLocked {
706 * A pointer to the opaque Rust object.
707 * Nearly everywhere, inner must be non-null, however in places where
708 * the Rust equivalent takes an Option, it may be set to null to indicate None.
710 LDKnativeFundingLocked *inner;
712 * Indicates that this is the only struct which contains the same pointer.
713 * Rust functions which take ownership of an object provided via an argument require
714 * this to be true and invalidate the object pointed to by inner.
722 * An announcement_signatures message to be sent or received from a peer
724 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
726 * A pointer to the opaque Rust object.
727 * Nearly everywhere, inner must be non-null, however in places where
728 * the Rust equivalent takes an Option, it may be set to null to indicate None.
730 LDKnativeAnnouncementSignatures *inner;
732 * Indicates that this is the only struct which contains the same pointer.
733 * Rust functions which take ownership of an object provided via an argument require
734 * this to be true and invalidate the object pointed to by inner.
737 } LDKAnnouncementSignatures;
742 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
743 * transaction updates if they were pending.
745 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
747 * A pointer to the opaque Rust object.
748 * Nearly everywhere, inner must be non-null, however in places where
749 * the Rust equivalent takes an Option, it may be set to null to indicate None.
751 LDKnativeCommitmentUpdate *inner;
753 * Indicates that this is the only struct which contains the same pointer.
754 * Rust functions which take ownership of an object provided via an argument require
755 * this to be true and invalidate the object pointed to by inner.
758 } LDKCommitmentUpdate;
763 * A revoke_and_ack message to be sent or received from a peer
765 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
767 * A pointer to the opaque Rust object.
768 * Nearly everywhere, inner must be non-null, however in places where
769 * the Rust equivalent takes an Option, it may be set to null to indicate None.
771 LDKnativeRevokeAndACK *inner;
773 * Indicates that this is the only struct which contains the same pointer.
774 * Rust functions which take ownership of an object provided via an argument require
775 * this to be true and invalidate the object pointed to by inner.
783 * A closing_signed message to be sent or received from a peer
785 typedef struct MUST_USE_STRUCT LDKClosingSigned {
787 * A pointer to the opaque Rust object.
788 * Nearly everywhere, inner must be non-null, however in places where
789 * the Rust equivalent takes an Option, it may be set to null to indicate None.
791 LDKnativeClosingSigned *inner;
793 * Indicates that this is the only struct which contains the same pointer.
794 * Rust functions which take ownership of an object provided via an argument require
795 * this to be true and invalidate the object pointed to by inner.
803 * A shutdown message to be sent or received from a peer
805 typedef struct MUST_USE_STRUCT LDKShutdown {
807 * A pointer to the opaque Rust object.
808 * Nearly everywhere, inner must be non-null, however in places where
809 * the Rust equivalent takes an Option, it may be set to null to indicate None.
811 LDKnativeShutdown *inner;
813 * Indicates that this is the only struct which contains the same pointer.
814 * Rust functions which take ownership of an object provided via an argument require
815 * this to be true and invalidate the object pointed to by inner.
823 * A channel_reestablish message to be sent or received from a peer
825 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
827 * A pointer to the opaque Rust object.
828 * Nearly everywhere, inner must be non-null, however in places where
829 * the Rust equivalent takes an Option, it may be set to null to indicate None.
831 LDKnativeChannelReestablish *inner;
833 * Indicates that this is the only struct which contains the same pointer.
834 * Rust functions which take ownership of an object provided via an argument require
835 * this to be true and invalidate the object pointed to by inner.
838 } LDKChannelReestablish;
843 * A channel_announcement message to be sent or received from a peer
845 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
847 * A pointer to the opaque Rust object.
848 * Nearly everywhere, inner must be non-null, however in places where
849 * the Rust equivalent takes an Option, it may be set to null to indicate None.
851 LDKnativeChannelAnnouncement *inner;
853 * Indicates that this is the only struct which contains the same pointer.
854 * Rust functions which take ownership of an object provided via an argument require
855 * this to be true and invalidate the object pointed to by inner.
858 } LDKChannelAnnouncement;
863 * A channel_update message to be sent or received from a peer
865 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
867 * A pointer to the opaque Rust object.
868 * Nearly everywhere, inner must be non-null, however in places where
869 * the Rust equivalent takes an Option, it may be set to null to indicate None.
871 LDKnativeChannelUpdate *inner;
873 * Indicates that this is the only struct which contains the same pointer.
874 * Rust functions which take ownership of an object provided via an argument require
875 * this to be true and invalidate the object pointed to by inner.
883 * A node_announcement message to be sent or received from a peer
885 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
887 * A pointer to the opaque Rust object.
888 * Nearly everywhere, inner must be non-null, however in places where
889 * the Rust equivalent takes an Option, it may be set to null to indicate None.
891 LDKnativeNodeAnnouncement *inner;
893 * Indicates that this is the only struct which contains the same pointer.
894 * Rust functions which take ownership of an object provided via an argument require
895 * this to be true and invalidate the object pointed to by inner.
898 } LDKNodeAnnouncement;
903 * An error message to be sent or received from a peer
905 typedef struct MUST_USE_STRUCT LDKErrorMessage {
907 * A pointer to the opaque Rust object.
908 * Nearly everywhere, inner must be non-null, however in places where
909 * the Rust equivalent takes an Option, it may be set to null to indicate None.
911 LDKnativeErrorMessage *inner;
913 * Indicates that this is the only struct which contains the same pointer.
914 * Rust functions which take ownership of an object provided via an argument require
915 * this to be true and invalidate the object pointed to by inner.
921 * Used to put an error message in a LightningError
923 typedef enum LDKErrorAction_Tag {
925 * The peer took some action which made us think they were useless. Disconnect them.
927 LDKErrorAction_DisconnectPeer,
929 * The peer did something harmless that we weren't able to process, just log and ignore
931 LDKErrorAction_IgnoreError,
933 * The peer did something incorrect. Tell them.
935 LDKErrorAction_SendErrorMessage,
937 * Must be last for serialization purposes
939 LDKErrorAction_Sentinel,
940 } LDKErrorAction_Tag;
942 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
944 * An error message which we should make an effort to send before we disconnect.
946 struct LDKErrorMessage msg;
947 } LDKErrorAction_LDKDisconnectPeer_Body;
949 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
951 * The message to send.
953 struct LDKErrorMessage msg;
954 } LDKErrorAction_LDKSendErrorMessage_Body;
956 typedef struct MUST_USE_STRUCT LDKErrorAction {
957 LDKErrorAction_Tag tag;
959 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
960 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
965 * The information we received from a peer along the route of a payment we originated. This is
966 * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
967 * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
969 typedef enum LDKHTLCFailChannelUpdate_Tag {
971 * We received an error which included a full ChannelUpdate message.
973 LDKHTLCFailChannelUpdate_ChannelUpdateMessage,
975 * We received an error which indicated only that a channel has been closed
977 LDKHTLCFailChannelUpdate_ChannelClosed,
979 * We received an error which indicated only that a node has failed
981 LDKHTLCFailChannelUpdate_NodeFailure,
983 * Must be last for serialization purposes
985 LDKHTLCFailChannelUpdate_Sentinel,
986 } LDKHTLCFailChannelUpdate_Tag;
988 typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body {
990 * The unwrapped message we received
992 struct LDKChannelUpdate msg;
993 } LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
995 typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
997 * The short_channel_id which has now closed.
999 uint64_t short_channel_id;
1001 * when this true, this channel should be permanently removed from the
1002 * consideration. Otherwise, this channel can be restored as new channel_update is received
1005 } LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
1007 typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
1009 * The node_id that has failed.
1011 struct LDKPublicKey node_id;
1013 * when this true, node should be permanently removed from the
1014 * consideration. Otherwise, the channels connected to this node can be
1015 * restored as new channel_update is received
1018 } LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
1020 typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate {
1021 LDKHTLCFailChannelUpdate_Tag tag;
1023 LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message;
1024 LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed;
1025 LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure;
1027 } LDKHTLCFailChannelUpdate;
1032 * A query_channel_range message is used to query a peer for channel
1033 * UTXOs in a range of blocks. The recipient of a query makes a best
1034 * effort to reply to the query using one or more reply_channel_range
1037 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
1039 * A pointer to the opaque Rust object.
1040 * Nearly everywhere, inner must be non-null, however in places where
1041 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1043 LDKnativeQueryChannelRange *inner;
1045 * Indicates that this is the only struct which contains the same pointer.
1046 * Rust functions which take ownership of an object provided via an argument require
1047 * this to be true and invalidate the object pointed to by inner.
1050 } LDKQueryChannelRange;
1055 * A query_short_channel_ids message is used to query a peer for
1056 * routing gossip messages related to one or more short_channel_ids.
1057 * The query recipient will reply with the latest, if available,
1058 * channel_announcement, channel_update and node_announcement messages
1059 * it maintains for the requested short_channel_ids followed by a
1060 * reply_short_channel_ids_end message. The short_channel_ids sent in
1061 * this query are encoded. We only support encoding_type=0 uncompressed
1062 * serialization and do not support encoding_type=1 zlib serialization.
1064 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
1066 * A pointer to the opaque Rust object.
1067 * Nearly everywhere, inner must be non-null, however in places where
1068 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1070 LDKnativeQueryShortChannelIds *inner;
1072 * Indicates that this is the only struct which contains the same pointer.
1073 * Rust functions which take ownership of an object provided via an argument require
1074 * this to be true and invalidate the object pointed to by inner.
1077 } LDKQueryShortChannelIds;
1082 * A reply_channel_range message is a reply to a query_channel_range
1083 * message. Multiple reply_channel_range messages can be sent in reply
1084 * to a single query_channel_range message. The query recipient makes a
1085 * best effort to respond based on their local network view which may
1086 * not be a perfect view of the network. The short_channel_ids in the
1087 * reply are encoded. We only support encoding_type=0 uncompressed
1088 * serialization and do not support encoding_type=1 zlib serialization.
1090 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
1092 * A pointer to the opaque Rust object.
1093 * Nearly everywhere, inner must be non-null, however in places where
1094 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1096 LDKnativeReplyChannelRange *inner;
1098 * Indicates that this is the only struct which contains the same pointer.
1099 * Rust functions which take ownership of an object provided via an argument require
1100 * this to be true and invalidate the object pointed to by inner.
1103 } LDKReplyChannelRange;
1106 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
1107 * broadcast to most peers).
1108 * These events are handled by PeerManager::process_events if you are using a PeerManager.
1110 typedef enum LDKMessageSendEvent_Tag {
1112 * Used to indicate that we've accepted a channel open and should send the accept_channel
1113 * message provided to the given peer.
1115 LDKMessageSendEvent_SendAcceptChannel,
1117 * Used to indicate that we've initiated a channel open and should send the open_channel
1118 * message provided to the given peer.
1120 LDKMessageSendEvent_SendOpenChannel,
1122 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
1124 LDKMessageSendEvent_SendFundingCreated,
1126 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
1128 LDKMessageSendEvent_SendFundingSigned,
1130 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
1132 LDKMessageSendEvent_SendFundingLocked,
1134 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
1136 LDKMessageSendEvent_SendAnnouncementSignatures,
1138 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
1139 * message should be sent to the peer with the given node_id.
1141 LDKMessageSendEvent_UpdateHTLCs,
1143 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
1145 LDKMessageSendEvent_SendRevokeAndACK,
1147 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
1149 LDKMessageSendEvent_SendClosingSigned,
1151 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
1153 LDKMessageSendEvent_SendShutdown,
1155 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
1157 LDKMessageSendEvent_SendChannelReestablish,
1159 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
1160 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
1162 * Note that after doing so, you very likely (unless you did so very recently) want to call
1163 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
1164 * This ensures that any nodes which see our channel_announcement also have a relevant
1165 * node_announcement, including relevant feature flags which may be important for routing
1168 LDKMessageSendEvent_BroadcastChannelAnnouncement,
1170 * Used to indicate that a node_announcement should be broadcast to all peers.
1172 LDKMessageSendEvent_BroadcastNodeAnnouncement,
1174 * Used to indicate that a channel_update should be broadcast to all peers.
1176 LDKMessageSendEvent_BroadcastChannelUpdate,
1178 * Broadcast an error downstream to be handled
1180 LDKMessageSendEvent_HandleError,
1182 * When a payment fails we may receive updates back from the hop where it failed. In such
1183 * cases this event is generated so that we can inform the network graph of this information.
1185 LDKMessageSendEvent_PaymentFailureNetworkUpdate,
1187 * Query a peer for channels with funding transaction UTXOs in a block range.
1189 LDKMessageSendEvent_SendChannelRangeQuery,
1191 * Request routing gossip messages from a peer for a list of channels identified by
1192 * their short_channel_ids.
1194 LDKMessageSendEvent_SendShortIdsQuery,
1196 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
1197 * emitted during processing of the query.
1199 LDKMessageSendEvent_SendReplyChannelRange,
1201 * Must be last for serialization purposes
1203 LDKMessageSendEvent_Sentinel,
1204 } LDKMessageSendEvent_Tag;
1206 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
1208 * The node_id of the node which should receive this message
1210 struct LDKPublicKey node_id;
1212 * The message which should be sent.
1214 struct LDKAcceptChannel msg;
1215 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
1217 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
1219 * The node_id of the node which should receive this message
1221 struct LDKPublicKey node_id;
1223 * The message which should be sent.
1225 struct LDKOpenChannel msg;
1226 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
1228 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
1230 * The node_id of the node which should receive this message
1232 struct LDKPublicKey node_id;
1234 * The message which should be sent.
1236 struct LDKFundingCreated msg;
1237 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
1239 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
1241 * The node_id of the node which should receive this message
1243 struct LDKPublicKey node_id;
1245 * The message which should be sent.
1247 struct LDKFundingSigned msg;
1248 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
1250 typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
1252 * The node_id of the node which should receive these message(s)
1254 struct LDKPublicKey node_id;
1256 * The funding_locked message which should be sent.
1258 struct LDKFundingLocked msg;
1259 } LDKMessageSendEvent_LDKSendFundingLocked_Body;
1261 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
1263 * The node_id of the node which should receive these message(s)
1265 struct LDKPublicKey node_id;
1267 * The announcement_signatures message which should be sent.
1269 struct LDKAnnouncementSignatures msg;
1270 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
1272 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
1274 * The node_id of the node which should receive these message(s)
1276 struct LDKPublicKey node_id;
1278 * The update messages which should be sent. ALL messages in the struct should be sent!
1280 struct LDKCommitmentUpdate updates;
1281 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
1283 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
1285 * The node_id of the node which should receive this message
1287 struct LDKPublicKey node_id;
1289 * The message which should be sent.
1291 struct LDKRevokeAndACK msg;
1292 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
1294 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
1296 * The node_id of the node which should receive this message
1298 struct LDKPublicKey node_id;
1300 * The message which should be sent.
1302 struct LDKClosingSigned msg;
1303 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
1305 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
1307 * The node_id of the node which should receive this message
1309 struct LDKPublicKey node_id;
1311 * The message which should be sent.
1313 struct LDKShutdown msg;
1314 } LDKMessageSendEvent_LDKSendShutdown_Body;
1316 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
1318 * The node_id of the node which should receive this message
1320 struct LDKPublicKey node_id;
1322 * The message which should be sent.
1324 struct LDKChannelReestablish msg;
1325 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
1327 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
1329 * The channel_announcement which should be sent.
1331 struct LDKChannelAnnouncement msg;
1333 * The followup channel_update which should be sent.
1335 struct LDKChannelUpdate update_msg;
1336 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
1338 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
1340 * The node_announcement which should be sent.
1342 struct LDKNodeAnnouncement msg;
1343 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
1345 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
1347 * The channel_update which should be sent.
1349 struct LDKChannelUpdate msg;
1350 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
1352 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
1354 * The node_id of the node which should receive this message
1356 struct LDKPublicKey node_id;
1358 * The action which should be taken.
1360 struct LDKErrorAction action;
1361 } LDKMessageSendEvent_LDKHandleError_Body;
1363 typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
1365 * The channel/node update which should be sent to NetGraphMsgHandler
1367 struct LDKHTLCFailChannelUpdate update;
1368 } LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
1370 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
1372 * The node_id of this message recipient
1374 struct LDKPublicKey node_id;
1376 * The query_channel_range which should be sent.
1378 struct LDKQueryChannelRange msg;
1379 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
1381 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
1383 * The node_id of this message recipient
1385 struct LDKPublicKey node_id;
1387 * The query_short_channel_ids which should be sent.
1389 struct LDKQueryShortChannelIds msg;
1390 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
1392 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
1394 * The node_id of this message recipient
1396 struct LDKPublicKey node_id;
1398 * The reply_channel_range which should be sent.
1400 struct LDKReplyChannelRange msg;
1401 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
1403 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
1404 LDKMessageSendEvent_Tag tag;
1406 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
1407 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
1408 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
1409 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
1410 LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
1411 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
1412 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
1413 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
1414 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
1415 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
1416 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
1417 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
1418 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
1419 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
1420 LDKMessageSendEvent_LDKHandleError_Body handle_error;
1421 LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update;
1422 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
1423 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
1424 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
1426 } LDKMessageSendEvent;
1428 typedef struct LDKCVec_MessageSendEventZ {
1429 struct LDKMessageSendEvent *data;
1431 } LDKCVec_MessageSendEventZ;
1436 * An Err type for failure to process messages.
1438 typedef struct MUST_USE_STRUCT LDKLightningError {
1440 * A pointer to the opaque Rust object.
1441 * Nearly everywhere, inner must be non-null, however in places where
1442 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1444 LDKnativeLightningError *inner;
1446 * Indicates that this is the only struct which contains the same pointer.
1447 * Rust functions which take ownership of an object provided via an argument require
1448 * this to be true and invalidate the object pointed to by inner.
1451 } LDKLightningError;
1453 typedef union LDKCResult_boolLightningErrorZPtr {
1455 struct LDKLightningError *err;
1456 } LDKCResult_boolLightningErrorZPtr;
1458 typedef struct LDKCResult_boolLightningErrorZ {
1459 union LDKCResult_boolLightningErrorZPtr contents;
1461 } LDKCResult_boolLightningErrorZ;
1463 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
1464 struct LDKChannelAnnouncement a;
1465 struct LDKChannelUpdate b;
1466 struct LDKChannelUpdate c;
1467 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
1469 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
1470 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
1472 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
1474 typedef struct LDKCVec_NodeAnnouncementZ {
1475 struct LDKNodeAnnouncement *data;
1477 } LDKCVec_NodeAnnouncementZ;
1479 typedef union LDKCResult_NoneLightningErrorZPtr {
1481 * Note that this value is always NULL, as there are no contents in the OK variant
1484 struct LDKLightningError *err;
1485 } LDKCResult_NoneLightningErrorZPtr;
1487 typedef struct LDKCResult_NoneLightningErrorZ {
1488 union LDKCResult_NoneLightningErrorZPtr contents;
1490 } LDKCResult_NoneLightningErrorZ;
1492 typedef struct LDKCVec_PublicKeyZ {
1493 struct LDKPublicKey *data;
1495 } LDKCVec_PublicKeyZ;
1500 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
1501 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
1504 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
1506 * A pointer to the opaque Rust object.
1507 * Nearly everywhere, inner must be non-null, however in places where
1508 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1510 LDKnativePeerHandleError *inner;
1512 * Indicates that this is the only struct which contains the same pointer.
1513 * Rust functions which take ownership of an object provided via an argument require
1514 * this to be true and invalidate the object pointed to by inner.
1517 } LDKPeerHandleError;
1519 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
1520 struct LDKCVec_u8Z *result;
1521 struct LDKPeerHandleError *err;
1522 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
1524 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
1525 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
1527 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
1529 typedef union LDKCResult_NonePeerHandleErrorZPtr {
1531 * Note that this value is always NULL, as there are no contents in the OK variant
1534 struct LDKPeerHandleError *err;
1535 } LDKCResult_NonePeerHandleErrorZPtr;
1537 typedef struct LDKCResult_NonePeerHandleErrorZ {
1538 union LDKCResult_NonePeerHandleErrorZPtr contents;
1540 } LDKCResult_NonePeerHandleErrorZ;
1542 typedef union LDKCResult_boolPeerHandleErrorZPtr {
1544 struct LDKPeerHandleError *err;
1545 } LDKCResult_boolPeerHandleErrorZPtr;
1547 typedef struct LDKCResult_boolPeerHandleErrorZ {
1548 union LDKCResult_boolPeerHandleErrorZPtr contents;
1550 } LDKCResult_boolPeerHandleErrorZ;
1555 * Features used within an `init` message.
1557 typedef struct MUST_USE_STRUCT LDKInitFeatures {
1559 * A pointer to the opaque Rust object.
1560 * Nearly everywhere, inner must be non-null, however in places where
1561 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1563 LDKnativeInitFeatures *inner;
1565 * Indicates that this is the only struct which contains the same pointer.
1566 * Rust functions which take ownership of an object provided via an argument require
1567 * this to be true and invalidate the object pointed to by inner.
1572 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
1573 struct LDKInitFeatures *result;
1574 struct LDKDecodeError *err;
1575 } LDKCResult_InitFeaturesDecodeErrorZPtr;
1577 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
1578 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
1580 } LDKCResult_InitFeaturesDecodeErrorZ;
1585 * Features used within a `node_announcement` message.
1587 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
1589 * A pointer to the opaque Rust object.
1590 * Nearly everywhere, inner must be non-null, however in places where
1591 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1593 LDKnativeNodeFeatures *inner;
1595 * Indicates that this is the only struct which contains the same pointer.
1596 * Rust functions which take ownership of an object provided via an argument require
1597 * this to be true and invalidate the object pointed to by inner.
1602 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
1603 struct LDKNodeFeatures *result;
1604 struct LDKDecodeError *err;
1605 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
1607 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
1608 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
1610 } LDKCResult_NodeFeaturesDecodeErrorZ;
1615 * Features used within a `channel_announcement` message.
1617 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
1619 * A pointer to the opaque Rust object.
1620 * Nearly everywhere, inner must be non-null, however in places where
1621 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1623 LDKnativeChannelFeatures *inner;
1625 * Indicates that this is the only struct which contains the same pointer.
1626 * Rust functions which take ownership of an object provided via an argument require
1627 * this to be true and invalidate the object pointed to by inner.
1630 } LDKChannelFeatures;
1632 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
1633 struct LDKChannelFeatures *result;
1634 struct LDKDecodeError *err;
1635 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
1637 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
1638 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
1640 } LDKCResult_ChannelFeaturesDecodeErrorZ;
1645 * Features used within an invoice.
1647 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
1649 * A pointer to the opaque Rust object.
1650 * Nearly everywhere, inner must be non-null, however in places where
1651 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1653 LDKnativeInvoiceFeatures *inner;
1655 * Indicates that this is the only struct which contains the same pointer.
1656 * Rust functions which take ownership of an object provided via an argument require
1657 * this to be true and invalidate the object pointed to by inner.
1660 } LDKInvoiceFeatures;
1662 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
1663 struct LDKInvoiceFeatures *result;
1664 struct LDKDecodeError *err;
1665 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
1667 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
1668 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
1670 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
1675 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
1676 * with our counterparty.
1678 typedef struct MUST_USE_STRUCT LDKChannelConfig {
1680 * A pointer to the opaque Rust object.
1681 * Nearly everywhere, inner must be non-null, however in places where
1682 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1684 LDKnativeChannelConfig *inner;
1686 * Indicates that this is the only struct which contains the same pointer.
1687 * Rust functions which take ownership of an object provided via an argument require
1688 * this to be true and invalidate the object pointed to by inner.
1693 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
1694 struct LDKChannelConfig *result;
1695 struct LDKDecodeError *err;
1696 } LDKCResult_ChannelConfigDecodeErrorZPtr;
1698 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
1699 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
1701 } LDKCResult_ChannelConfigDecodeErrorZ;
1703 typedef enum LDKCOption_u64Z_Tag {
1704 LDKCOption_u64Z_Some,
1705 LDKCOption_u64Z_None,
1707 * Must be last for serialization purposes
1709 LDKCOption_u64Z_Sentinel,
1710 } LDKCOption_u64Z_Tag;
1712 typedef struct LDKCOption_u64Z {
1713 LDKCOption_u64Z_Tag tag;
1724 * Details about one direction of a channel. Received
1725 * within a channel update.
1727 typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
1729 * A pointer to the opaque Rust object.
1730 * Nearly everywhere, inner must be non-null, however in places where
1731 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1733 LDKnativeDirectionalChannelInfo *inner;
1735 * Indicates that this is the only struct which contains the same pointer.
1736 * Rust functions which take ownership of an object provided via an argument require
1737 * this to be true and invalidate the object pointed to by inner.
1740 } LDKDirectionalChannelInfo;
1742 typedef union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr {
1743 struct LDKDirectionalChannelInfo *result;
1744 struct LDKDecodeError *err;
1745 } LDKCResult_DirectionalChannelInfoDecodeErrorZPtr;
1747 typedef struct LDKCResult_DirectionalChannelInfoDecodeErrorZ {
1748 union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr contents;
1750 } LDKCResult_DirectionalChannelInfoDecodeErrorZ;
1755 * Details about a channel (both directions).
1756 * Received within a channel announcement.
1758 typedef struct MUST_USE_STRUCT LDKChannelInfo {
1760 * A pointer to the opaque Rust object.
1761 * Nearly everywhere, inner must be non-null, however in places where
1762 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1764 LDKnativeChannelInfo *inner;
1766 * Indicates that this is the only struct which contains the same pointer.
1767 * Rust functions which take ownership of an object provided via an argument require
1768 * this to be true and invalidate the object pointed to by inner.
1773 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
1774 struct LDKChannelInfo *result;
1775 struct LDKDecodeError *err;
1776 } LDKCResult_ChannelInfoDecodeErrorZPtr;
1778 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
1779 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
1781 } LDKCResult_ChannelInfoDecodeErrorZ;
1786 * Fees for routing via a given channel or a node
1788 typedef struct MUST_USE_STRUCT LDKRoutingFees {
1790 * A pointer to the opaque Rust object.
1791 * Nearly everywhere, inner must be non-null, however in places where
1792 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1794 LDKnativeRoutingFees *inner;
1796 * Indicates that this is the only struct which contains the same pointer.
1797 * Rust functions which take ownership of an object provided via an argument require
1798 * this to be true and invalidate the object pointed to by inner.
1803 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
1804 struct LDKRoutingFees *result;
1805 struct LDKDecodeError *err;
1806 } LDKCResult_RoutingFeesDecodeErrorZPtr;
1808 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
1809 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
1811 } LDKCResult_RoutingFeesDecodeErrorZ;
1813 typedef struct LDKFourBytes {
1817 typedef struct LDKSixteenBytes {
1821 typedef struct LDKTenBytes {
1826 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
1827 * look up the corresponding function in rust-lightning's docs.
1829 typedef struct LDKThirtyTwoBytes {
1831 } LDKThirtyTwoBytes;
1834 * An address which can be used to connect to a remote peer
1836 typedef enum LDKNetAddress_Tag {
1838 * An IPv4 address/port on which the peer is listening.
1842 * An IPv6 address/port on which the peer is listening.
1846 * An old-style Tor onion address/port on which the peer is listening.
1848 LDKNetAddress_OnionV2,
1850 * A new-style Tor onion address/port on which the peer is listening.
1851 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
1852 * wrap as base32 and append \".onion\".
1854 LDKNetAddress_OnionV3,
1856 * Must be last for serialization purposes
1858 LDKNetAddress_Sentinel,
1859 } LDKNetAddress_Tag;
1861 typedef struct LDKNetAddress_LDKIPv4_Body {
1863 * The 4-byte IPv4 address
1865 struct LDKFourBytes addr;
1867 * The port on which the node is listening
1870 } LDKNetAddress_LDKIPv4_Body;
1872 typedef struct LDKNetAddress_LDKIPv6_Body {
1874 * The 16-byte IPv6 address
1876 struct LDKSixteenBytes addr;
1878 * The port on which the node is listening
1881 } LDKNetAddress_LDKIPv6_Body;
1883 typedef struct LDKNetAddress_LDKOnionV2_Body {
1885 * The bytes (usually encoded in base32 with \".onion\" appended)
1887 struct LDKTenBytes addr;
1889 * The port on which the node is listening
1892 } LDKNetAddress_LDKOnionV2_Body;
1894 typedef struct LDKNetAddress_LDKOnionV3_Body {
1896 * The ed25519 long-term public key of the peer
1898 struct LDKThirtyTwoBytes ed25519_pubkey;
1900 * The checksum of the pubkey and version, as included in the onion address
1904 * The version byte, as defined by the Tor Onion v3 spec.
1908 * The port on which the node is listening
1911 } LDKNetAddress_LDKOnionV3_Body;
1913 typedef struct MUST_USE_STRUCT LDKNetAddress {
1914 LDKNetAddress_Tag tag;
1916 LDKNetAddress_LDKIPv4_Body i_pv4;
1917 LDKNetAddress_LDKIPv6_Body i_pv6;
1918 LDKNetAddress_LDKOnionV2_Body onion_v2;
1919 LDKNetAddress_LDKOnionV3_Body onion_v3;
1923 typedef struct LDKCVec_NetAddressZ {
1924 struct LDKNetAddress *data;
1926 } LDKCVec_NetAddressZ;
1931 * Information received in the latest node_announcement from this node.
1933 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
1935 * A pointer to the opaque Rust object.
1936 * Nearly everywhere, inner must be non-null, however in places where
1937 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1939 LDKnativeNodeAnnouncementInfo *inner;
1941 * Indicates that this is the only struct which contains the same pointer.
1942 * Rust functions which take ownership of an object provided via an argument require
1943 * this to be true and invalidate the object pointed to by inner.
1946 } LDKNodeAnnouncementInfo;
1948 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
1949 struct LDKNodeAnnouncementInfo *result;
1950 struct LDKDecodeError *err;
1951 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
1953 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
1954 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
1956 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
1958 typedef struct LDKCVec_u64Z {
1966 * Details about a node in the network, known from the network announcement.
1968 typedef struct MUST_USE_STRUCT LDKNodeInfo {
1970 * A pointer to the opaque Rust object.
1971 * Nearly everywhere, inner must be non-null, however in places where
1972 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1974 LDKnativeNodeInfo *inner;
1976 * Indicates that this is the only struct which contains the same pointer.
1977 * Rust functions which take ownership of an object provided via an argument require
1978 * this to be true and invalidate the object pointed to by inner.
1983 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
1984 struct LDKNodeInfo *result;
1985 struct LDKDecodeError *err;
1986 } LDKCResult_NodeInfoDecodeErrorZPtr;
1988 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
1989 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
1991 } LDKCResult_NodeInfoDecodeErrorZ;
1996 * Represents the network as nodes and channels between them
1998 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
2000 * A pointer to the opaque Rust object.
2001 * Nearly everywhere, inner must be non-null, however in places where
2002 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2004 LDKnativeNetworkGraph *inner;
2006 * Indicates that this is the only struct which contains the same pointer.
2007 * Rust functions which take ownership of an object provided via an argument require
2008 * this to be true and invalidate the object pointed to by inner.
2013 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
2014 struct LDKNetworkGraph *result;
2015 struct LDKDecodeError *err;
2016 } LDKCResult_NetworkGraphDecodeErrorZPtr;
2018 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
2019 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
2021 } LDKCResult_NetworkGraphDecodeErrorZ;
2023 typedef struct LDKC2Tuple_usizeTransactionZ {
2025 struct LDKTransaction b;
2026 } LDKC2Tuple_usizeTransactionZ;
2028 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
2029 struct LDKC2Tuple_usizeTransactionZ *data;
2031 } LDKCVec_C2Tuple_usizeTransactionZZ;
2033 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
2035 * Note that this value is always NULL, as there are no contents in the OK variant
2038 enum LDKChannelMonitorUpdateErr *err;
2039 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
2041 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
2042 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
2044 } LDKCResult_NoneChannelMonitorUpdateErrZ;
2049 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
2050 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
2051 * preimage claim backward will lead to loss of funds.
2053 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
2055 * A pointer to the opaque Rust object.
2056 * Nearly everywhere, inner must be non-null, however in places where
2057 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2059 LDKnativeHTLCUpdate *inner;
2061 * Indicates that this is the only struct which contains the same pointer.
2062 * Rust functions which take ownership of an object provided via an argument require
2063 * this to be true and invalidate the object pointed to by inner.
2071 * A reference to a transaction output.
2073 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
2074 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
2076 typedef struct MUST_USE_STRUCT LDKOutPoint {
2078 * A pointer to the opaque Rust object.
2079 * Nearly everywhere, inner must be non-null, however in places where
2080 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2082 LDKnativeOutPoint *inner;
2084 * Indicates that this is the only struct which contains the same pointer.
2085 * Rust functions which take ownership of an object provided via an argument require
2086 * this to be true and invalidate the object pointed to by inner.
2092 * An event to be processed by the ChannelManager.
2094 typedef enum LDKMonitorEvent_Tag {
2096 * A monitor event containing an HTLCUpdate.
2098 LDKMonitorEvent_HTLCEvent,
2100 * A monitor event that the Channel's commitment transaction was broadcasted.
2102 LDKMonitorEvent_CommitmentTxBroadcasted,
2104 * Must be last for serialization purposes
2106 LDKMonitorEvent_Sentinel,
2107 } LDKMonitorEvent_Tag;
2109 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
2110 LDKMonitorEvent_Tag tag;
2113 struct LDKHTLCUpdate htlc_event;
2116 struct LDKOutPoint commitment_tx_broadcasted;
2121 typedef struct LDKCVec_MonitorEventZ {
2122 struct LDKMonitorEvent *data;
2124 } LDKCVec_MonitorEventZ;
2129 * Information about a spendable output to a P2WSH script. See
2130 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
2132 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
2134 * A pointer to the opaque Rust object.
2135 * Nearly everywhere, inner must be non-null, however in places where
2136 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2138 LDKnativeDelayedPaymentOutputDescriptor *inner;
2140 * Indicates that this is the only struct which contains the same pointer.
2141 * Rust functions which take ownership of an object provided via an argument require
2142 * this to be true and invalidate the object pointed to by inner.
2145 } LDKDelayedPaymentOutputDescriptor;
2150 * Information about a spendable output to our \"payment key\". See
2151 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
2153 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
2155 * A pointer to the opaque Rust object.
2156 * Nearly everywhere, inner must be non-null, however in places where
2157 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2159 LDKnativeStaticPaymentOutputDescriptor *inner;
2161 * Indicates that this is the only struct which contains the same pointer.
2162 * Rust functions which take ownership of an object provided via an argument require
2163 * this to be true and invalidate the object pointed to by inner.
2166 } LDKStaticPaymentOutputDescriptor;
2169 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
2170 * claim at any point in the future) an event is generated which you must track and be able to
2171 * spend on-chain. The information needed to do this is provided in this enum, including the
2172 * outpoint describing which txid and output index is available, the full output which exists at
2173 * that txid/index, and any keys or other information required to sign.
2175 typedef enum LDKSpendableOutputDescriptor_Tag {
2177 * An output to a script which was provided via KeysInterface directly, either from
2178 * `get_destination_script()` or `get_shutdown_pubkey()`, thus you should already know how to
2179 * spend it. No secret keys are provided as rust-lightning was never given any key.
2180 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
2181 * on-chain using the payment preimage or after it has timed out.
2183 LDKSpendableOutputDescriptor_StaticOutput,
2185 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
2187 * The witness in the spending input should be:
2188 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
2190 * Note that the nSequence field in the spending input must be set to to_self_delay
2191 * (which means the transaction is not broadcastable until at least to_self_delay
2192 * blocks after the outpoint confirms).
2194 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
2195 * it is an output from an old state which we broadcast (which should never happen).
2197 * To derive the delayed_payment key which is used to sign for this input, you must pass the
2198 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
2199 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
2200 * chan_utils::derive_private_key. The public key can be generated without the secret key
2201 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
2204 * To derive the revocation_pubkey provided here (which is used in the witness
2205 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
2206 * call to Sign::ready_channel) and the provided per_commitment point
2207 * to chan_utils::derive_public_revocation_key.
2209 * The witness script which is hashed and included in the output script_pubkey may be
2210 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
2211 * (derived as above), and the to_self_delay contained here to
2212 * chan_utils::get_revokeable_redeemscript.
2214 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
2216 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
2217 * corresponds to the public key in Sign::pubkeys().payment_point).
2218 * The witness in the spending input, is, thus, simply:
2219 * <BIP 143 signature> <payment key>
2221 * These are generally the result of our counterparty having broadcast the current state,
2222 * allowing us to claim the non-HTLC-encumbered outputs immediately.
2224 LDKSpendableOutputDescriptor_StaticPaymentOutput,
2226 * Must be last for serialization purposes
2228 LDKSpendableOutputDescriptor_Sentinel,
2229 } LDKSpendableOutputDescriptor_Tag;
2231 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
2233 * The outpoint which is spendable
2235 struct LDKOutPoint outpoint;
2237 * The output which is referenced by the given outpoint.
2239 struct LDKTxOut output;
2240 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
2242 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
2243 LDKSpendableOutputDescriptor_Tag tag;
2245 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
2247 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
2250 struct LDKStaticPaymentOutputDescriptor static_payment_output;
2253 } LDKSpendableOutputDescriptor;
2255 typedef struct LDKCVec_SpendableOutputDescriptorZ {
2256 struct LDKSpendableOutputDescriptor *data;
2258 } LDKCVec_SpendableOutputDescriptorZ;
2261 * An Event which you should probably take some action in response to.
2263 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
2264 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
2265 * written as it makes no sense to respond to it after reconnecting to peers).
2267 typedef enum LDKEvent_Tag {
2269 * Used to indicate that the client should generate a funding transaction with the given
2270 * parameters and then call ChannelManager::funding_transaction_generated.
2271 * Generated in ChannelManager message handling.
2272 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
2273 * counterparty can steal your funds!
2275 LDKEvent_FundingGenerationReady,
2277 * Used to indicate that the client may now broadcast the funding transaction it created for a
2278 * channel. Broadcasting such a transaction prior to this event may lead to our counterparty
2279 * trivially stealing all funds in the funding transaction!
2281 LDKEvent_FundingBroadcastSafe,
2283 * Indicates we've received money! Just gotta dig out that payment preimage and feed it to
2284 * ChannelManager::claim_funds to get it....
2285 * Note that if the preimage is not known or the amount paid is incorrect, you should call
2286 * ChannelManager::fail_htlc_backwards to free up resources for this HTLC and avoid
2287 * network congestion.
2288 * The amount paid should be considered 'incorrect' when it is less than or more than twice
2289 * the amount expected.
2290 * If you fail to call either ChannelManager::claim_funds or
2291 * ChannelManager::fail_htlc_backwards within the HTLC's timeout, the HTLC will be
2292 * automatically failed.
2294 LDKEvent_PaymentReceived,
2296 * Indicates an outbound payment we made succeeded (ie it made it all the way to its target
2297 * and we got back the payment preimage for it).
2298 * Note that duplicative PaymentSent Events may be generated - it is your responsibility to
2299 * deduplicate them by payment_preimage (which MUST be unique)!
2301 LDKEvent_PaymentSent,
2303 * Indicates an outbound payment we made failed. Probably some intermediary node dropped
2304 * something. You may wish to retry with a different route.
2305 * Note that duplicative PaymentFailed Events may be generated - it is your responsibility to
2306 * deduplicate them by payment_hash (which MUST be unique)!
2308 LDKEvent_PaymentFailed,
2310 * Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
2311 * time in the future.
2313 LDKEvent_PendingHTLCsForwardable,
2315 * Used to indicate that an output was generated on-chain which you should know how to spend.
2316 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
2317 * counterparty spending them due to some kind of timeout. Thus, you need to store them
2318 * somewhere and spend them when you create on-chain transactions.
2320 LDKEvent_SpendableOutputs,
2322 * Must be last for serialization purposes
2327 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
2329 * The random channel_id we picked which you'll need to pass into
2330 * ChannelManager::funding_transaction_generated.
2332 struct LDKThirtyTwoBytes temporary_channel_id;
2334 * The value, in satoshis, that the output should have.
2336 uint64_t channel_value_satoshis;
2338 * The script which should be used in the transaction output.
2340 struct LDKCVec_u8Z output_script;
2342 * The value passed in to ChannelManager::create_channel
2344 uint64_t user_channel_id;
2345 } LDKEvent_LDKFundingGenerationReady_Body;
2347 typedef struct LDKEvent_LDKFundingBroadcastSafe_Body {
2349 * The output, which was passed to ChannelManager::funding_transaction_generated, which is
2350 * now safe to broadcast.
2352 struct LDKOutPoint funding_txo;
2354 * The value passed in to ChannelManager::create_channel
2356 uint64_t user_channel_id;
2357 } LDKEvent_LDKFundingBroadcastSafe_Body;
2359 typedef struct LDKEvent_LDKPaymentReceived_Body {
2361 * The hash for which the preimage should be handed to the ChannelManager.
2363 struct LDKThirtyTwoBytes payment_hash;
2365 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
2366 * number of deanonymization attacks during the routing process.
2367 * As nodes upgrade, the invoices you provide should likely migrate to setting the
2368 * payment_secret feature to required, at which point you should fail_backwards any HTLCs
2369 * which have a None here.
2370 * Until then, however, values of None should be ignored, and only incorrect Some values
2371 * should result in an HTLC fail_backwards.
2372 * Note that, in any case, this value must be passed as-is to any fail or claim calls as
2373 * the HTLC index includes this value.
2375 struct LDKThirtyTwoBytes payment_secret;
2377 * The value, in thousandths of a satoshi, that this payment is for. Note that you must
2378 * compare this to the expected value before accepting the payment (as otherwise you are
2379 * providing proof-of-payment for less than the value you expected!).
2382 } LDKEvent_LDKPaymentReceived_Body;
2384 typedef struct LDKEvent_LDKPaymentSent_Body {
2386 * The preimage to the hash given to ChannelManager::send_payment.
2387 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
2390 struct LDKThirtyTwoBytes payment_preimage;
2391 } LDKEvent_LDKPaymentSent_Body;
2393 typedef struct LDKEvent_LDKPaymentFailed_Body {
2395 * The hash which was given to ChannelManager::send_payment.
2397 struct LDKThirtyTwoBytes payment_hash;
2399 * Indicates the payment was rejected for some reason by the recipient. This implies that
2400 * the payment has failed, not just the route in question. If this is not set, you may
2401 * retry the payment via a different route.
2403 bool rejected_by_dest;
2404 } LDKEvent_LDKPaymentFailed_Body;
2406 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
2408 * The minimum amount of time that should be waited prior to calling
2409 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
2410 * you should wait a random amount of time in roughly the range (now + time_forwardable,
2411 * now + 5*time_forwardable).
2413 uint64_t time_forwardable;
2414 } LDKEvent_LDKPendingHTLCsForwardable_Body;
2416 typedef struct LDKEvent_LDKSpendableOutputs_Body {
2418 * The outputs which you should store as spendable by you.
2420 struct LDKCVec_SpendableOutputDescriptorZ outputs;
2421 } LDKEvent_LDKSpendableOutputs_Body;
2423 typedef struct MUST_USE_STRUCT LDKEvent {
2426 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
2427 LDKEvent_LDKFundingBroadcastSafe_Body funding_broadcast_safe;
2428 LDKEvent_LDKPaymentReceived_Body payment_received;
2429 LDKEvent_LDKPaymentSent_Body payment_sent;
2430 LDKEvent_LDKPaymentFailed_Body payment_failed;
2431 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
2432 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
2436 typedef struct LDKCVec_EventZ {
2437 struct LDKEvent *data;
2441 typedef union LDKCResult_OutPointDecodeErrorZPtr {
2442 struct LDKOutPoint *result;
2443 struct LDKDecodeError *err;
2444 } LDKCResult_OutPointDecodeErrorZPtr;
2446 typedef struct LDKCResult_OutPointDecodeErrorZ {
2447 union LDKCResult_OutPointDecodeErrorZPtr contents;
2449 } LDKCResult_OutPointDecodeErrorZ;
2454 * An update generated by the underlying Channel itself which contains some new information the
2455 * ChannelMonitor should be made aware of.
2457 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
2459 * A pointer to the opaque Rust object.
2460 * Nearly everywhere, inner must be non-null, however in places where
2461 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2463 LDKnativeChannelMonitorUpdate *inner;
2465 * Indicates that this is the only struct which contains the same pointer.
2466 * Rust functions which take ownership of an object provided via an argument require
2467 * this to be true and invalidate the object pointed to by inner.
2470 } LDKChannelMonitorUpdate;
2472 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
2473 struct LDKChannelMonitorUpdate *result;
2474 struct LDKDecodeError *err;
2475 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
2477 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
2478 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
2480 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
2482 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
2483 struct LDKHTLCUpdate *result;
2484 struct LDKDecodeError *err;
2485 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
2487 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
2488 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
2490 } LDKCResult_HTLCUpdateDecodeErrorZ;
2495 * General Err type for ChannelMonitor actions. Generally, this implies that the data provided is
2496 * inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this
2497 * means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was
2499 * Contains a developer-readable error message.
2501 typedef struct MUST_USE_STRUCT LDKMonitorUpdateError {
2503 * A pointer to the opaque Rust object.
2504 * Nearly everywhere, inner must be non-null, however in places where
2505 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2507 LDKnativeMonitorUpdateError *inner;
2509 * Indicates that this is the only struct which contains the same pointer.
2510 * Rust functions which take ownership of an object provided via an argument require
2511 * this to be true and invalidate the object pointed to by inner.
2514 } LDKMonitorUpdateError;
2516 typedef union LDKCResult_NoneMonitorUpdateErrorZPtr {
2518 * Note that this value is always NULL, as there are no contents in the OK variant
2521 struct LDKMonitorUpdateError *err;
2522 } LDKCResult_NoneMonitorUpdateErrorZPtr;
2524 typedef struct LDKCResult_NoneMonitorUpdateErrorZ {
2525 union LDKCResult_NoneMonitorUpdateErrorZPtr contents;
2527 } LDKCResult_NoneMonitorUpdateErrorZ;
2529 typedef struct LDKC2Tuple_OutPointScriptZ {
2530 struct LDKOutPoint a;
2531 struct LDKCVec_u8Z b;
2532 } LDKC2Tuple_OutPointScriptZ;
2534 typedef struct LDKC2Tuple_u32ScriptZ {
2536 struct LDKCVec_u8Z b;
2537 } LDKC2Tuple_u32ScriptZ;
2539 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
2540 struct LDKC2Tuple_u32ScriptZ *data;
2542 } LDKCVec_C2Tuple_u32ScriptZZ;
2544 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
2545 struct LDKThirtyTwoBytes a;
2546 struct LDKCVec_C2Tuple_u32ScriptZZ b;
2547 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
2549 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
2550 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
2552 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
2554 typedef struct LDKCVec_TransactionZ {
2555 struct LDKTransaction *data;
2557 } LDKCVec_TransactionZ;
2559 typedef struct LDKC2Tuple_u32TxOutZ {
2562 } LDKC2Tuple_u32TxOutZ;
2564 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
2565 struct LDKC2Tuple_u32TxOutZ *data;
2567 } LDKCVec_C2Tuple_u32TxOutZZ;
2569 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
2570 struct LDKThirtyTwoBytes a;
2571 struct LDKCVec_C2Tuple_u32TxOutZZ b;
2572 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
2574 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ {
2575 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
2577 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ;
2579 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
2580 struct LDKSignature a;
2581 struct LDKCVec_SignatureZ b;
2582 } LDKC2Tuple_SignatureCVec_SignatureZZ;
2584 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
2585 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
2587 * Note that this value is always NULL, as there are no contents in the Err variant
2590 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
2592 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
2593 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
2595 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
2597 typedef union LDKCResult_SignatureNoneZPtr {
2598 struct LDKSignature *result;
2600 * Note that this value is always NULL, as there are no contents in the Err variant
2603 } LDKCResult_SignatureNoneZPtr;
2605 typedef struct LDKCResult_SignatureNoneZ {
2606 union LDKCResult_SignatureNoneZPtr contents;
2608 } LDKCResult_SignatureNoneZ;
2613 * The unsigned part of a channel_announcement
2615 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
2617 * A pointer to the opaque Rust object.
2618 * Nearly everywhere, inner must be non-null, however in places where
2619 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2621 LDKnativeUnsignedChannelAnnouncement *inner;
2623 * Indicates that this is the only struct which contains the same pointer.
2624 * Rust functions which take ownership of an object provided via an argument require
2625 * this to be true and invalidate the object pointed to by inner.
2628 } LDKUnsignedChannelAnnouncement;
2631 * A trait to sign lightning channel transactions as described in BOLT 3.
2633 * Signing services could be implemented on a hardware wallet. In this case,
2634 * the current Sign would be a front-end on top of a communication
2635 * channel connected to your secure device and lightning key material wouldn't
2636 * reside on a hot server. Nevertheless, a this deployment would still need
2637 * to trust the ChannelManager to avoid loss of funds as this latest component
2638 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
2640 * A more secure iteration would be to use hashlock (or payment points) to pair
2641 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
2642 * at the price of more state and computation on the hardware wallet side. In the future,
2643 * we are looking forward to design such interface.
2645 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
2646 * to act, as liveness and breach reply correctness are always going to be hard requirements
2647 * of LN security model, orthogonal of key management issues.
2649 typedef struct LDKSign {
2651 * An opaque pointer which is passed to your function implementations as an argument.
2652 * This has no meaning in the LDK, and can be NULL or any other value.
2656 * Gets the per-commitment point for a specific commitment number
2658 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
2660 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
2662 * Gets the commitment secret for a specific commitment number as part of the revocation process
2664 * An external signer implementation should error here if the commitment was already signed
2665 * and should refuse to sign it in the future.
2667 * May be called more than once for the same index.
2669 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
2671 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
2673 * Gets the holder's channel public keys and basepoints
2675 struct LDKChannelPublicKeys pubkeys;
2677 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
2678 * Note that this takes a pointer to this object, not the this_ptr like other methods do
2679 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
2681 void (*set_pubkeys)(const struct LDKSign*NONNULL_PTR );
2683 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
2684 * some SpendableOutputDescriptor types. This should be sufficient to identify this
2685 * Sign object uniquely and lookup or re-derive its keys.
2687 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
2689 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
2691 * Note that if signing fails or is rejected, the channel will be force-closed.
2693 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx);
2695 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
2696 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
2697 * latest commitment_tx when we initiate a force-close.
2698 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
2699 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
2701 * This may be called multiple times for the same transaction.
2703 * An external signer implementation should check that the commitment has not been revoked.
2705 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
2707 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
2709 * Create a signature for the given input in a transaction spending an HTLC or commitment
2710 * transaction output when our counterparty broadcasts an old state.
2712 * A justice transaction may claim multiples outputs at the same time if timelocks are
2713 * similar, but only a signature for the input at index `input` should be signed for here.
2714 * It may be called multiples time for same output(s) if a fee-bump is needed with regards
2715 * to an upcoming timelock expiration.
2717 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2719 * per_commitment_key is revocation secret which was provided by our counterparty when they
2720 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2721 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
2724 * htlc holds HTLC elements (hash, timelock) if the output being spent is a HTLC output, thus
2725 * changing the format of the witness script (which is committed to in the BIP 143
2728 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);
2730 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
2731 * transaction, either offered or received.
2733 * Such a transaction may claim multiples offered outputs at same time if we know the
2734 * preimage for each when we create it, but only the input at index `input` should be
2735 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
2736 * needed with regards to an upcoming timelock expiration.
2738 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
2741 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2743 * Per_commitment_point is the dynamic point corresponding to the channel state
2744 * detected onchain. It has been generated by our counterparty and is used to derive
2745 * channel state keys, which are then included in the witness script and committed to in the
2746 * BIP 143 signature.
2748 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);
2750 * Create a signature for a (proposed) closing transaction.
2752 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
2753 * chosen to forgo their output as dust.
2755 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, struct LDKTransaction closing_tx);
2757 * Signs a channel announcement message with our funding key, proving it comes from one
2758 * of the channel participants.
2760 * Note that if this fails or is rejected, the channel will not be publicly announced and
2761 * our counterparty may (though likely will not) close the channel on us for violating the
2764 struct LDKCResult_SignatureNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
2766 * Set the counterparty static channel data, including basepoints,
2767 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
2768 * This is done as soon as the funding outpoint is known. Since these are static channel data,
2769 * they MUST NOT be allowed to change to different values once set.
2771 * channel_parameters.is_populated() MUST be true.
2773 * We bind holder_selected_contest_delay late here for API convenience.
2775 * Will be called before any signatures are applied.
2777 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
2779 * Creates a copy of the object pointed to by this_arg, for a copy of this Sign.
2780 * Note that the ultimate copy of the Sign will have all function pointers the same as the original.
2781 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new Sign.
2783 void *(*clone)(const void *this_arg);
2785 * Serialize the object into a byte array
2787 struct LDKCVec_u8Z (*write)(const void *this_arg);
2789 * Frees any resources associated with this object given its this_arg pointer.
2790 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2792 void (*free)(void *this_arg);
2798 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
2799 * on-chain transactions to ensure no loss of funds occurs.
2801 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
2802 * information and are actively monitoring the chain.
2804 * Pending Events or updated HTLCs which have not yet been read out by
2805 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
2806 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
2807 * gotten are fully handled before re-serializing the new state.
2809 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
2810 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
2811 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
2812 * returned block hash and the the current chain and then reconnecting blocks to get to the
2813 * best chain) upon deserializing the object!
2815 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
2817 * A pointer to the opaque Rust object.
2818 * Nearly everywhere, inner must be non-null, however in places where
2819 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2821 LDKnativeChannelMonitor *inner;
2823 * Indicates that this is the only struct which contains the same pointer.
2824 * Rust functions which take ownership of an object provided via an argument require
2825 * this to be true and invalidate the object pointed to by inner.
2828 } LDKChannelMonitor;
2830 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
2831 struct LDKThirtyTwoBytes a;
2832 struct LDKChannelMonitor b;
2833 } LDKC2Tuple_BlockHashChannelMonitorZ;
2835 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
2836 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
2837 struct LDKDecodeError *err;
2838 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
2840 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
2841 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
2843 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
2845 typedef union LDKCResult_TxOutAccessErrorZPtr {
2846 struct LDKTxOut *result;
2847 enum LDKAccessError *err;
2848 } LDKCResult_TxOutAccessErrorZPtr;
2850 typedef struct LDKCResult_TxOutAccessErrorZ {
2851 union LDKCResult_TxOutAccessErrorZPtr contents;
2853 } LDKCResult_TxOutAccessErrorZ;
2855 typedef enum LDKCOption_C2Tuple_usizeTransactionZZ_Tag {
2856 LDKCOption_C2Tuple_usizeTransactionZZ_Some,
2857 LDKCOption_C2Tuple_usizeTransactionZZ_None,
2859 * Must be last for serialization purposes
2861 LDKCOption_C2Tuple_usizeTransactionZZ_Sentinel,
2862 } LDKCOption_C2Tuple_usizeTransactionZZ_Tag;
2864 typedef struct LDKCOption_C2Tuple_usizeTransactionZZ {
2865 LDKCOption_C2Tuple_usizeTransactionZZ_Tag tag;
2868 struct LDKC2Tuple_usizeTransactionZ some;
2871 } LDKCOption_C2Tuple_usizeTransactionZZ;
2874 * A Rust str object, ie a reference to a UTF8-valid string.
2875 * This is *not* null-terminated so cannot be used directly as a C string!
2877 typedef struct LDKStr {
2878 const uint8_t *chars;
2883 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
2886 typedef enum LDKAPIError_Tag {
2888 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
2889 * are documented, but generally indicates some precondition of a function was violated.
2891 LDKAPIError_APIMisuseError,
2893 * Due to a high feerate, we were unable to complete the request.
2894 * For example, this may be returned if the feerate implies we cannot open a channel at the
2895 * requested value, but opening a larger channel would succeed.
2897 LDKAPIError_FeeRateTooHigh,
2899 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
2900 * too-many-hops, etc).
2902 LDKAPIError_RouteError,
2904 * We were unable to complete the request as the Channel required to do so is unable to
2905 * complete the request (or was not found). This can take many forms, including disconnected
2906 * peer, channel at capacity, channel shutting down, etc.
2908 LDKAPIError_ChannelUnavailable,
2910 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
2911 * attempted action to fail.
2913 LDKAPIError_MonitorUpdateFailed,
2915 * Must be last for serialization purposes
2917 LDKAPIError_Sentinel,
2920 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
2922 * A human-readable error message
2924 struct LDKCVec_u8Z err;
2925 } LDKAPIError_LDKAPIMisuseError_Body;
2927 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
2929 * A human-readable error message
2931 struct LDKCVec_u8Z err;
2933 * The feerate which was too high.
2936 } LDKAPIError_LDKFeeRateTooHigh_Body;
2938 typedef struct LDKAPIError_LDKRouteError_Body {
2940 * A human-readable error message
2943 } LDKAPIError_LDKRouteError_Body;
2945 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
2947 * A human-readable error message
2949 struct LDKCVec_u8Z err;
2950 } LDKAPIError_LDKChannelUnavailable_Body;
2952 typedef struct MUST_USE_STRUCT LDKAPIError {
2953 LDKAPIError_Tag tag;
2955 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
2956 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
2957 LDKAPIError_LDKRouteError_Body route_error;
2958 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
2962 typedef union LDKCResult_NoneAPIErrorZPtr {
2964 * Note that this value is always NULL, as there are no contents in the OK variant
2967 struct LDKAPIError *err;
2968 } LDKCResult_NoneAPIErrorZPtr;
2970 typedef struct LDKCResult_NoneAPIErrorZ {
2971 union LDKCResult_NoneAPIErrorZPtr contents;
2973 } LDKCResult_NoneAPIErrorZ;
2975 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
2976 struct LDKCResult_NoneAPIErrorZ *data;
2978 } LDKCVec_CResult_NoneAPIErrorZZ;
2980 typedef struct LDKCVec_APIErrorZ {
2981 struct LDKAPIError *data;
2983 } LDKCVec_APIErrorZ;
2988 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
2990 typedef struct MUST_USE_STRUCT LDKChannelDetails {
2992 * A pointer to the opaque Rust object.
2993 * Nearly everywhere, inner must be non-null, however in places where
2994 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2996 LDKnativeChannelDetails *inner;
2998 * Indicates that this is the only struct which contains the same pointer.
2999 * Rust functions which take ownership of an object provided via an argument require
3000 * this to be true and invalidate the object pointed to by inner.
3003 } LDKChannelDetails;
3005 typedef struct LDKCVec_ChannelDetailsZ {
3006 struct LDKChannelDetails *data;
3008 } LDKCVec_ChannelDetailsZ;
3011 * If a payment fails to send, it can be in one of several states. This enum is returned as the
3012 * Err() type describing which state the payment is in, see the description of individual enum
3015 typedef enum LDKPaymentSendFailure_Tag {
3017 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
3018 * send the payment at all. No channel state has been changed or messages sent to peers, and
3019 * once you've changed the parameter at error, you can freely retry the payment in full.
3021 LDKPaymentSendFailure_ParameterError,
3023 * A parameter in a single path which was passed to send_payment was invalid, preventing us
3024 * from attempting to send the payment at all. No channel state has been changed or messages
3025 * sent to peers, and once you've changed the parameter at error, you can freely retry the
3028 * The results here are ordered the same as the paths in the route object which was passed to
3031 LDKPaymentSendFailure_PathParameterError,
3033 * All paths which were attempted failed to send, with no channel state change taking place.
3034 * You can freely retry the payment in full (though you probably want to do so over different
3035 * paths than the ones selected).
3037 LDKPaymentSendFailure_AllFailedRetrySafe,
3039 * Some paths which were attempted failed to send, though possibly not all. At least some
3040 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
3041 * in over-/re-payment.
3043 * The results here are ordered the same as the paths in the route object which was passed to
3044 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
3045 * retried (though there is currently no API with which to do so).
3047 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
3048 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
3049 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
3050 * with the latest update_id.
3052 LDKPaymentSendFailure_PartialFailure,
3054 * Must be last for serialization purposes
3056 LDKPaymentSendFailure_Sentinel,
3057 } LDKPaymentSendFailure_Tag;
3059 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
3060 LDKPaymentSendFailure_Tag tag;
3063 struct LDKAPIError parameter_error;
3066 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
3069 struct LDKCVec_APIErrorZ all_failed_retry_safe;
3072 struct LDKCVec_CResult_NoneAPIErrorZZ partial_failure;
3075 } LDKPaymentSendFailure;
3077 typedef union LDKCResult_NonePaymentSendFailureZPtr {
3079 * Note that this value is always NULL, as there are no contents in the OK variant
3082 struct LDKPaymentSendFailure *err;
3083 } LDKCResult_NonePaymentSendFailureZPtr;
3085 typedef struct LDKCResult_NonePaymentSendFailureZ {
3086 union LDKCResult_NonePaymentSendFailureZPtr contents;
3088 } LDKCResult_NonePaymentSendFailureZ;
3090 typedef struct LDKCVec_ChannelMonitorZ {
3091 struct LDKChannelMonitor *data;
3093 } LDKCVec_ChannelMonitorZ;
3096 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
3097 * blocks are connected and disconnected.
3099 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
3100 * responsible for maintaining a set of monitors such that they can be updated accordingly as
3101 * channel state changes and HTLCs are resolved. See method documentation for specific
3104 * Implementations **must** ensure that updates are successfully applied and persisted upon method
3105 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
3106 * without taking any further action such as persisting the current state.
3108 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
3109 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
3110 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
3111 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
3112 * multiple instances.
3114 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
3115 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
3116 * [`PermanentFailure`]: channelmonitor::ChannelMonitorUpdateErr::PermanentFailure
3118 typedef struct LDKWatch {
3120 * An opaque pointer which is passed to your function implementations as an argument.
3121 * This has no meaning in the LDK, and can be NULL or any other value.
3125 * Watches a channel identified by `funding_txo` using `monitor`.
3127 * Implementations are responsible for watching the chain for the funding transaction along
3128 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
3129 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
3131 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
3132 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
3133 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
3135 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
3137 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
3139 * Implementations must call [`update_monitor`] with the given update. See
3140 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
3142 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
3143 * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
3145 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
3147 * Returns any monitor events since the last call. Subsequent calls must only return new
3150 struct LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
3152 * Frees any resources associated with this object given its this_arg pointer.
3153 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3155 void (*free)(void *this_arg);
3159 * An interface to send a transaction to the Bitcoin network.
3161 typedef struct LDKBroadcasterInterface {
3163 * An opaque pointer which is passed to your function implementations as an argument.
3164 * This has no meaning in the LDK, and can be NULL or any other value.
3168 * Sends a transaction out to (hopefully) be mined.
3170 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
3172 * Frees any resources associated with this object given its this_arg pointer.
3173 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3175 void (*free)(void *this_arg);
3176 } LDKBroadcasterInterface;
3178 typedef union LDKCResult_SignDecodeErrorZPtr {
3179 struct LDKSign *result;
3180 struct LDKDecodeError *err;
3181 } LDKCResult_SignDecodeErrorZPtr;
3183 typedef struct LDKCResult_SignDecodeErrorZ {
3184 union LDKCResult_SignDecodeErrorZPtr contents;
3186 } LDKCResult_SignDecodeErrorZ;
3188 typedef struct LDKu8slice {
3189 const uint8_t *data;
3194 * A trait to describe an object which can get user secrets and key material.
3196 typedef struct LDKKeysInterface {
3198 * An opaque pointer which is passed to your function implementations as an argument.
3199 * This has no meaning in the LDK, and can be NULL or any other value.
3203 * Get node secret key (aka node_id or network_key).
3205 * This method must return the same value each time it is called.
3207 struct LDKSecretKey (*get_node_secret)(const void *this_arg);
3209 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
3211 * This method should return a different value each time it is called, to avoid linking
3212 * on-chain funds across channels as controlled to the same user.
3214 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
3216 * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing
3219 * This method should return a different value each time it is called, to avoid linking
3220 * on-chain funds across channels as controlled to the same user.
3222 struct LDKPublicKey (*get_shutdown_pubkey)(const void *this_arg);
3224 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
3225 * restarted with some stale data!
3227 * This method must return a different value each time it is called.
3229 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
3231 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
3232 * onion packets and for temporary channel IDs. There is no requirement that these be
3233 * persisted anywhere, though they must be unique across restarts.
3235 * This method must return a different value each time it is called.
3237 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
3239 * Reads a `Signer` for this `KeysInterface` from the given input stream.
3240 * This is only called during deserialization of other objects which contain
3241 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
3242 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
3243 * contain no versioning scheme. You may wish to include your own version prefix and ensure
3244 * you've read all of the provided bytes to ensure no corruption occurred.
3246 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
3248 * Frees any resources associated with this object given its this_arg pointer.
3249 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3251 void (*free)(void *this_arg);
3255 * A trait which should be implemented to provide feerate information on a number of time
3258 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
3259 * called from inside the library in response to chain events, P2P events, or timer events).
3261 typedef struct LDKFeeEstimator {
3263 * An opaque pointer which is passed to your function implementations as an argument.
3264 * This has no meaning in the LDK, and can be NULL or any other value.
3268 * Gets estimated satoshis of fee required per 1000 Weight-Units.
3270 * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
3271 * don't put us below 1 satoshi-per-byte).
3273 * This translates to:
3274 * * satoshis-per-byte * 250
3275 * * ceil(satoshis-per-kbyte / 4)
3277 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
3279 * Frees any resources associated with this object given its this_arg pointer.
3280 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3282 void (*free)(void *this_arg);
3286 * A trait encapsulating the operations required of a logger
3288 typedef struct LDKLogger {
3290 * An opaque pointer which is passed to your function implementations as an argument.
3291 * This has no meaning in the LDK, and can be NULL or any other value.
3297 void (*log)(const void *this_arg, const char *record);
3299 * Frees any resources associated with this object given its this_arg pointer.
3300 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3302 void (*free)(void *this_arg);
3308 * Manager which keeps track of a number of channels and sends messages to the appropriate
3309 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
3311 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
3312 * to individual Channels.
3314 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
3315 * all peers during write/read (though does not modify this instance, only the instance being
3316 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
3317 * called funding_transaction_generated for outbound channels).
3319 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
3320 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
3321 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
3322 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
3323 * the serialization process). If the deserialized version is out-of-date compared to the
3324 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
3325 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
3327 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
3328 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
3329 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
3330 * block_connected() to step towards your best block) upon deserialization before using the
3333 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
3334 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
3335 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
3336 * offline for a full minute. In order to track this, you must call
3337 * timer_chan_freshness_every_min roughly once per minute, though it doesn't have to be perfect.
3339 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
3340 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
3341 * essentially you should default to using a SimpleRefChannelManager, and use a
3342 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
3343 * you're using lightning-net-tokio.
3345 typedef struct MUST_USE_STRUCT LDKChannelManager {
3347 * A pointer to the opaque Rust object.
3348 * Nearly everywhere, inner must be non-null, however in places where
3349 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3351 LDKnativeChannelManager *inner;
3353 * Indicates that this is the only struct which contains the same pointer.
3354 * Rust functions which take ownership of an object provided via an argument require
3355 * this to be true and invalidate the object pointed to by inner.
3358 } LDKChannelManager;
3360 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
3361 struct LDKThirtyTwoBytes a;
3362 struct LDKChannelManager b;
3363 } LDKC2Tuple_BlockHashChannelManagerZ;
3365 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
3366 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
3367 struct LDKDecodeError *err;
3368 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
3370 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3371 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
3373 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
3375 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
3376 struct LDKSpendableOutputDescriptor *result;
3377 struct LDKDecodeError *err;
3378 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
3380 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
3381 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
3383 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
3385 typedef struct LDKCVec_CVec_u8ZZ {
3386 struct LDKCVec_u8Z *data;
3388 } LDKCVec_CVec_u8ZZ;
3390 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
3391 struct LDKCVec_CVec_u8ZZ *result;
3393 * Note that this value is always NULL, as there are no contents in the Err variant
3396 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
3398 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
3399 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
3401 } LDKCResult_CVec_CVec_u8ZZNoneZ;
3406 * A simple implementation of Sign that just keeps the private keys in memory.
3408 * This implementation performs no policy checks and is insufficient by itself as
3409 * a secure external signer.
3411 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
3413 * A pointer to the opaque Rust object.
3414 * Nearly everywhere, inner must be non-null, however in places where
3415 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3417 LDKnativeInMemorySigner *inner;
3419 * Indicates that this is the only struct which contains the same pointer.
3420 * Rust functions which take ownership of an object provided via an argument require
3421 * this to be true and invalidate the object pointed to by inner.
3424 } LDKInMemorySigner;
3426 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
3427 struct LDKInMemorySigner *result;
3428 struct LDKDecodeError *err;
3429 } LDKCResult_InMemorySignerDecodeErrorZPtr;
3431 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
3432 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
3434 } LDKCResult_InMemorySignerDecodeErrorZ;
3436 typedef struct LDKCVec_TxOutZ {
3437 struct LDKTxOut *data;
3441 typedef union LDKCResult_TransactionNoneZPtr {
3442 struct LDKTransaction *result;
3444 * Note that this value is always NULL, as there are no contents in the Err variant
3447 } LDKCResult_TransactionNoneZPtr;
3449 typedef struct LDKCResult_TransactionNoneZ {
3450 union LDKCResult_TransactionNoneZPtr contents;
3452 } LDKCResult_TransactionNoneZ;
3459 typedef struct MUST_USE_STRUCT LDKRouteHop {
3461 * A pointer to the opaque Rust object.
3462 * Nearly everywhere, inner must be non-null, however in places where
3463 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3465 LDKnativeRouteHop *inner;
3467 * Indicates that this is the only struct which contains the same pointer.
3468 * Rust functions which take ownership of an object provided via an argument require
3469 * this to be true and invalidate the object pointed to by inner.
3474 typedef struct LDKCVec_RouteHopZ {
3475 struct LDKRouteHop *data;
3477 } LDKCVec_RouteHopZ;
3479 typedef struct LDKCVec_CVec_RouteHopZZ {
3480 struct LDKCVec_RouteHopZ *data;
3482 } LDKCVec_CVec_RouteHopZZ;
3487 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
3488 * it can take multiple paths. Each path is composed of one or more hops through the network.
3490 typedef struct MUST_USE_STRUCT LDKRoute {
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 LDKnativeRoute *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.
3505 typedef union LDKCResult_RouteDecodeErrorZPtr {
3506 struct LDKRoute *result;
3507 struct LDKDecodeError *err;
3508 } LDKCResult_RouteDecodeErrorZPtr;
3510 typedef struct LDKCResult_RouteDecodeErrorZ {
3511 union LDKCResult_RouteDecodeErrorZPtr contents;
3513 } LDKCResult_RouteDecodeErrorZ;
3518 * A channel descriptor which provides a last-hop route to get_route
3520 typedef struct MUST_USE_STRUCT LDKRouteHint {
3522 * A pointer to the opaque Rust object.
3523 * Nearly everywhere, inner must be non-null, however in places where
3524 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3526 LDKnativeRouteHint *inner;
3528 * Indicates that this is the only struct which contains the same pointer.
3529 * Rust functions which take ownership of an object provided via an argument require
3530 * this to be true and invalidate the object pointed to by inner.
3535 typedef struct LDKCVec_RouteHintZ {
3536 struct LDKRouteHint *data;
3538 } LDKCVec_RouteHintZ;
3540 typedef union LDKCResult_RouteLightningErrorZPtr {
3541 struct LDKRoute *result;
3542 struct LDKLightningError *err;
3543 } LDKCResult_RouteLightningErrorZPtr;
3545 typedef struct LDKCResult_RouteLightningErrorZ {
3546 union LDKCResult_RouteLightningErrorZPtr contents;
3548 } LDKCResult_RouteLightningErrorZ;
3550 typedef union LDKCResult_NetAddressu8ZPtr {
3551 struct LDKNetAddress *result;
3553 } LDKCResult_NetAddressu8ZPtr;
3555 typedef struct LDKCResult_NetAddressu8Z {
3556 union LDKCResult_NetAddressu8ZPtr contents;
3558 } LDKCResult_NetAddressu8Z;
3560 typedef union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr {
3561 struct LDKCResult_NetAddressu8Z *result;
3562 struct LDKDecodeError *err;
3563 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr;
3565 typedef struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ {
3566 union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr contents;
3568 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZ;
3573 * An update_add_htlc message to be sent or received from a peer
3575 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
3577 * A pointer to the opaque Rust object.
3578 * Nearly everywhere, inner must be non-null, however in places where
3579 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3581 LDKnativeUpdateAddHTLC *inner;
3583 * Indicates that this is the only struct which contains the same pointer.
3584 * Rust functions which take ownership of an object provided via an argument require
3585 * this to be true and invalidate the object pointed to by inner.
3590 typedef struct LDKCVec_UpdateAddHTLCZ {
3591 struct LDKUpdateAddHTLC *data;
3593 } LDKCVec_UpdateAddHTLCZ;
3598 * An update_fulfill_htlc message to be sent or received from a peer
3600 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
3602 * A pointer to the opaque Rust object.
3603 * Nearly everywhere, inner must be non-null, however in places where
3604 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3606 LDKnativeUpdateFulfillHTLC *inner;
3608 * Indicates that this is the only struct which contains the same pointer.
3609 * Rust functions which take ownership of an object provided via an argument require
3610 * this to be true and invalidate the object pointed to by inner.
3613 } LDKUpdateFulfillHTLC;
3615 typedef struct LDKCVec_UpdateFulfillHTLCZ {
3616 struct LDKUpdateFulfillHTLC *data;
3618 } LDKCVec_UpdateFulfillHTLCZ;
3623 * An update_fail_htlc message to be sent or received from a peer
3625 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
3627 * A pointer to the opaque Rust object.
3628 * Nearly everywhere, inner must be non-null, however in places where
3629 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3631 LDKnativeUpdateFailHTLC *inner;
3633 * Indicates that this is the only struct which contains the same pointer.
3634 * Rust functions which take ownership of an object provided via an argument require
3635 * this to be true and invalidate the object pointed to by inner.
3638 } LDKUpdateFailHTLC;
3640 typedef struct LDKCVec_UpdateFailHTLCZ {
3641 struct LDKUpdateFailHTLC *data;
3643 } LDKCVec_UpdateFailHTLCZ;
3648 * An update_fail_malformed_htlc message to be sent or received from a peer
3650 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
3652 * A pointer to the opaque Rust object.
3653 * Nearly everywhere, inner must be non-null, however in places where
3654 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3656 LDKnativeUpdateFailMalformedHTLC *inner;
3658 * Indicates that this is the only struct which contains the same pointer.
3659 * Rust functions which take ownership of an object provided via an argument require
3660 * this to be true and invalidate the object pointed to by inner.
3663 } LDKUpdateFailMalformedHTLC;
3665 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
3666 struct LDKUpdateFailMalformedHTLC *data;
3668 } LDKCVec_UpdateFailMalformedHTLCZ;
3670 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
3671 struct LDKAcceptChannel *result;
3672 struct LDKDecodeError *err;
3673 } LDKCResult_AcceptChannelDecodeErrorZPtr;
3675 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
3676 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
3678 } LDKCResult_AcceptChannelDecodeErrorZ;
3680 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
3681 struct LDKAnnouncementSignatures *result;
3682 struct LDKDecodeError *err;
3683 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
3685 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
3686 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
3688 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
3690 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
3691 struct LDKChannelReestablish *result;
3692 struct LDKDecodeError *err;
3693 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
3695 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
3696 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
3698 } LDKCResult_ChannelReestablishDecodeErrorZ;
3700 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
3701 struct LDKClosingSigned *result;
3702 struct LDKDecodeError *err;
3703 } LDKCResult_ClosingSignedDecodeErrorZPtr;
3705 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
3706 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
3708 } LDKCResult_ClosingSignedDecodeErrorZ;
3713 * A commitment_signed message to be sent or received from a peer
3715 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
3717 * A pointer to the opaque Rust object.
3718 * Nearly everywhere, inner must be non-null, however in places where
3719 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3721 LDKnativeCommitmentSigned *inner;
3723 * Indicates that this is the only struct which contains the same pointer.
3724 * Rust functions which take ownership of an object provided via an argument require
3725 * this to be true and invalidate the object pointed to by inner.
3728 } LDKCommitmentSigned;
3730 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
3731 struct LDKCommitmentSigned *result;
3732 struct LDKDecodeError *err;
3733 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
3735 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
3736 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
3738 } LDKCResult_CommitmentSignedDecodeErrorZ;
3740 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
3741 struct LDKFundingCreated *result;
3742 struct LDKDecodeError *err;
3743 } LDKCResult_FundingCreatedDecodeErrorZPtr;
3745 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
3746 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
3748 } LDKCResult_FundingCreatedDecodeErrorZ;
3750 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
3751 struct LDKFundingSigned *result;
3752 struct LDKDecodeError *err;
3753 } LDKCResult_FundingSignedDecodeErrorZPtr;
3755 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
3756 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
3758 } LDKCResult_FundingSignedDecodeErrorZ;
3760 typedef union LDKCResult_FundingLockedDecodeErrorZPtr {
3761 struct LDKFundingLocked *result;
3762 struct LDKDecodeError *err;
3763 } LDKCResult_FundingLockedDecodeErrorZPtr;
3765 typedef struct LDKCResult_FundingLockedDecodeErrorZ {
3766 union LDKCResult_FundingLockedDecodeErrorZPtr contents;
3768 } LDKCResult_FundingLockedDecodeErrorZ;
3773 * An init message to be sent or received from a peer
3775 typedef struct MUST_USE_STRUCT LDKInit {
3777 * A pointer to the opaque Rust object.
3778 * Nearly everywhere, inner must be non-null, however in places where
3779 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3781 LDKnativeInit *inner;
3783 * Indicates that this is the only struct which contains the same pointer.
3784 * Rust functions which take ownership of an object provided via an argument require
3785 * this to be true and invalidate the object pointed to by inner.
3790 typedef union LDKCResult_InitDecodeErrorZPtr {
3791 struct LDKInit *result;
3792 struct LDKDecodeError *err;
3793 } LDKCResult_InitDecodeErrorZPtr;
3795 typedef struct LDKCResult_InitDecodeErrorZ {
3796 union LDKCResult_InitDecodeErrorZPtr contents;
3798 } LDKCResult_InitDecodeErrorZ;
3800 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
3801 struct LDKOpenChannel *result;
3802 struct LDKDecodeError *err;
3803 } LDKCResult_OpenChannelDecodeErrorZPtr;
3805 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
3806 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
3808 } LDKCResult_OpenChannelDecodeErrorZ;
3810 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
3811 struct LDKRevokeAndACK *result;
3812 struct LDKDecodeError *err;
3813 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
3815 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
3816 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
3818 } LDKCResult_RevokeAndACKDecodeErrorZ;
3820 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
3821 struct LDKShutdown *result;
3822 struct LDKDecodeError *err;
3823 } LDKCResult_ShutdownDecodeErrorZPtr;
3825 typedef struct LDKCResult_ShutdownDecodeErrorZ {
3826 union LDKCResult_ShutdownDecodeErrorZPtr contents;
3828 } LDKCResult_ShutdownDecodeErrorZ;
3830 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
3831 struct LDKUpdateFailHTLC *result;
3832 struct LDKDecodeError *err;
3833 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
3835 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
3836 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
3838 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
3840 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
3841 struct LDKUpdateFailMalformedHTLC *result;
3842 struct LDKDecodeError *err;
3843 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
3845 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
3846 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
3848 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
3853 * An update_fee message to be sent or received from a peer
3855 typedef struct MUST_USE_STRUCT LDKUpdateFee {
3857 * A pointer to the opaque Rust object.
3858 * Nearly everywhere, inner must be non-null, however in places where
3859 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3861 LDKnativeUpdateFee *inner;
3863 * Indicates that this is the only struct which contains the same pointer.
3864 * Rust functions which take ownership of an object provided via an argument require
3865 * this to be true and invalidate the object pointed to by inner.
3870 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
3871 struct LDKUpdateFee *result;
3872 struct LDKDecodeError *err;
3873 } LDKCResult_UpdateFeeDecodeErrorZPtr;
3875 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
3876 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
3878 } LDKCResult_UpdateFeeDecodeErrorZ;
3880 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
3881 struct LDKUpdateFulfillHTLC *result;
3882 struct LDKDecodeError *err;
3883 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
3885 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
3886 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
3888 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
3890 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
3891 struct LDKUpdateAddHTLC *result;
3892 struct LDKDecodeError *err;
3893 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
3895 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
3896 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
3898 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
3903 * A ping message to be sent or received from a peer
3905 typedef struct MUST_USE_STRUCT LDKPing {
3907 * A pointer to the opaque Rust object.
3908 * Nearly everywhere, inner must be non-null, however in places where
3909 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3911 LDKnativePing *inner;
3913 * Indicates that this is the only struct which contains the same pointer.
3914 * Rust functions which take ownership of an object provided via an argument require
3915 * this to be true and invalidate the object pointed to by inner.
3920 typedef union LDKCResult_PingDecodeErrorZPtr {
3921 struct LDKPing *result;
3922 struct LDKDecodeError *err;
3923 } LDKCResult_PingDecodeErrorZPtr;
3925 typedef struct LDKCResult_PingDecodeErrorZ {
3926 union LDKCResult_PingDecodeErrorZPtr contents;
3928 } LDKCResult_PingDecodeErrorZ;
3933 * A pong message to be sent or received from a peer
3935 typedef struct MUST_USE_STRUCT LDKPong {
3937 * A pointer to the opaque Rust object.
3938 * Nearly everywhere, inner must be non-null, however in places where
3939 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3941 LDKnativePong *inner;
3943 * Indicates that this is the only struct which contains the same pointer.
3944 * Rust functions which take ownership of an object provided via an argument require
3945 * this to be true and invalidate the object pointed to by inner.
3950 typedef union LDKCResult_PongDecodeErrorZPtr {
3951 struct LDKPong *result;
3952 struct LDKDecodeError *err;
3953 } LDKCResult_PongDecodeErrorZPtr;
3955 typedef struct LDKCResult_PongDecodeErrorZ {
3956 union LDKCResult_PongDecodeErrorZPtr contents;
3958 } LDKCResult_PongDecodeErrorZ;
3960 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
3961 struct LDKUnsignedChannelAnnouncement *result;
3962 struct LDKDecodeError *err;
3963 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
3965 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
3966 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
3968 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
3970 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
3971 struct LDKChannelAnnouncement *result;
3972 struct LDKDecodeError *err;
3973 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
3975 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
3976 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
3978 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
3983 * The unsigned part of a channel_update
3985 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
3987 * A pointer to the opaque Rust object.
3988 * Nearly everywhere, inner must be non-null, however in places where
3989 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3991 LDKnativeUnsignedChannelUpdate *inner;
3993 * Indicates that this is the only struct which contains the same pointer.
3994 * Rust functions which take ownership of an object provided via an argument require
3995 * this to be true and invalidate the object pointed to by inner.
3998 } LDKUnsignedChannelUpdate;
4000 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
4001 struct LDKUnsignedChannelUpdate *result;
4002 struct LDKDecodeError *err;
4003 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
4005 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
4006 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
4008 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
4010 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
4011 struct LDKChannelUpdate *result;
4012 struct LDKDecodeError *err;
4013 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
4015 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
4016 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
4018 } LDKCResult_ChannelUpdateDecodeErrorZ;
4020 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
4021 struct LDKErrorMessage *result;
4022 struct LDKDecodeError *err;
4023 } LDKCResult_ErrorMessageDecodeErrorZPtr;
4025 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
4026 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
4028 } LDKCResult_ErrorMessageDecodeErrorZ;
4033 * The unsigned part of a node_announcement
4035 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
4037 * A pointer to the opaque Rust object.
4038 * Nearly everywhere, inner must be non-null, however in places where
4039 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4041 LDKnativeUnsignedNodeAnnouncement *inner;
4043 * Indicates that this is the only struct which contains the same pointer.
4044 * Rust functions which take ownership of an object provided via an argument require
4045 * this to be true and invalidate the object pointed to by inner.
4048 } LDKUnsignedNodeAnnouncement;
4050 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
4051 struct LDKUnsignedNodeAnnouncement *result;
4052 struct LDKDecodeError *err;
4053 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
4055 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
4056 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
4058 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
4060 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
4061 struct LDKNodeAnnouncement *result;
4062 struct LDKDecodeError *err;
4063 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
4065 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
4066 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
4068 } LDKCResult_NodeAnnouncementDecodeErrorZ;
4070 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
4071 struct LDKQueryShortChannelIds *result;
4072 struct LDKDecodeError *err;
4073 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
4075 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
4076 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
4078 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
4083 * A reply_short_channel_ids_end message is sent as a reply to a
4084 * query_short_channel_ids message. The query recipient makes a best
4085 * effort to respond based on their local network view which may not be
4086 * a perfect view of the network.
4088 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
4090 * A pointer to the opaque Rust object.
4091 * Nearly everywhere, inner must be non-null, however in places where
4092 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4094 LDKnativeReplyShortChannelIdsEnd *inner;
4096 * Indicates that this is the only struct which contains the same pointer.
4097 * Rust functions which take ownership of an object provided via an argument require
4098 * this to be true and invalidate the object pointed to by inner.
4101 } LDKReplyShortChannelIdsEnd;
4103 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
4104 struct LDKReplyShortChannelIdsEnd *result;
4105 struct LDKDecodeError *err;
4106 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
4108 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
4109 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
4111 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
4113 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
4114 struct LDKQueryChannelRange *result;
4115 struct LDKDecodeError *err;
4116 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
4118 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
4119 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
4121 } LDKCResult_QueryChannelRangeDecodeErrorZ;
4123 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
4124 struct LDKReplyChannelRange *result;
4125 struct LDKDecodeError *err;
4126 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
4128 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
4129 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
4131 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
4136 * A gossip_timestamp_filter message is used by a node to request
4137 * gossip relay for messages in the requested time range when the
4138 * gossip_queries feature has been negotiated.
4140 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
4142 * A pointer to the opaque Rust object.
4143 * Nearly everywhere, inner must be non-null, however in places where
4144 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4146 LDKnativeGossipTimestampFilter *inner;
4148 * Indicates that this is the only struct which contains the same pointer.
4149 * Rust functions which take ownership of an object provided via an argument require
4150 * this to be true and invalidate the object pointed to by inner.
4153 } LDKGossipTimestampFilter;
4155 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
4156 struct LDKGossipTimestampFilter *result;
4157 struct LDKDecodeError *err;
4158 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
4160 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
4161 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
4163 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
4166 * A trait indicating an object may generate message send events
4168 typedef struct LDKMessageSendEventsProvider {
4170 * An opaque pointer which is passed to your function implementations as an argument.
4171 * This has no meaning in the LDK, and can be NULL or any other value.
4175 * Gets the list of pending events which were generated by previous actions, clearing the list
4178 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
4180 * Frees any resources associated with this object given its this_arg pointer.
4181 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4183 void (*free)(void *this_arg);
4184 } LDKMessageSendEventsProvider;
4187 * A trait indicating an object may generate events
4189 typedef struct LDKEventsProvider {
4191 * An opaque pointer which is passed to your function implementations as an argument.
4192 * This has no meaning in the LDK, and can be NULL or any other value.
4196 * Gets the list of pending events which were generated by previous actions, clearing the list
4199 struct LDKCVec_EventZ (*get_and_clear_pending_events)(const void *this_arg);
4201 * Frees any resources associated with this object given its this_arg pointer.
4202 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4204 void (*free)(void *this_arg);
4205 } LDKEventsProvider;
4210 * Configuration we set when applicable.
4212 * Default::default() provides sane defaults.
4214 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
4216 * A pointer to the opaque Rust object.
4217 * Nearly everywhere, inner must be non-null, however in places where
4218 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4220 LDKnativeChannelHandshakeConfig *inner;
4222 * Indicates that this is the only struct which contains the same pointer.
4223 * Rust functions which take ownership of an object provided via an argument require
4224 * this to be true and invalidate the object pointed to by inner.
4227 } LDKChannelHandshakeConfig;
4232 * Optional channel limits which are applied during channel creation.
4234 * These limits are only applied to our counterparty's limits, not our own.
4236 * Use 0/<type>::max_value() as appropriate to skip checking.
4238 * Provides sane defaults for most configurations.
4240 * Most additional limits are disabled except those with which specify a default in individual
4241 * field documentation. Note that this may result in barely-usable channels, but since they
4242 * are applied mostly only to incoming channels that's not much of a problem.
4244 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
4246 * A pointer to the opaque Rust object.
4247 * Nearly everywhere, inner must be non-null, however in places where
4248 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4250 LDKnativeChannelHandshakeLimits *inner;
4252 * Indicates that this is the only struct which contains the same pointer.
4253 * Rust functions which take ownership of an object provided via an argument require
4254 * this to be true and invalidate the object pointed to by inner.
4257 } LDKChannelHandshakeLimits;
4262 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
4264 * Default::default() provides sane defaults for most configurations
4265 * (but currently with 0 relay fees!)
4267 typedef struct MUST_USE_STRUCT LDKUserConfig {
4269 * A pointer to the opaque Rust object.
4270 * Nearly everywhere, inner must be non-null, however in places where
4271 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4273 LDKnativeUserConfig *inner;
4275 * Indicates that this is the only struct which contains the same pointer.
4276 * Rust functions which take ownership of an object provided via an argument require
4277 * this to be true and invalidate the object pointed to by inner.
4283 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
4286 typedef struct LDKAccess {
4288 * An opaque pointer which is passed to your function implementations as an argument.
4289 * This has no meaning in the LDK, and can be NULL or any other value.
4293 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
4294 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
4297 * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
4299 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
4301 * Frees any resources associated with this object given its this_arg pointer.
4302 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4304 void (*free)(void *this_arg);
4308 * The `Listen` trait is used to be notified of when blocks have been connected or disconnected
4311 * Useful when needing to replay chain data upon startup or as new chain events occur.
4313 typedef struct LDKListen {
4315 * An opaque pointer which is passed to your function implementations as an argument.
4316 * This has no meaning in the LDK, and can be NULL or any other value.
4320 * Notifies the listener that a block was added at the given height.
4322 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
4324 * Notifies the listener that a block was removed at the given height.
4326 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
4328 * Frees any resources associated with this object given its this_arg pointer.
4329 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4331 void (*free)(void *this_arg);
4337 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
4339 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
4340 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
4341 * the return value of [`Filter::register_output`].
4343 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
4344 * may have been spent there. See [`Filter::register_output`] for details.
4346 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
4347 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
4349 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
4351 * A pointer to the opaque Rust object.
4352 * Nearly everywhere, inner must be non-null, however in places where
4353 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4355 LDKnativeWatchedOutput *inner;
4357 * Indicates that this is the only struct which contains the same pointer.
4358 * Rust functions which take ownership of an object provided via an argument require
4359 * this to be true and invalidate the object pointed to by inner.
4365 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
4368 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
4369 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
4370 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
4371 * receiving full blocks from a chain source, any further filtering is unnecessary.
4373 * After an output has been registered, subsequent block retrievals from the chain source must not
4374 * exclude any transactions matching the new criteria nor any in-block descendants of such
4377 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
4378 * should not block on I/O. Implementations should instead queue the newly monitored data to be
4379 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
4380 * invocation that has called the `Filter` must return [`TemporaryFailure`].
4382 * [`TemporaryFailure`]: channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure
4383 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
4384 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
4386 typedef struct LDKFilter {
4388 * An opaque pointer which is passed to your function implementations as an argument.
4389 * This has no meaning in the LDK, and can be NULL or any other value.
4393 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
4394 * a spending condition.
4396 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
4398 * Registers interest in spends of a transaction output.
4400 * Optionally, when `output.block_hash` is set, should return any transaction spending the
4401 * output that is found in the corresponding block along with its index.
4403 * This return value is useful for Electrum clients in order to supply in-block descendant
4404 * transactions which otherwise were not included. This is not necessary for other clients if
4405 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
4408 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
4410 * Frees any resources associated with this object given its this_arg pointer.
4411 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4413 void (*free)(void *this_arg);
4417 * `Persist` defines behavior for persisting channel monitors: this could mean
4418 * writing once to disk, and/or uploading to one or more backup services.
4420 * Note that for every new monitor, you **must** persist the new `ChannelMonitor`
4421 * to disk/backups. And, on every update, you **must** persist either the
4422 * `ChannelMonitorUpdate` or the updated monitor itself. Otherwise, there is risk
4423 * of situations such as revoking a transaction, then crashing before this
4424 * revocation can be persisted, then unintentionally broadcasting a revoked
4425 * transaction and losing money. This is a risk because previous channel states
4426 * are toxic, so it's important that whatever channel state is persisted is
4429 typedef struct LDKPersist {
4431 * An opaque pointer which is passed to your function implementations as an argument.
4432 * This has no meaning in the LDK, and can be NULL or any other value.
4436 * Persist a new channel's data. The data can be stored any way you want, but
4437 * the identifier provided by Rust-Lightning is the channel's outpoint (and
4438 * it is up to you to maintain a correct mapping between the outpoint and the
4439 * stored channel data). Note that you **must** persist every new monitor to
4440 * disk. See the `Persist` trait documentation for more details.
4442 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
4443 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
4445 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data);
4447 * Update one channel's data. The provided `ChannelMonitor` has already
4448 * applied the given update.
4450 * Note that on every update, you **must** persist either the
4451 * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See
4452 * the `Persist` trait documentation for more details.
4454 * If an implementer chooses to persist the updates only, they need to make
4455 * sure that all the updates are applied to the `ChannelMonitors` *before*
4456 * the set of channel monitors is given to the `ChannelManager`
4457 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
4458 * applying a monitor update to a monitor. If full `ChannelMonitors` are
4459 * persisted, then there is no need to persist individual updates.
4461 * Note that there could be a performance tradeoff between persisting complete
4462 * channel monitors on every update vs. persisting only updates and applying
4463 * them in batches. The size of each monitor grows `O(number of state updates)`
4464 * whereas updates are small and `O(1)`.
4466 * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
4467 * [`ChannelMonitorUpdate::write`] for writing out an update, and
4468 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
4470 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);
4472 * Frees any resources associated with this object given its this_arg pointer.
4473 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4475 void (*free)(void *this_arg);
4481 * An implementation of [`chain::Watch`] for monitoring channels.
4483 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
4484 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
4485 * or used independently to monitor channels remotely. See the [module-level documentation] for
4488 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
4489 * [module-level documentation]: crate::chain::chainmonitor
4491 typedef struct MUST_USE_STRUCT LDKChainMonitor {
4493 * A pointer to the opaque Rust object.
4494 * Nearly everywhere, inner must be non-null, however in places where
4495 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4497 LDKnativeChainMonitor *inner;
4499 * Indicates that this is the only struct which contains the same pointer.
4500 * Rust functions which take ownership of an object provided via an argument require
4501 * this to be true and invalidate the object pointed to by inner.
4509 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
4510 * and derives keys from that.
4512 * Your node_id is seed/0'
4513 * ChannelMonitor closes may use seed/1'
4514 * Cooperative closes may use seed/2'
4515 * The two close keys may be needed to claim on-chain funds!
4517 typedef struct MUST_USE_STRUCT LDKKeysManager {
4519 * A pointer to the opaque Rust object.
4520 * Nearly everywhere, inner must be non-null, however in places where
4521 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4523 LDKnativeKeysManager *inner;
4525 * Indicates that this is the only struct which contains the same pointer.
4526 * Rust functions which take ownership of an object provided via an argument require
4527 * this to be true and invalidate the object pointed to by inner.
4535 * Chain-related parameters used to construct a new `ChannelManager`.
4537 * Typically, the block-specific parameters are derived from the best block hash for the network,
4538 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
4539 * are not needed when deserializing a previously constructed `ChannelManager`.
4541 typedef struct MUST_USE_STRUCT LDKChainParameters {
4543 * A pointer to the opaque Rust object.
4544 * Nearly everywhere, inner must be non-null, however in places where
4545 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4547 LDKnativeChainParameters *inner;
4549 * Indicates that this is the only struct which contains the same pointer.
4550 * Rust functions which take ownership of an object provided via an argument require
4551 * this to be true and invalidate the object pointed to by inner.
4554 } LDKChainParameters;
4556 typedef struct LDKThreeBytes {
4561 * A trait to describe an object which can receive channel messages.
4563 * Messages MAY be called in parallel when they originate from different their_node_ids, however
4564 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
4566 typedef struct LDKChannelMessageHandler {
4568 * An opaque pointer which is passed to your function implementations as an argument.
4569 * This has no meaning in the LDK, and can be NULL or any other value.
4573 * Handle an incoming open_channel message from the given peer.
4575 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
4577 * Handle an incoming accept_channel message from the given peer.
4579 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
4581 * Handle an incoming funding_created message from the given peer.
4583 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
4585 * Handle an incoming funding_signed message from the given peer.
4587 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
4589 * Handle an incoming funding_locked message from the given peer.
4591 void (*handle_funding_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg);
4593 * Handle an incoming shutdown message from the given peer.
4595 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);
4597 * Handle an incoming closing_signed message from the given peer.
4599 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
4601 * Handle an incoming update_add_htlc message from the given peer.
4603 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
4605 * Handle an incoming update_fulfill_htlc message from the given peer.
4607 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
4609 * Handle an incoming update_fail_htlc message from the given peer.
4611 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
4613 * Handle an incoming update_fail_malformed_htlc message from the given peer.
4615 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
4617 * Handle an incoming commitment_signed message from the given peer.
4619 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
4621 * Handle an incoming revoke_and_ack message from the given peer.
4623 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
4625 * Handle an incoming update_fee message from the given peer.
4627 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
4629 * Handle an incoming announcement_signatures message from the given peer.
4631 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
4633 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
4634 * is believed to be possible in the future (eg they're sending us messages we don't
4635 * understand or indicate they require unknown feature bits), no_connection_possible is set
4636 * and any outstanding channels should be failed.
4638 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
4640 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
4642 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
4644 * Handle an incoming channel_reestablish message from the given peer.
4646 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
4648 * Handle an incoming channel update from the given peer.
4650 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
4652 * Handle an incoming error message from the given peer.
4654 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
4656 * Implementation of MessageSendEventsProvider for this object.
4658 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
4660 * Frees any resources associated with this object given its this_arg pointer.
4661 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4663 void (*free)(void *this_arg);
4664 } LDKChannelMessageHandler;
4669 * Arguments for the creation of a ChannelManager that are not deserialized.
4671 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
4673 * 1) Deserialize all stored ChannelMonitors.
4674 * 2) Deserialize the ChannelManager by filling in this struct and calling:
4675 * <(BlockHash, ChannelManager)>::read(reader, args)
4676 * This may result in closing some Channels if the ChannelMonitor is newer than the stored
4677 * ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted.
4678 * 3) If you are not fetching full blocks, register all relevant ChannelMonitor outpoints the same
4679 * way you would handle a `chain::Filter` call using ChannelMonitor::get_outputs_to_watch() and
4680 * ChannelMonitor::get_funding_txo().
4681 * 4) Reconnect blocks on your ChannelMonitors.
4682 * 5) Disconnect/connect blocks on the ChannelManager.
4683 * 6) Move the ChannelMonitors into your local chain::Watch.
4685 * Note that the ordering of #4-6 is not of importance, however all three must occur before you
4686 * call any other methods on the newly-deserialized ChannelManager.
4688 * Note that because some channels may be closed during deserialization, it is critical that you
4689 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
4690 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
4691 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
4692 * not force-close the same channels but consider them live), you may end up revoking a state for
4693 * which you've already broadcasted the transaction.
4695 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
4697 * A pointer to the opaque Rust object.
4698 * Nearly everywhere, inner must be non-null, however in places where
4699 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4701 LDKnativeChannelManagerReadArgs *inner;
4703 * Indicates that this is the only struct which contains the same pointer.
4704 * Rust functions which take ownership of an object provided via an argument require
4705 * this to be true and invalidate the object pointed to by inner.
4708 } LDKChannelManagerReadArgs;
4713 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
4714 * This is used to convince the recipient that the channel is at a certain commitment
4715 * number even if they lost that data due to a local failure. Of course, the peer may lie
4716 * and even later commitments may have been revoked.
4718 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
4720 * A pointer to the opaque Rust object.
4721 * Nearly everywhere, inner must be non-null, however in places where
4722 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4724 LDKnativeDataLossProtect *inner;
4726 * Indicates that this is the only struct which contains the same pointer.
4727 * Rust functions which take ownership of an object provided via an argument require
4728 * this to be true and invalidate the object pointed to by inner.
4731 } LDKDataLossProtect;
4734 * A trait to describe an object which can receive routing messages.
4736 * # Implementor DoS Warnings
4738 * For `gossip_queries` messages there are potential DoS vectors when handling
4739 * inbound queries. Implementors using an on-disk network graph should be aware of
4740 * repeated disk I/O for queries accessing different parts of the network graph.
4742 typedef struct LDKRoutingMessageHandler {
4744 * An opaque pointer which is passed to your function implementations as an argument.
4745 * This has no meaning in the LDK, and can be NULL or any other value.
4749 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
4750 * false or returning an Err otherwise.
4752 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
4754 * Handle a channel_announcement message, returning true if it should be forwarded on, false
4755 * or returning an Err otherwise.
4757 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
4759 * Handle an incoming channel_update message, returning true if it should be forwarded on,
4760 * false or returning an Err otherwise.
4762 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
4764 * Handle some updates to the route graph that we learned due to an outbound failed payment.
4766 void (*handle_htlc_fail_channel_update)(const void *this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update);
4768 * Gets a subset of the channel announcements and updates required to dump our routing table
4769 * to a remote node, starting at the short_channel_id indicated by starting_point and
4770 * including the batch_amount entries immediately higher in numerical value than starting_point.
4772 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
4774 * Gets a subset of the node announcements required to dump our routing table to a remote node,
4775 * starting at the node *after* the provided publickey and including batch_amount entries
4776 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
4777 * If None is provided for starting_point, we start at the first node.
4779 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
4781 * Called when a connection is established with a peer. This can be used to
4782 * perform routing table synchronization using a strategy defined by the
4785 void (*sync_routing_table)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
4787 * Handles the reply of a query we initiated to learn about channels
4788 * for a given range of blocks. We can expect to receive one or more
4789 * replies to a single query.
4791 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
4793 * Handles the reply of a query we initiated asking for routing gossip
4794 * messages for a list of channels. We should receive this message when
4795 * a node has completed its best effort to send us the pertaining routing
4798 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
4800 * Handles when a peer asks us to send a list of short_channel_ids
4801 * for the requested range of blocks.
4803 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
4805 * Handles when a peer asks us to send routing gossip messages for a
4806 * list of short_channel_ids.
4808 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
4810 * Implementation of MessageSendEventsProvider for this object.
4812 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
4814 * Frees any resources associated with this object given its this_arg pointer.
4815 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4817 void (*free)(void *this_arg);
4818 } LDKRoutingMessageHandler;
4823 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
4824 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
4826 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
4828 * A pointer to the opaque Rust object.
4829 * Nearly everywhere, inner must be non-null, however in places where
4830 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4832 LDKnativeIgnoringMessageHandler *inner;
4834 * Indicates that this is the only struct which contains the same pointer.
4835 * Rust functions which take ownership of an object provided via an argument require
4836 * this to be true and invalidate the object pointed to by inner.
4839 } LDKIgnoringMessageHandler;
4844 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
4845 * You can provide one of these as the route_handler in a MessageHandler.
4847 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
4849 * A pointer to the opaque Rust object.
4850 * Nearly everywhere, inner must be non-null, however in places where
4851 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4853 LDKnativeErroringMessageHandler *inner;
4855 * Indicates that this is the only struct which contains the same pointer.
4856 * Rust functions which take ownership of an object provided via an argument require
4857 * this to be true and invalidate the object pointed to by inner.
4860 } LDKErroringMessageHandler;
4865 * Provides references to trait impls which handle different types of messages.
4867 typedef struct MUST_USE_STRUCT LDKMessageHandler {
4869 * A pointer to the opaque Rust object.
4870 * Nearly everywhere, inner must be non-null, however in places where
4871 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4873 LDKnativeMessageHandler *inner;
4875 * Indicates that this is the only struct which contains the same pointer.
4876 * Rust functions which take ownership of an object provided via an argument require
4877 * this to be true and invalidate the object pointed to by inner.
4880 } LDKMessageHandler;
4883 * Provides an object which can be used to send data to and which uniquely identifies a connection
4884 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
4885 * implement Hash to meet the PeerManager API.
4887 * For efficiency, Clone should be relatively cheap for this type.
4889 * You probably want to just extend an int and put a file descriptor in a struct and implement
4890 * send_data. Note that if you are using a higher-level net library that may call close() itself,
4891 * be careful to ensure you don't have races whereby you might register a new connection with an
4892 * fd which is the same as a previous one which has yet to be removed via
4893 * PeerManager::socket_disconnected().
4895 typedef struct LDKSocketDescriptor {
4897 * An opaque pointer which is passed to your function implementations as an argument.
4898 * This has no meaning in the LDK, and can be NULL or any other value.
4902 * Attempts to send some data from the given slice to the peer.
4904 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
4905 * Note that in the disconnected case, socket_disconnected must still fire and further write
4906 * attempts may occur until that time.
4908 * If the returned size is smaller than data.len(), a write_available event must
4909 * trigger the next time more data can be written. Additionally, until the a send_data event
4910 * completes fully, no further read_events should trigger on the same peer!
4912 * If a read_event on this descriptor had previously returned true (indicating that read
4913 * events should be paused to prevent DoS in the send buffer), resume_read may be set
4914 * indicating that read events on this descriptor should resume. A resume_read of false does
4915 * *not* imply that further read events should be paused.
4917 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
4919 * Disconnect the socket pointed to by this SocketDescriptor. Once this function returns, no
4920 * more calls to write_buffer_space_avail, read_event or socket_disconnected may be made with
4921 * this descriptor. No socket_disconnected call should be generated as a result of this call,
4922 * though races may occur whereby disconnect_socket is called after a call to
4923 * socket_disconnected but prior to socket_disconnected returning.
4925 void (*disconnect_socket)(void *this_arg);
4927 * Checks if two objects are equal given this object's this_arg pointer and another object.
4929 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
4931 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
4932 * This is used, for example, for inclusion of this object in a hash map.
4934 uint64_t (*hash)(const void *this_arg);
4936 * Creates a copy of the object pointed to by this_arg, for a copy of this SocketDescriptor.
4937 * Note that the ultimate copy of the SocketDescriptor will have all function pointers the same as the original.
4938 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new SocketDescriptor.
4940 void *(*clone)(const void *this_arg);
4942 * Frees any resources associated with this object given its this_arg pointer.
4943 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4945 void (*free)(void *this_arg);
4946 } LDKSocketDescriptor;
4951 * A PeerManager manages a set of peers, described by their SocketDescriptor and marshalls socket
4952 * events into messages which it passes on to its MessageHandlers.
4954 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
4955 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
4956 * essentially you should default to using a SimpleRefPeerManager, and use a
4957 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
4958 * you're using lightning-net-tokio.
4960 typedef struct MUST_USE_STRUCT LDKPeerManager {
4962 * A pointer to the opaque Rust object.
4963 * Nearly everywhere, inner must be non-null, however in places where
4964 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4966 LDKnativePeerManager *inner;
4968 * Indicates that this is the only struct which contains the same pointer.
4969 * Rust functions which take ownership of an object provided via an argument require
4970 * this to be true and invalidate the object pointed to by inner.
4978 * Static channel fields used to build transactions given per-commitment fields, organized by
4979 * broadcaster/countersignatory.
4981 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
4982 * as_holder_broadcastable and as_counterparty_broadcastable functions.
4984 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
4986 * A pointer to the opaque Rust object.
4987 * Nearly everywhere, inner must be non-null, however in places where
4988 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4990 LDKnativeDirectedChannelTransactionParameters *inner;
4992 * Indicates that this is the only struct which contains the same pointer.
4993 * Rust functions which take ownership of an object provided via an argument require
4994 * this to be true and invalidate the object pointed to by inner.
4997 } LDKDirectedChannelTransactionParameters;
5002 * A simple newtype for RwLockReadGuard<'a, NetworkGraph>.
5003 * This exists only to make accessing a RwLock<NetworkGraph> possible from
5004 * the C bindings, as it can be done directly in Rust code.
5006 typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
5008 * A pointer to the opaque Rust object.
5009 * Nearly everywhere, inner must be non-null, however in places where
5010 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5012 LDKnativeLockedNetworkGraph *inner;
5014 * Indicates that this is the only struct which contains the same pointer.
5015 * Rust functions which take ownership of an object provided via an argument require
5016 * this to be true and invalidate the object pointed to by inner.
5019 } LDKLockedNetworkGraph;
5024 * Receives and validates network updates from peers,
5025 * stores authentic and relevant data as a network graph.
5026 * This network graph is then used for routing payments.
5027 * Provides interface to help with initial routing sync by
5028 * serving historical announcements.
5030 typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
5032 * A pointer to the opaque Rust object.
5033 * Nearly everywhere, inner must be non-null, however in places where
5034 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5036 LDKnativeNetGraphMsgHandler *inner;
5038 * Indicates that this is the only struct which contains the same pointer.
5039 * Rust functions which take ownership of an object provided via an argument require
5040 * this to be true and invalidate the object pointed to by inner.
5043 } LDKNetGraphMsgHandler;
5045 extern const uintptr_t MAX_BUF_SIZE;
5047 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
5049 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
5051 extern const uint16_t BREAKDOWN_TIMEOUT;
5053 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
5055 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
5057 void Transaction_free(struct LDKTransaction _res);
5059 void TxOut_free(struct LDKTxOut _res);
5061 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
5063 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
5065 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
5067 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
5069 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
5071 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
5073 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
5075 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
5077 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
5079 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
5081 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
5083 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
5085 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
5087 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
5089 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
5091 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
5093 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
5095 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
5097 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
5099 struct LDKCOption_u32Z COption_u32Z_none(void);
5101 void COption_u32Z_free(struct LDKCOption_u32Z _res);
5103 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
5105 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
5107 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
5109 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
5111 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
5113 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
5115 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
5117 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
5119 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
5121 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
5123 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
5125 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
5127 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
5129 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
5131 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
5133 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
5135 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
5137 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
5139 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
5141 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
5143 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
5145 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
5147 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
5149 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
5151 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
5153 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
5155 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
5157 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
5159 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
5161 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
5163 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
5165 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
5167 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
5169 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
5171 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
5173 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
5175 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
5177 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
5179 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
5181 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
5183 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
5185 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
5187 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
5189 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
5191 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
5193 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
5195 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
5197 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
5199 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
5201 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
5203 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
5205 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
5207 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
5209 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
5211 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
5213 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
5215 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
5217 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
5219 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
5221 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
5223 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
5225 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
5227 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
5229 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
5231 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
5233 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
5235 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
5237 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
5239 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
5241 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
5243 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
5245 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
5247 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
5249 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
5251 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
5253 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
5255 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
5257 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
5259 struct LDKCOption_u64Z COption_u64Z_none(void);
5261 void COption_u64Z_free(struct LDKCOption_u64Z _res);
5263 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
5265 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o);
5267 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
5269 void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res);
5271 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig);
5273 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
5275 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
5277 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
5279 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
5281 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
5283 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
5285 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
5287 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
5289 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
5291 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
5293 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
5295 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
5297 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
5299 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
5301 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
5303 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
5305 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
5307 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
5309 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
5311 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
5313 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
5315 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
5317 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
5319 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
5321 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
5323 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
5325 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
5327 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
5329 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
5331 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
5333 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
5335 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
5337 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
5339 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
5341 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
5343 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
5345 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
5347 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
5349 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
5351 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
5353 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
5355 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
5357 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
5359 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
5361 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e);
5363 void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res);
5365 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig);
5367 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
5369 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
5371 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
5373 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
5375 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
5377 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
5379 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
5381 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
5383 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
5385 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
5387 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
5389 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
5391 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
5393 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
5395 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
5397 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
5399 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
5401 void CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res);
5403 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
5405 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
5407 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
5409 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
5411 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
5413 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
5415 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
5417 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
5419 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
5421 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
5423 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
5425 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
5427 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
5429 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
5431 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
5433 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
5435 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
5437 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
5439 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
5441 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
5443 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
5445 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
5447 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
5449 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
5451 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
5453 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
5455 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
5457 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
5459 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
5461 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
5463 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
5465 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
5467 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
5469 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
5471 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
5473 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
5475 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
5477 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
5479 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
5481 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
5483 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
5485 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
5487 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
5489 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
5491 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
5493 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
5495 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
5497 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
5499 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
5501 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
5503 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
5505 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
5507 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
5509 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
5511 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
5513 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
5515 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
5517 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
5519 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
5521 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
5523 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
5525 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
5527 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
5529 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
5531 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
5533 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
5535 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
5537 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
5539 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
5541 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
5543 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
5545 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
5547 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
5549 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
5551 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
5553 void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
5555 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
5557 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
5559 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
5561 void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
5563 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
5565 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
5567 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
5569 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
5571 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
5573 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
5575 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
5577 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
5579 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
5581 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
5583 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
5585 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
5587 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
5589 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
5591 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
5593 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
5595 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
5597 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
5599 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
5601 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
5603 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
5605 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
5607 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
5609 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
5611 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
5613 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
5615 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
5617 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
5619 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
5621 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
5623 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
5625 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
5627 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
5629 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o);
5631 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e);
5633 void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res);
5635 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig);
5637 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
5639 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
5641 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
5643 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
5645 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
5647 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
5649 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
5651 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
5653 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
5655 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
5657 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
5659 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
5661 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
5663 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
5665 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
5667 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
5669 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
5671 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
5673 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
5675 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
5677 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
5679 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
5681 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
5683 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
5685 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
5687 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
5689 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
5691 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
5693 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
5695 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
5697 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
5699 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
5701 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
5703 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
5705 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
5707 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
5709 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
5711 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
5713 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
5715 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
5717 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
5719 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
5721 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
5723 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
5725 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
5727 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
5729 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
5731 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
5733 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
5735 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
5737 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
5739 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
5741 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
5743 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
5745 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
5747 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
5749 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
5751 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
5753 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
5755 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
5757 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
5759 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
5761 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
5763 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
5765 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
5767 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
5769 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
5771 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
5773 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
5775 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
5777 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
5779 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
5781 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
5783 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
5785 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
5787 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
5789 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
5791 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
5793 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
5795 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
5797 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
5799 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
5801 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
5803 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
5805 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
5807 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
5809 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
5811 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
5813 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
5815 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
5817 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
5819 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
5822 * Frees any resources used by the Event
5824 void Event_free(struct LDKEvent this_ptr);
5827 * Creates a copy of the Event
5829 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
5832 * Serialize the Event object into a byte array which can be read by Event_read
5834 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
5837 * Frees any resources used by the MessageSendEvent
5839 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
5842 * Creates a copy of the MessageSendEvent
5844 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
5847 * Calls the free function if one is set
5849 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
5852 * Calls the free function if one is set
5854 void EventsProvider_free(struct LDKEventsProvider this_ptr);
5857 * Frees any resources used by the APIError
5859 void APIError_free(struct LDKAPIError this_ptr);
5862 * Creates a copy of the APIError
5864 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
5867 * Creates a copy of the Level
5869 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
5872 * Returns the most verbose logging level.
5874 MUST_USE_RES enum LDKLevel Level_max(void);
5877 * Calls the free function if one is set
5879 void Logger_free(struct LDKLogger this_ptr);
5882 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
5884 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
5887 * Confirmations we will wait for before considering the channel locked in.
5888 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
5889 * equivalent limit applied to outbound channels).
5893 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
5896 * Confirmations we will wait for before considering the channel locked in.
5897 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
5898 * equivalent limit applied to outbound channels).
5902 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
5905 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
5906 * the number of blocks we have to punish our counterparty if they broadcast a revoked
5909 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
5910 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
5911 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
5912 * possibly with time in between to RBF the spending transaction).
5914 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
5915 * case of an honest unilateral channel close, which implicitly decrease the economic value of
5918 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
5919 * can tweak config to ask for more security, not less.
5921 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
5924 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
5925 * the number of blocks we have to punish our counterparty if they broadcast a revoked
5928 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
5929 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
5930 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
5931 * possibly with time in between to RBF the spending transaction).
5933 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
5934 * case of an honest unilateral channel close, which implicitly decrease the economic value of
5937 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
5938 * can tweak config to ask for more security, not less.
5940 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
5943 * Set to the smallest value HTLC we will accept to process.
5945 * This value is sent to our counterparty on channel-open and we close the channel any time
5946 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
5948 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
5951 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
5954 * Set to the smallest value HTLC we will accept to process.
5956 * This value is sent to our counterparty on channel-open and we close the channel any time
5957 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
5959 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
5962 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
5965 * Constructs a new ChannelHandshakeConfig given each field
5967 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);
5970 * Creates a copy of the ChannelHandshakeConfig
5972 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
5975 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
5977 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
5980 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
5982 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
5985 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
5986 * only applies to inbound channels.
5990 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
5993 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
5994 * only applies to inbound channels.
5998 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
6001 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
6002 * you to limit the maximum minimum-size they can require.
6004 * Default value: u64::max_value.
6006 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
6009 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
6010 * you to limit the maximum minimum-size they can require.
6012 * Default value: u64::max_value.
6014 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
6017 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
6018 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
6022 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
6025 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
6026 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
6030 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
6033 * The remote node will require we keep a certain amount in direct payment to ourselves at all
6034 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
6035 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
6037 * Default value: u64::max_value.
6039 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
6042 * The remote node will require we keep a certain amount in direct payment to ourselves at all
6043 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
6044 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
6046 * Default value: u64::max_value.
6048 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
6051 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
6052 * time. This allows you to set a minimum such value.
6056 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
6059 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
6060 * time. This allows you to set a minimum such value.
6064 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
6067 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
6068 * required to always be higher than this value so this only applies to HTLC outputs (and
6069 * potentially to-self outputs before any payments have been made).
6070 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
6071 * This setting allows you to set a minimum dust limit for their commitment transactions,
6072 * reflecting the reality that tiny outputs are not considered standard transactions and will
6073 * not propagate through the Bitcoin network.
6075 * Default value: 546, the current dust limit on the Bitcoin network.
6077 uint64_t ChannelHandshakeLimits_get_min_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
6080 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
6081 * required to always be higher than this value so this only applies to HTLC outputs (and
6082 * potentially to-self outputs before any payments have been made).
6083 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
6084 * This setting allows you to set a minimum dust limit for their commitment transactions,
6085 * reflecting the reality that tiny outputs are not considered standard transactions and will
6086 * not propagate through the Bitcoin network.
6088 * Default value: 546, the current dust limit on the Bitcoin network.
6090 void ChannelHandshakeLimits_set_min_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
6093 * Maximum allowed threshold above which outputs will not be generated in their commitment
6095 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
6097 * Default value: u64::max_value.
6099 uint64_t ChannelHandshakeLimits_get_max_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
6102 * Maximum allowed threshold above which outputs will not be generated in their commitment
6104 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
6106 * Default value: u64::max_value.
6108 void ChannelHandshakeLimits_set_max_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
6111 * Before a channel is usable the funding transaction will need to be confirmed by at least a
6112 * certain number of blocks, specified by the node which is not the funder (as the funder can
6113 * assume they aren't going to double-spend themselves).
6114 * This config allows you to set a limit on the maximum amount of time to wait.
6116 * Default value: 144, or roughly one day and only applies to outbound channels.
6118 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
6121 * Before a channel is usable the funding transaction will need to be confirmed by at least a
6122 * certain number of blocks, specified by the node which is not the funder (as the funder can
6123 * assume they aren't going to double-spend themselves).
6124 * This config allows you to set a limit on the maximum amount of time to wait.
6126 * Default value: 144, or roughly one day and only applies to outbound channels.
6128 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
6131 * Set to force the incoming channel to match our announced channel preference in
6134 * Default value: true, to make the default that no announced channels are possible (which is
6135 * appropriate for any nodes which are not online very reliably).
6137 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
6140 * Set to force the incoming channel to match our announced channel preference in
6143 * Default value: true, to make the default that no announced channels are possible (which is
6144 * appropriate for any nodes which are not online very reliably).
6146 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
6149 * Set to the amount of time we're willing to wait to claim money back to us.
6151 * Not checking this value would be a security issue, as our peer would be able to set it to
6152 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
6154 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
6155 * reduce the loss of having useless locked funds (if your peer accepts)
6157 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
6160 * Set to the amount of time we're willing to wait to claim money back to us.
6162 * Not checking this value would be a security issue, as our peer would be able to set it to
6163 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
6165 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
6166 * reduce the loss of having useless locked funds (if your peer accepts)
6168 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
6171 * Constructs a new ChannelHandshakeLimits given each field
6173 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);
6176 * Creates a copy of the ChannelHandshakeLimits
6178 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
6181 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
6183 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
6186 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
6188 void ChannelConfig_free(struct LDKChannelConfig this_obj);
6191 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
6192 * This may be allowed to change at runtime in a later update, however doing so must result in
6193 * update messages sent to notify all nodes of our updated relay fee.
6197 uint32_t ChannelConfig_get_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
6200 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
6201 * This may be allowed to change at runtime in a later update, however doing so must result in
6202 * update messages sent to notify all nodes of our updated relay fee.
6206 void ChannelConfig_set_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
6209 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
6210 * the channel this config applies to.
6212 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
6213 * HTLC balance when a channel appears on-chain whereas
6214 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
6215 * (non-HTLC-encumbered) balance.
6217 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
6218 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
6219 * commitment transaction at least once per this many blocks (minus some margin to allow us
6220 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
6221 * the spending transaction).
6223 * Default value: 72 (12 hours at an average of 6 blocks/hour).
6224 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
6225 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
6227 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
6229 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
6232 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
6233 * the channel this config applies to.
6235 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
6236 * HTLC balance when a channel appears on-chain whereas
6237 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
6238 * (non-HTLC-encumbered) balance.
6240 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
6241 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
6242 * commitment transaction at least once per this many blocks (minus some margin to allow us
6243 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
6244 * the spending transaction).
6246 * Default value: 72 (12 hours at an average of 6 blocks/hour).
6247 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
6248 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
6250 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
6252 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
6255 * Set to announce the channel publicly and notify all nodes that they can route via this
6258 * This should only be set to true for nodes which expect to be online reliably.
6260 * As the node which funds a channel picks this value this will only apply for new outbound
6261 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
6263 * This cannot be changed after the initial channel handshake.
6265 * Default value: false.
6267 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
6270 * Set to announce the channel publicly and notify all nodes that they can route via this
6273 * This should only be set to true for nodes which expect to be online reliably.
6275 * As the node which funds a channel picks this value this will only apply for new outbound
6276 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
6278 * This cannot be changed after the initial channel handshake.
6280 * Default value: false.
6282 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
6285 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
6286 * supports it, they will then enforce the mutual-close output to us matches what we provided
6287 * at intialization, preventing us from closing to an alternate pubkey.
6289 * This is set to true by default to provide a slight increase in security, though ultimately
6290 * any attacker who is able to take control of a channel can just as easily send the funds via
6291 * lightning payments, so we never require that our counterparties support this option.
6293 * This cannot be changed after a channel has been initialized.
6295 * Default value: true.
6297 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
6300 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
6301 * supports it, they will then enforce the mutual-close output to us matches what we provided
6302 * at intialization, preventing us from closing to an alternate pubkey.
6304 * This is set to true by default to provide a slight increase in security, though ultimately
6305 * any attacker who is able to take control of a channel can just as easily send the funds via
6306 * lightning payments, so we never require that our counterparties support this option.
6308 * This cannot be changed after a channel has been initialized.
6310 * Default value: true.
6312 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
6315 * Constructs a new ChannelConfig given each field
6317 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);
6320 * Creates a copy of the ChannelConfig
6322 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
6325 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
6327 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
6330 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
6332 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
6335 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
6337 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
6340 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
6342 void UserConfig_free(struct LDKUserConfig this_obj);
6345 * Channel config that we propose to our counterparty.
6347 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
6350 * Channel config that we propose to our counterparty.
6352 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
6355 * Limits applied to our counterparty's proposed channel config settings.
6357 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
6360 * Limits applied to our counterparty's proposed channel config settings.
6362 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
6365 * Channel config which affects behavior during channel lifetime.
6367 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
6370 * Channel config which affects behavior during channel lifetime.
6372 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
6375 * Constructs a new UserConfig given each field
6377 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);
6380 * Creates a copy of the UserConfig
6382 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
6385 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
6387 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
6390 * Creates a copy of the AccessError
6392 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
6395 * Calls the free function if one is set
6397 void Access_free(struct LDKAccess this_ptr);
6400 * Calls the free function if one is set
6402 void Listen_free(struct LDKListen this_ptr);
6405 * Calls the free function if one is set
6407 void Watch_free(struct LDKWatch this_ptr);
6410 * Calls the free function if one is set
6412 void Filter_free(struct LDKFilter this_ptr);
6415 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
6417 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
6420 * First block where the transaction output may have been spent.
6422 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
6425 * First block where the transaction output may have been spent.
6427 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6430 * Outpoint identifying the transaction output.
6432 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
6435 * Outpoint identifying the transaction output.
6437 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
6440 * Spending condition of the transaction output.
6442 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
6445 * Spending condition of the transaction output.
6447 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
6450 * Constructs a new WatchedOutput given each field
6452 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
6455 * Calls the free function if one is set
6457 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
6460 * Creates a copy of the ConfirmationTarget
6462 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
6465 * Calls the free function if one is set
6467 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
6470 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
6472 void ChainMonitor_free(struct LDKChainMonitor this_obj);
6475 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
6476 * of a channel and reacting accordingly based on transactions in the connected block. See
6477 * [`ChannelMonitor::block_connected`] for details. Any HTLCs that were resolved on chain will
6478 * be returned by [`chain::Watch::release_pending_monitor_events`].
6480 * Calls back to [`chain::Filter`] if any monitor indicated new outputs to watch. Subsequent
6481 * calls must not exclude any transactions matching the new outputs nor any in-block
6482 * descendants of such transactions. It is not necessary to re-fetch the block to obtain
6485 void ChainMonitor_block_connected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
6488 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
6489 * of a channel based on the disconnected block. See [`ChannelMonitor::block_disconnected`] for
6492 void ChainMonitor_block_disconnected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t disconnected_height);
6495 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
6497 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
6498 * will call back to it indicating transactions and outputs of interest. This allows clients to
6499 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
6500 * always need to fetch full blocks absent another means for determining which blocks contain
6501 * transactions relevant to the watched channels.
6503 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
6506 * Constructs a new Watch which calls the relevant methods on this_arg.
6507 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
6509 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
6512 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
6513 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
6515 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
6518 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
6520 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
6523 * The sequence number of this update. Updates *must* be replayed in-order according to this
6524 * sequence number (and updates may panic if they are not). The update_id values are strictly
6525 * increasing and increase by one for each new update, with one exception specified below.
6527 * This sequence number is also used to track up to which points updates which returned
6528 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
6529 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
6531 * The only instance where update_id values are not strictly increasing is the case where we
6532 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
6533 * its docs for more details.
6535 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
6538 * The sequence number of this update. Updates *must* be replayed in-order according to this
6539 * sequence number (and updates may panic if they are not). The update_id values are strictly
6540 * increasing and increase by one for each new update, with one exception specified below.
6542 * This sequence number is also used to track up to which points updates which returned
6543 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
6544 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
6546 * The only instance where update_id values are not strictly increasing is the case where we
6547 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
6548 * its docs for more details.
6550 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
6553 * Creates a copy of the ChannelMonitorUpdate
6555 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
6558 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
6560 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
6563 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
6565 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
6568 * Creates a copy of the ChannelMonitorUpdateErr
6570 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
6573 * Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
6575 void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
6578 * Creates a copy of the MonitorUpdateError
6580 struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
6583 * Frees any resources used by the MonitorEvent
6585 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
6588 * Creates a copy of the MonitorEvent
6590 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
6593 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
6595 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
6598 * Creates a copy of the HTLCUpdate
6600 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
6603 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
6605 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
6608 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
6610 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
6613 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
6615 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
6618 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
6620 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
6623 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
6626 * panics if the given update is not the next update by update_id.
6628 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);
6631 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
6634 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
6637 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
6639 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
6642 * Gets a list of txids, with their output scripts (in the order they appear in the
6643 * transaction), which we must learn about spends of via block_connected().
6645 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
6648 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
6649 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
6650 * have been registered.
6652 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
6655 * Get the list of HTLCs who's status has been updated on chain. This should be called by
6656 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
6658 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
6661 * Gets the list of pending events which were generated by previous actions, clearing the list
6664 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
6665 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
6666 * no internal locking in ChannelMonitors.
6668 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
6671 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
6672 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
6673 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
6674 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
6675 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
6676 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
6677 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
6678 * out-of-band the other node operator to coordinate with him if option is available to you.
6679 * In any-case, choice is up to the user.
6681 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);
6684 * Processes transactions in a newly connected block, which may result in any of the following:
6685 * - update the monitor's state against resolved HTLCs
6686 * - punish the counterparty in the case of seeing a revoked commitment transaction
6687 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
6688 * - detect settled outputs for later spending
6689 * - schedule and bump any in-flight claims
6691 * Returns any new outputs to watch from `txdata`; after called, these are also included in
6692 * [`get_outputs_to_watch`].
6694 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
6696 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);
6699 * Determines if the disconnected block contained any transactions of interest and updates
6702 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);
6705 * Calls the free function if one is set
6707 void Persist_free(struct LDKPersist this_ptr);
6710 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
6712 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
6715 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
6717 void OutPoint_free(struct LDKOutPoint this_obj);
6720 * The referenced transaction's txid.
6722 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
6725 * The referenced transaction's txid.
6727 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6730 * The index of the referenced output in its transaction's vout.
6732 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
6735 * The index of the referenced output in its transaction's vout.
6737 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
6740 * Constructs a new OutPoint given each field
6742 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
6745 * Creates a copy of the OutPoint
6747 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
6750 * Convert an `OutPoint` to a lightning channel id.
6752 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
6755 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
6757 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
6760 * Read a OutPoint from a byte array, created by OutPoint_write
6762 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
6765 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
6767 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
6770 * The outpoint which is spendable
6772 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
6775 * The outpoint which is spendable
6777 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
6780 * Per commitment point to derive delayed_payment_key by key holder
6782 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
6785 * Per commitment point to derive delayed_payment_key by key holder
6787 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6790 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
6791 * the witness_script.
6793 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
6796 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
6797 * the witness_script.
6799 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
6802 * The output which is referenced by the given outpoint
6804 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
6807 * The revocation point specific to the commitment transaction which was broadcast. Used to
6808 * derive the witnessScript for this output.
6810 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
6813 * The revocation point specific to the commitment transaction which was broadcast. Used to
6814 * derive the witnessScript for this output.
6816 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6819 * Arbitrary identification information returned by a call to
6820 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
6821 * the channel to spend the output.
6823 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
6826 * Arbitrary identification information returned by a call to
6827 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
6828 * the channel to spend the output.
6830 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6833 * The value of the channel which this output originated from, possibly indirectly.
6835 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
6838 * The value of the channel which this output originated from, possibly indirectly.
6840 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
6843 * Constructs a new DelayedPaymentOutputDescriptor given each field
6845 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);
6848 * Creates a copy of the DelayedPaymentOutputDescriptor
6850 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
6853 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
6855 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
6858 * The outpoint which is spendable
6860 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
6863 * The outpoint which is spendable
6865 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
6868 * The output which is referenced by the given outpoint
6870 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
6873 * Arbitrary identification information returned by a call to
6874 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
6875 * the channel to spend the output.
6877 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
6880 * Arbitrary identification information returned by a call to
6881 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
6882 * the channel to spend the output.
6884 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6887 * The value of the channel which this transactions spends.
6889 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
6892 * The value of the channel which this transactions spends.
6894 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
6897 * Constructs a new StaticPaymentOutputDescriptor given each field
6899 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);
6902 * Creates a copy of the StaticPaymentOutputDescriptor
6904 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
6907 * Frees any resources used by the SpendableOutputDescriptor
6909 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
6912 * Creates a copy of the SpendableOutputDescriptor
6914 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
6917 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
6919 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
6922 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
6924 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
6927 * Creates a copy of a Sign
6929 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
6932 * Calls the free function if one is set
6934 void Sign_free(struct LDKSign this_ptr);
6937 * Calls the free function if one is set
6939 void KeysInterface_free(struct LDKKeysInterface this_ptr);
6942 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
6944 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
6947 * Private key of anchor tx
6949 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
6952 * Private key of anchor tx
6954 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
6957 * Holder secret key for blinded revocation pubkey
6959 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
6962 * Holder secret key for blinded revocation pubkey
6964 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
6967 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
6969 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
6972 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
6974 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
6977 * Holder secret key used in HTLC tx
6979 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
6982 * Holder secret key used in HTLC tx
6984 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
6987 * Holder htlc secret key used in commitment tx htlc outputs
6989 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
6992 * Holder htlc secret key used in commitment tx htlc outputs
6994 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
6999 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
7004 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7007 * Creates a copy of the InMemorySigner
7009 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
7012 * Create a new InMemorySigner
7014 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);
7017 * Counterparty pubkeys.
7018 * Will panic if ready_channel wasn't called.
7020 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
7023 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
7024 * transactions, ie the amount of time that we have to wait to recover our funds if we
7025 * broadcast a transaction.
7026 * Will panic if ready_channel wasn't called.
7028 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
7031 * The contest_delay value specified by us and applied on transactions broadcastable
7032 * by our counterparty, ie the amount of time that they have to wait to recover their funds
7033 * if they broadcast a transaction.
7034 * Will panic if ready_channel wasn't called.
7036 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
7039 * Whether the holder is the initiator
7040 * Will panic if ready_channel wasn't called.
7042 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
7046 * Will panic if ready_channel wasn't called.
7048 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
7051 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
7052 * building transactions.
7054 * Will panic if ready_channel wasn't called.
7056 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
7059 * Sign the single input of spend_tx at index `input_idx` which spends the output
7060 * described by descriptor, returning the witness stack for the input.
7062 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
7063 * or is not spending the outpoint described by `descriptor.outpoint`.
7065 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);
7068 * Sign the single input of spend_tx at index `input_idx` which spends the output
7069 * described by descriptor, returning the witness stack for the input.
7071 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
7072 * is not spending the outpoint described by `descriptor.outpoint`, or does not have a
7073 * sequence set to `descriptor.to_self_delay`.
7075 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);
7078 * Constructs a new Sign which calls the relevant methods on this_arg.
7079 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
7081 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
7084 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
7086 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
7089 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
7091 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
7094 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
7096 void KeysManager_free(struct LDKKeysManager this_obj);
7099 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
7100 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
7101 * starting_time isn't strictly required to actually be a time, but it must absolutely,
7102 * without a doubt, be unique to this instance. ie if you start multiple times with the same
7103 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
7104 * simply use the current time (with very high precision).
7106 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
7107 * obviously, starting_time should be unique every time you reload the library - it is only
7108 * used to generate new ephemeral key data (which will be stored by the individual channel if
7111 * Note that the seed is required to recover certain on-chain funds independent of
7112 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
7113 * channel, and some on-chain during-closing funds.
7115 * Note that until the 0.1 release there is no guarantee of backward compatibility between
7116 * versions. Once the library is more fully supported, the docs will be updated to include a
7117 * detailed description of the guarantee.
7119 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
7122 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
7124 * Key derivation parameters are accessible through a per-channel secrets
7125 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
7126 * onchain output detection for which a corresponding delayed_payment_key must be derived.
7128 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]);
7131 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
7132 * output to the given change destination (if sufficient change value remains). The
7133 * transaction will have a feerate, at least, of the given value.
7135 * Returns `Err(())` if the output value is greater than the input value minus required fee or
7136 * if a descriptor was duplicated.
7138 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
7140 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
7141 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
7143 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);
7146 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
7147 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
7149 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
7152 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
7154 void ChannelManager_free(struct LDKChannelManager this_obj);
7157 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
7159 void ChainParameters_free(struct LDKChainParameters this_obj);
7162 * The network for determining the `chain_hash` in Lightning messages.
7164 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
7167 * The network for determining the `chain_hash` in Lightning messages.
7169 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
7172 * The hash of the latest block successfully connected.
7174 const uint8_t (*ChainParameters_get_latest_hash(const struct LDKChainParameters *NONNULL_PTR this_ptr))[32];
7177 * The hash of the latest block successfully connected.
7179 void ChainParameters_set_latest_hash(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7182 * The height of the latest block successfully connected.
7184 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
7186 uintptr_t ChainParameters_get_latest_height(const struct LDKChainParameters *NONNULL_PTR this_ptr);
7189 * The height of the latest block successfully connected.
7191 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
7193 void ChainParameters_set_latest_height(struct LDKChainParameters *NONNULL_PTR this_ptr, uintptr_t val);
7196 * Constructs a new ChainParameters given each field
7198 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKThirtyTwoBytes latest_hash_arg, uintptr_t latest_height_arg);
7201 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
7203 void ChannelDetails_free(struct LDKChannelDetails this_obj);
7206 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
7207 * thereafter this is the txid of the funding transaction xor the funding transaction output).
7208 * Note that this means this value is *not* persistent - it can change once during the
7209 * lifetime of the channel.
7211 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
7214 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
7215 * thereafter this is the txid of the funding transaction xor the funding transaction output).
7216 * Note that this means this value is *not* persistent - it can change once during the
7217 * lifetime of the channel.
7219 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7222 * The position of the funding transaction in the chain. None if the funding transaction has
7223 * not yet been confirmed and the channel fully opened.
7225 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7228 * The position of the funding transaction in the chain. None if the funding transaction has
7229 * not yet been confirmed and the channel fully opened.
7231 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
7234 * The node_id of our counterparty
7236 struct LDKPublicKey ChannelDetails_get_remote_network_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7239 * The node_id of our counterparty
7241 void ChannelDetails_set_remote_network_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7244 * The Features the channel counterparty provided upon last connection.
7245 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
7246 * many routing-relevant features are present in the init context.
7248 struct LDKInitFeatures ChannelDetails_get_counterparty_features(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7251 * The Features the channel counterparty provided upon last connection.
7252 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
7253 * many routing-relevant features are present in the init context.
7255 void ChannelDetails_set_counterparty_features(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
7258 * The value, in satoshis, of this channel as appears in the funding output
7260 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7263 * The value, in satoshis, of this channel as appears in the funding output
7265 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
7268 * The user_id passed in to create_channel, or 0 if the channel was inbound.
7270 uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7273 * The user_id passed in to create_channel, or 0 if the channel was inbound.
7275 void ChannelDetails_set_user_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
7278 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
7279 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
7280 * available for inclusion in new outbound HTLCs). This further does not include any pending
7281 * outgoing HTLCs which are awaiting some other resolution to be sent.
7283 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7286 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
7287 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
7288 * available for inclusion in new outbound HTLCs). This further does not include any pending
7289 * outgoing HTLCs which are awaiting some other resolution to be sent.
7291 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
7294 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
7295 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
7296 * available for inclusion in new inbound HTLCs).
7297 * Note that there are some corner cases not fully handled here, so the actual available
7298 * inbound capacity may be slightly higher than this.
7300 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7303 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
7304 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
7305 * available for inclusion in new inbound HTLCs).
7306 * Note that there are some corner cases not fully handled here, so the actual available
7307 * inbound capacity may be slightly higher than this.
7309 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
7312 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
7313 * the peer is connected, and (c) no monitor update failure is pending resolution.
7315 bool ChannelDetails_get_is_live(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7318 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
7319 * the peer is connected, and (c) no monitor update failure is pending resolution.
7321 void ChannelDetails_set_is_live(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
7324 * Creates a copy of the ChannelDetails
7326 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
7329 * Frees any resources used by the PaymentSendFailure
7331 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
7334 * Creates a copy of the PaymentSendFailure
7336 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
7339 * Constructs a new ChannelManager to hold several channels and route between them.
7341 * This is the main \"logic hub\" for all channel-related actions, and implements
7342 * ChannelMessageHandler.
7344 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
7346 * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
7348 * Users need to notify the new ChannelManager when a new block is connected or
7349 * disconnected using its `block_connected` and `block_disconnected` methods, starting
7350 * from after `params.latest_hash`.
7352 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);
7355 * Creates a new outbound channel to the given remote node and with the given value.
7357 * user_id will be provided back as user_channel_id in FundingGenerationReady and
7358 * FundingBroadcastSafe events to allow tracking of which events correspond with which
7359 * create_channel call. Note that user_channel_id defaults to 0 for inbound channels, so you
7360 * may wish to avoid using 0 for user_id here.
7362 * If successful, will generate a SendOpenChannel message event, so you should probably poll
7363 * PeerManager::process_events afterwards.
7365 * Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
7366 * greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
7368 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);
7371 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
7374 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
7377 * Gets the list of usable channels, in random order. Useful as an argument to
7378 * get_route to ensure non-announced channels are used.
7380 * These are guaranteed to have their is_live value set to true, see the documentation for
7381 * ChannelDetails::is_live for more info on exactly what the criteria are.
7383 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
7386 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
7387 * will be accepted on the given channel, and after additional timeout/the closing of all
7388 * pending HTLCs, the channel will be closed on chain.
7390 * May generate a SendShutdown message event on success, which should be relayed.
7392 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
7395 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
7396 * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
7398 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
7401 * Force close all channels, immediately broadcasting the latest local commitment transaction
7402 * for each to the chain and rejecting new HTLCs on each.
7404 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
7407 * Sends a payment along a given route.
7409 * Value parameters are provided via the last hop in route, see documentation for RouteHop
7410 * fields for more info.
7412 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
7413 * payment), we don't do anything to stop you! We always try to ensure that if the provided
7414 * next hop knows the preimage to payment_hash they can claim an additional amount as
7415 * specified in the last hop in the route! Thus, you should probably do your own
7416 * payment_preimage tracking (which you should already be doing as they represent \"proof of
7417 * payment\") and prevent double-sends yourself.
7419 * May generate SendHTLCs message(s) event on success, which should be relayed.
7421 * Each path may have a different return value, and PaymentSendValue may return a Vec with
7422 * each entry matching the corresponding-index entry in the route paths, see
7423 * PaymentSendFailure for more info.
7425 * In general, a path may raise:
7426 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
7427 * node public key) is specified.
7428 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
7429 * (including due to previous monitor update failure or new permanent monitor update
7431 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
7434 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
7435 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
7436 * different route unless you intend to pay twice!
7438 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
7439 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
7440 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
7441 * must not contain multiple paths as multi-path payments require a recipient-provided
7443 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
7444 * bit set (either as required or as available). If multiple paths are present in the Route,
7445 * we assume the invoice had the basic_mpp feature set.
7447 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);
7450 * Call this upon creation of a funding transaction for the given channel.
7452 * Note that ALL inputs in the transaction pointed to by funding_txo MUST spend SegWit outputs
7453 * or your counterparty can steal your funds!
7455 * Panics if a funding transaction has already been provided for this channel.
7457 * May panic if the funding_txo is duplicative with some other channel (note that this should
7458 * be trivially prevented by using unique funding transaction keys per-channel).
7460 void ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKOutPoint funding_txo);
7463 * Generates a signed node_announcement from the given arguments and creates a
7464 * BroadcastNodeAnnouncement event. Note that such messages will be ignored unless peers have
7465 * seen a channel_announcement from us (ie unless we have public channels open).
7467 * RGB is a node \"color\" and alias is a printable human-readable string to describe this node
7468 * to humans. They carry no in-protocol meaning.
7470 * addresses represent the set (possibly empty) of socket addresses on which this node accepts
7471 * incoming connections. These will be broadcast to the network, publicly tying these
7472 * addresses together. If you wish to preserve user privacy, addresses should likely contain
7473 * only Tor Onion addresses.
7475 * Panics if addresses is absurdly large (more than 500).
7477 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
7480 * Processes HTLCs which are pending waiting on random forward delay.
7482 * Should only really ever be called in response to a PendingHTLCsForwardable event.
7483 * Will likely generate further events.
7485 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
7488 * If a peer is disconnected we mark any channels with that peer as 'disabled'.
7489 * After some time, if channels are still disabled we need to broadcast a ChannelUpdate
7490 * to inform the network about the uselessness of these channels.
7492 * This method handles all the details, and must be called roughly once per minute.
7494 * Note that in some rare cases this may generate a `chain::Watch::update_channel` call.
7496 void ChannelManager_timer_chan_freshness_every_min(const struct LDKChannelManager *NONNULL_PTR this_arg);
7499 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
7500 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
7501 * along the path (including in our own channel on which we received it).
7502 * Returns false if no payment was found to fail backwards, true if the process of failing the
7503 * HTLC backwards has been started.
7505 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);
7508 * Provides a payment preimage in response to a PaymentReceived event, returning true and
7509 * generating message events for the net layer to claim the payment, if possible. Thus, you
7510 * should probably kick the net layer to go send messages if this returns true!
7512 * You must specify the expected amounts for this HTLC, and we will only claim HTLCs
7513 * available within a few percent of the expected amount. This is critical for several
7514 * reasons : a) it avoids providing senders with `proof-of-payment` (in the form of the
7515 * payment_preimage without having provided the full value and b) it avoids certain
7516 * privacy-breaking recipient-probing attacks which may reveal payment activity to
7517 * motivated attackers.
7519 * Note that the privacy concerns in (b) are not relevant in payments with a payment_secret
7520 * set. Thus, for such payments we will claim any payments which do not under-pay.
7522 * May panic if called except in response to a PaymentReceived event.
7524 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);
7527 * Gets the node_id held by this ChannelManager
7529 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
7532 * Restores a single, given channel to normal operation after a
7533 * ChannelMonitorUpdateErr::TemporaryFailure was returned from a channel monitor update
7536 * All ChannelMonitor updates up to and including highest_applied_update_id must have been
7537 * fully committed in every copy of the given channels' ChannelMonitors.
7539 * Note that there is no effect to calling with a highest_applied_update_id other than the
7540 * current latest ChannelMonitorUpdate and one call to this function after multiple
7541 * ChannelMonitorUpdateErr::TemporaryFailures is fine. The highest_applied_update_id field
7542 * exists largely only to prevent races between this and concurrent update_monitor calls.
7544 * Thus, the anticipated use is, at a high level:
7545 * 1) You register a chain::Watch with this ChannelManager,
7546 * 2) it stores each update to disk, and begins updating any remote (eg watchtower) copies of
7547 * said ChannelMonitors as it can, returning ChannelMonitorUpdateErr::TemporaryFailures
7548 * any time it cannot do so instantly,
7549 * 3) update(s) are applied to each remote copy of a ChannelMonitor,
7550 * 4) once all remote copies are updated, you call this function with the update_id that
7551 * completed, and once it is the latest the Channel will be re-enabled.
7553 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);
7556 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
7557 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
7559 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
7562 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
7563 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
7565 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
7568 * Constructs a new Listen which calls the relevant methods on this_arg.
7569 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
7571 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
7574 * Updates channel state based on transactions seen in a connected block.
7576 void ChannelManager_block_connected(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
7579 * Updates channel state based on a disconnected block.
7581 * If necessary, the channel may be force-closed without letting the counterparty participate
7584 void ChannelManager_block_disconnected(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80]);
7587 * Blocks until ChannelManager needs to be persisted. Only one listener on
7588 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
7591 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
7594 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
7595 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
7597 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
7600 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
7602 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
7605 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
7607 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
7610 * The keys provider which will give us relevant keys. Some keys will be loaded during
7611 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
7614 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
7617 * The keys provider which will give us relevant keys. Some keys will be loaded during
7618 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
7621 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
7624 * The fee_estimator for use in the ChannelManager in the future.
7626 * No calls to the FeeEstimator will be made during deserialization.
7628 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
7631 * The fee_estimator for use in the ChannelManager in the future.
7633 * No calls to the FeeEstimator will be made during deserialization.
7635 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
7638 * The chain::Watch for use in the ChannelManager in the future.
7640 * No calls to the chain::Watch will be made during deserialization. It is assumed that
7641 * you have deserialized ChannelMonitors separately and will add them to your
7642 * chain::Watch after deserializing this ChannelManager.
7644 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
7647 * The chain::Watch for use in the ChannelManager in the future.
7649 * No calls to the chain::Watch will be made during deserialization. It is assumed that
7650 * you have deserialized ChannelMonitors separately and will add them to your
7651 * chain::Watch after deserializing this ChannelManager.
7653 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
7656 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
7657 * used to broadcast the latest local commitment transactions of channels which must be
7658 * force-closed during deserialization.
7660 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
7663 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
7664 * used to broadcast the latest local commitment transactions of channels which must be
7665 * force-closed during deserialization.
7667 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
7670 * The Logger for use in the ChannelManager and which may be used to log information during
7673 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
7676 * The Logger for use in the ChannelManager and which may be used to log information during
7679 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
7682 * Default settings used for new channels. Any existing channels will continue to use the
7683 * runtime settings which were stored when the ChannelManager was serialized.
7685 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
7688 * Default settings used for new channels. Any existing channels will continue to use the
7689 * runtime settings which were stored when the ChannelManager was serialized.
7691 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
7694 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
7695 * HashMap for you. This is primarily useful for C bindings where it is not practical to
7696 * populate a HashMap directly from C.
7698 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);
7701 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
7703 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
7706 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
7708 void DecodeError_free(struct LDKDecodeError this_obj);
7711 * Creates a copy of the DecodeError
7713 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
7716 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
7718 void Init_free(struct LDKInit this_obj);
7721 * The relevant features which the sender supports
7723 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
7726 * The relevant features which the sender supports
7728 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
7731 * Constructs a new Init given each field
7733 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
7736 * Creates a copy of the Init
7738 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
7741 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
7743 void ErrorMessage_free(struct LDKErrorMessage this_obj);
7746 * The channel ID involved in the error
7748 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
7751 * The channel ID involved in the error
7753 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7756 * A possibly human-readable error description.
7757 * The string should be sanitized before it is used (e.g. emitted to logs
7758 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
7759 * vulnerability in the terminal emulator or the logging subsystem.
7761 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
7764 * A possibly human-readable error description.
7765 * The string should be sanitized before it is used (e.g. emitted to logs
7766 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
7767 * vulnerability in the terminal emulator or the logging subsystem.
7769 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
7772 * Constructs a new ErrorMessage given each field
7774 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg);
7777 * Creates a copy of the ErrorMessage
7779 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
7782 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
7784 void Ping_free(struct LDKPing this_obj);
7787 * The desired response length
7789 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
7792 * The desired response length
7794 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
7797 * The ping packet size.
7798 * This field is not sent on the wire. byteslen zeros are sent.
7800 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
7803 * The ping packet size.
7804 * This field is not sent on the wire. byteslen zeros are sent.
7806 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
7809 * Constructs a new Ping given each field
7811 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
7814 * Creates a copy of the Ping
7816 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
7819 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
7821 void Pong_free(struct LDKPong this_obj);
7824 * The pong packet size.
7825 * This field is not sent on the wire. byteslen zeros are sent.
7827 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
7830 * The pong packet size.
7831 * This field is not sent on the wire. byteslen zeros are sent.
7833 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
7836 * Constructs a new Pong given each field
7838 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
7841 * Creates a copy of the Pong
7843 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
7846 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
7848 void OpenChannel_free(struct LDKOpenChannel this_obj);
7851 * The genesis hash of the blockchain where the channel is to be opened
7853 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
7856 * The genesis hash of the blockchain where the channel is to be opened
7858 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7861 * A temporary channel ID, until the funding outpoint is announced
7863 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
7866 * A temporary channel ID, until the funding outpoint is announced
7868 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7873 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7878 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
7881 * The amount to push to the counterparty as part of the open, in milli-satoshi
7883 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7886 * The amount to push to the counterparty as part of the open, in milli-satoshi
7888 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
7891 * The threshold below which outputs on transactions broadcast by sender will be omitted
7893 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7896 * The threshold below which outputs on transactions broadcast by sender will be omitted
7898 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
7901 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
7903 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7906 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
7908 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
7911 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
7913 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7916 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
7918 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
7921 * The minimum HTLC size incoming to sender, in milli-satoshi
7923 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7926 * The minimum HTLC size incoming to sender, in milli-satoshi
7928 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
7931 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
7933 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7936 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
7938 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
7941 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
7943 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7946 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
7948 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
7951 * The maximum number of inbound HTLCs towards sender
7953 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7956 * The maximum number of inbound HTLCs towards sender
7958 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
7961 * The sender's key controlling the funding transaction
7963 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7966 * The sender's key controlling the funding transaction
7968 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7971 * Used to derive a revocation key for transactions broadcast by counterparty
7973 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7976 * Used to derive a revocation key for transactions broadcast by counterparty
7978 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7981 * A payment key to sender for transactions broadcast by counterparty
7983 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7986 * A payment key to sender for transactions broadcast by counterparty
7988 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7991 * Used to derive a payment key to sender for transactions broadcast by sender
7993 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7996 * Used to derive a payment key to sender for transactions broadcast by sender
7998 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8001 * Used to derive an HTLC payment key to sender
8003 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
8006 * Used to derive an HTLC payment key to sender
8008 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8011 * The first to-be-broadcast-by-sender transaction's per commitment point
8013 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
8016 * The first to-be-broadcast-by-sender transaction's per commitment point
8018 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8023 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
8028 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
8031 * Creates a copy of the OpenChannel
8033 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
8036 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
8038 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
8041 * A temporary channel ID, until the funding outpoint is announced
8043 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
8046 * A temporary channel ID, until the funding outpoint is announced
8048 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8051 * The threshold below which outputs on transactions broadcast by sender will be omitted
8053 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8056 * The threshold below which outputs on transactions broadcast by sender will be omitted
8058 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
8061 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
8063 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8066 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
8068 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
8071 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
8073 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8076 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
8078 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
8081 * The minimum HTLC size incoming to sender, in milli-satoshi
8083 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8086 * The minimum HTLC size incoming to sender, in milli-satoshi
8088 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
8091 * Minimum depth of the funding transaction before the channel is considered open
8093 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8096 * Minimum depth of the funding transaction before the channel is considered open
8098 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
8101 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
8103 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8106 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
8108 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
8111 * The maximum number of inbound HTLCs towards sender
8113 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8116 * The maximum number of inbound HTLCs towards sender
8118 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
8121 * The sender's key controlling the funding transaction
8123 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8126 * The sender's key controlling the funding transaction
8128 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8131 * Used to derive a revocation key for transactions broadcast by counterparty
8133 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8136 * Used to derive a revocation key for transactions broadcast by counterparty
8138 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8141 * A payment key to sender for transactions broadcast by counterparty
8143 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8146 * A payment key to sender for transactions broadcast by counterparty
8148 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8151 * Used to derive a payment key to sender for transactions broadcast by sender
8153 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8156 * Used to derive a payment key to sender for transactions broadcast by sender
8158 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8161 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
8163 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8166 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
8168 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8171 * The first to-be-broadcast-by-sender transaction's per commitment point
8173 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8176 * The first to-be-broadcast-by-sender transaction's per commitment point
8178 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8181 * Creates a copy of the AcceptChannel
8183 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
8186 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
8188 void FundingCreated_free(struct LDKFundingCreated this_obj);
8191 * A temporary channel ID, until the funding is established
8193 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
8196 * A temporary channel ID, until the funding is established
8198 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8201 * The funding transaction ID
8203 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
8206 * The funding transaction ID
8208 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8211 * The specific output index funding this channel
8213 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
8216 * The specific output index funding this channel
8218 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
8221 * The signature of the channel initiator (funder) on the funding transaction
8223 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
8226 * The signature of the channel initiator (funder) on the funding transaction
8228 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
8231 * Constructs a new FundingCreated given each field
8233 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);
8236 * Creates a copy of the FundingCreated
8238 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
8241 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
8243 void FundingSigned_free(struct LDKFundingSigned this_obj);
8248 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
8253 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8256 * The signature of the channel acceptor (fundee) on the funding transaction
8258 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
8261 * The signature of the channel acceptor (fundee) on the funding transaction
8263 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
8266 * Constructs a new FundingSigned given each field
8268 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
8271 * Creates a copy of the FundingSigned
8273 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
8276 * Frees any resources used by the FundingLocked, if is_owned is set and inner is non-NULL.
8278 void FundingLocked_free(struct LDKFundingLocked this_obj);
8283 const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32];
8288 void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8291 * The per-commitment point of the second commitment transaction
8293 struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr);
8296 * The per-commitment point of the second commitment transaction
8298 void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8301 * Constructs a new FundingLocked given each field
8303 MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
8306 * Creates a copy of the FundingLocked
8308 struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
8311 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
8313 void Shutdown_free(struct LDKShutdown this_obj);
8318 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
8323 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8326 * The destination of this peer's funds on closing.
8327 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
8329 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
8332 * The destination of this peer's funds on closing.
8333 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
8335 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
8338 * Constructs a new Shutdown given each field
8340 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
8343 * Creates a copy of the Shutdown
8345 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
8348 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
8350 void ClosingSigned_free(struct LDKClosingSigned this_obj);
8355 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
8360 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8363 * The proposed total fee for the closing transaction
8365 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
8368 * The proposed total fee for the closing transaction
8370 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
8373 * A signature on the closing transaction
8375 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
8378 * A signature on the closing transaction
8380 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
8383 * Constructs a new ClosingSigned given each field
8385 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg);
8388 * Creates a copy of the ClosingSigned
8390 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
8393 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
8395 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
8400 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
8405 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8410 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
8415 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
8418 * The HTLC value in milli-satoshi
8420 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
8423 * The HTLC value in milli-satoshi
8425 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
8428 * The payment hash, the pre-image of which controls HTLC redemption
8430 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
8433 * The payment hash, the pre-image of which controls HTLC redemption
8435 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8438 * The expiry height of the HTLC
8440 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
8443 * The expiry height of the HTLC
8445 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
8448 * Creates a copy of the UpdateAddHTLC
8450 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
8453 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
8455 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
8460 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
8465 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8470 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
8475 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
8478 * The pre-image of the payment hash, allowing HTLC redemption
8480 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
8483 * The pre-image of the payment hash, allowing HTLC redemption
8485 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8488 * Constructs a new UpdateFulfillHTLC given each field
8490 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
8493 * Creates a copy of the UpdateFulfillHTLC
8495 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
8498 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
8500 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
8505 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
8510 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8515 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
8520 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
8523 * Creates a copy of the UpdateFailHTLC
8525 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
8528 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
8530 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
8535 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
8540 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8545 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
8550 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
8555 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
8560 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
8563 * Creates a copy of the UpdateFailMalformedHTLC
8565 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
8568 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
8570 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
8575 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
8580 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8583 * A signature on the commitment transaction
8585 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
8588 * A signature on the commitment transaction
8590 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
8593 * Signatures on the HTLC transactions
8595 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
8598 * Constructs a new CommitmentSigned given each field
8600 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
8603 * Creates a copy of the CommitmentSigned
8605 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
8608 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
8610 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
8615 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
8620 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8623 * The secret corresponding to the per-commitment point
8625 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
8628 * The secret corresponding to the per-commitment point
8630 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8633 * The next sender-broadcast commitment transaction's per-commitment point
8635 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
8638 * The next sender-broadcast commitment transaction's per-commitment point
8640 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8643 * Constructs a new RevokeAndACK given each field
8645 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);
8648 * Creates a copy of the RevokeAndACK
8650 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
8653 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
8655 void UpdateFee_free(struct LDKUpdateFee this_obj);
8660 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
8665 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8668 * Fee rate per 1000-weight of the transaction
8670 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
8673 * Fee rate per 1000-weight of the transaction
8675 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
8678 * Constructs a new UpdateFee given each field
8680 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
8683 * Creates a copy of the UpdateFee
8685 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
8688 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
8690 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
8693 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
8694 * belonging to the recipient
8696 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
8699 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
8700 * belonging to the recipient
8702 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8705 * The sender's per-commitment point for their current commitment transaction
8707 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
8710 * The sender's per-commitment point for their current commitment transaction
8712 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8715 * Constructs a new DataLossProtect given each field
8717 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
8720 * Creates a copy of the DataLossProtect
8722 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
8725 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
8727 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
8732 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
8737 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8740 * The next commitment number for the sender
8742 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
8745 * The next commitment number for the sender
8747 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
8750 * The next commitment number for the recipient
8752 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
8755 * The next commitment number for the recipient
8757 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
8760 * Creates a copy of the ChannelReestablish
8762 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
8765 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
8767 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
8772 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
8777 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8780 * The short channel ID
8782 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
8785 * The short channel ID
8787 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
8790 * A signature by the node key
8792 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
8795 * A signature by the node key
8797 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
8800 * A signature by the funding key
8802 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
8805 * A signature by the funding key
8807 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
8810 * Constructs a new AnnouncementSignatures given each field
8812 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);
8815 * Creates a copy of the AnnouncementSignatures
8817 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
8820 * Frees any resources used by the NetAddress
8822 void NetAddress_free(struct LDKNetAddress this_ptr);
8825 * Creates a copy of the NetAddress
8827 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
8830 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
8832 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
8835 * Read a Result from a byte array, created by Result_write
8837 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
8840 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
8842 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
8845 * The advertised features
8847 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
8850 * The advertised features
8852 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
8855 * A strictly monotonic announcement counter, with gaps allowed
8857 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
8860 * A strictly monotonic announcement counter, with gaps allowed
8862 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
8865 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
8868 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
8871 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
8874 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8877 * An RGB color for UI purposes
8879 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
8882 * An RGB color for UI purposes
8884 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
8887 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
8890 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
8893 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
8896 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8899 * List of addresses on which this node is reachable
8901 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
8904 * Creates a copy of the UnsignedNodeAnnouncement
8906 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
8909 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
8911 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
8914 * The signature by the node key
8916 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
8919 * The signature by the node key
8921 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
8924 * The actual content of the announcement
8926 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
8929 * The actual content of the announcement
8931 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
8934 * Constructs a new NodeAnnouncement given each field
8936 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
8939 * Creates a copy of the NodeAnnouncement
8941 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
8944 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
8946 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
8949 * The advertised channel features
8951 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
8954 * The advertised channel features
8956 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
8959 * The genesis hash of the blockchain where the channel is to be opened
8961 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
8964 * The genesis hash of the blockchain where the channel is to be opened
8966 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8969 * The short channel ID
8971 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
8974 * The short channel ID
8976 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
8979 * One of the two node_ids which are endpoints of this channel
8981 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
8984 * One of the two node_ids which are endpoints of this channel
8986 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8989 * The other of the two node_ids which are endpoints of this channel
8991 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
8994 * The other of the two node_ids which are endpoints of this channel
8996 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8999 * The funding key for the first node
9001 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
9004 * The funding key for the first node
9006 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
9009 * The funding key for the second node
9011 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
9014 * The funding key for the second node
9016 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
9019 * Creates a copy of the UnsignedChannelAnnouncement
9021 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
9024 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
9026 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
9029 * Authentication of the announcement by the first public node
9031 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
9034 * Authentication of the announcement by the first public node
9036 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
9039 * Authentication of the announcement by the second public node
9041 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
9044 * Authentication of the announcement by the second public node
9046 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
9049 * Proof of funding UTXO ownership by the first public node
9051 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
9054 * Proof of funding UTXO ownership by the first public node
9056 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
9059 * Proof of funding UTXO ownership by the second public node
9061 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
9064 * Proof of funding UTXO ownership by the second public node
9066 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
9069 * The actual announcement
9071 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
9074 * The actual announcement
9076 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
9079 * Constructs a new ChannelAnnouncement given each field
9081 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);
9084 * Creates a copy of the ChannelAnnouncement
9086 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
9089 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
9091 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
9094 * The genesis hash of the blockchain where the channel is to be opened
9096 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
9099 * The genesis hash of the blockchain where the channel is to be opened
9101 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
9104 * The short channel ID
9106 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
9109 * The short channel ID
9111 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
9114 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
9116 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
9119 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
9121 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
9126 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
9131 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
9134 * The number of blocks such that if:
9135 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
9136 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
9137 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
9138 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
9139 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
9140 * forwarding. Note that the HTLC sender is the one who originally sets this value when
9141 * constructing the route.
9143 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
9146 * The number of blocks such that if:
9147 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
9148 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
9149 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
9150 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
9151 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
9152 * forwarding. Note that the HTLC sender is the one who originally sets this value when
9153 * constructing the route.
9155 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
9158 * The minimum HTLC size incoming to sender, in milli-satoshi
9160 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
9163 * The minimum HTLC size incoming to sender, in milli-satoshi
9165 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
9168 * The base HTLC fee charged by sender, in milli-satoshi
9170 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
9173 * The base HTLC fee charged by sender, in milli-satoshi
9175 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
9178 * The amount to fee multiplier, in micro-satoshi
9180 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
9183 * The amount to fee multiplier, in micro-satoshi
9185 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
9188 * Creates a copy of the UnsignedChannelUpdate
9190 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
9193 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
9195 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
9198 * A signature of the channel update
9200 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
9203 * A signature of the channel update
9205 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
9208 * The actual channel update
9210 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
9213 * The actual channel update
9215 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
9218 * Constructs a new ChannelUpdate given each field
9220 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
9223 * Creates a copy of the ChannelUpdate
9225 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
9228 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
9230 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
9233 * The genesis hash of the blockchain being queried
9235 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
9238 * The genesis hash of the blockchain being queried
9240 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
9243 * The height of the first block for the channel UTXOs being queried
9245 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
9248 * The height of the first block for the channel UTXOs being queried
9250 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
9253 * The number of blocks to include in the query results
9255 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
9258 * The number of blocks to include in the query results
9260 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
9263 * Constructs a new QueryChannelRange given each field
9265 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
9268 * Creates a copy of the QueryChannelRange
9270 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
9273 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
9275 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
9278 * The genesis hash of the blockchain being queried
9280 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
9283 * The genesis hash of the blockchain being queried
9285 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
9288 * The height of the first block in the range of the reply
9290 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
9293 * The height of the first block in the range of the reply
9295 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
9298 * The number of blocks included in the range of the reply
9300 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
9303 * The number of blocks included in the range of the reply
9305 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
9308 * True when this is the final reply for a query
9310 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
9313 * True when this is the final reply for a query
9315 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
9318 * The short_channel_ids in the channel range
9320 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
9323 * Constructs a new ReplyChannelRange given each field
9325 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);
9328 * Creates a copy of the ReplyChannelRange
9330 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
9333 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
9335 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
9338 * The genesis hash of the blockchain being queried
9340 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
9343 * The genesis hash of the blockchain being queried
9345 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
9348 * The short_channel_ids that are being queried
9350 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
9353 * Constructs a new QueryShortChannelIds given each field
9355 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
9358 * Creates a copy of the QueryShortChannelIds
9360 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
9363 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
9365 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
9368 * The genesis hash of the blockchain that was queried
9370 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
9373 * The genesis hash of the blockchain that was queried
9375 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
9378 * Indicates if the query recipient maintains up-to-date channel
9379 * information for the chain_hash
9381 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
9384 * Indicates if the query recipient maintains up-to-date channel
9385 * information for the chain_hash
9387 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
9390 * Constructs a new ReplyShortChannelIdsEnd given each field
9392 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
9395 * Creates a copy of the ReplyShortChannelIdsEnd
9397 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
9400 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
9402 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
9405 * The genesis hash of the blockchain for channel and node information
9407 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
9410 * The genesis hash of the blockchain for channel and node information
9412 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
9415 * The starting unix timestamp
9417 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
9420 * The starting unix timestamp
9422 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
9425 * The range of information in seconds
9427 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
9430 * The range of information in seconds
9432 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
9435 * Constructs a new GossipTimestampFilter given each field
9437 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
9440 * Creates a copy of the GossipTimestampFilter
9442 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
9445 * Frees any resources used by the ErrorAction
9447 void ErrorAction_free(struct LDKErrorAction this_ptr);
9450 * Creates a copy of the ErrorAction
9452 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
9455 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
9457 void LightningError_free(struct LDKLightningError this_obj);
9460 * A human-readable message describing the error
9462 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
9465 * A human-readable message describing the error
9467 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
9470 * The action which should be taken against the offending peer.
9472 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
9475 * The action which should be taken against the offending peer.
9477 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
9480 * Constructs a new LightningError given each field
9482 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKCVec_u8Z err_arg, struct LDKErrorAction action_arg);
9485 * Creates a copy of the LightningError
9487 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
9490 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
9492 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
9495 * update_add_htlc messages which should be sent
9497 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
9500 * update_fulfill_htlc messages which should be sent
9502 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
9505 * update_fail_htlc messages which should be sent
9507 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
9510 * update_fail_malformed_htlc messages which should be sent
9512 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
9515 * An update_fee message which should be sent
9517 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
9520 * An update_fee message which should be sent
9522 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
9525 * Finally, the commitment_signed message which should be sent
9527 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
9530 * Finally, the commitment_signed message which should be sent
9532 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
9535 * Constructs a new CommitmentUpdate given each field
9537 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);
9540 * Creates a copy of the CommitmentUpdate
9542 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
9545 * Frees any resources used by the HTLCFailChannelUpdate
9547 void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr);
9550 * Creates a copy of the HTLCFailChannelUpdate
9552 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig);
9555 * Calls the free function if one is set
9557 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
9560 * Calls the free function if one is set
9562 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
9565 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
9567 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
9570 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
9572 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
9575 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
9577 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
9580 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
9582 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
9585 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
9587 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
9590 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
9592 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
9595 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
9597 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
9600 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
9602 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
9605 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
9607 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
9610 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
9612 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
9615 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
9617 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
9620 * Read a FundingCreated from a byte array, created by FundingCreated_write
9622 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
9625 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
9627 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
9630 * Read a FundingSigned from a byte array, created by FundingSigned_write
9632 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
9635 * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
9637 struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
9640 * Read a FundingLocked from a byte array, created by FundingLocked_write
9642 struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
9645 * Serialize the Init object into a byte array which can be read by Init_read
9647 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
9650 * Read a Init from a byte array, created by Init_write
9652 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
9655 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
9657 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
9660 * Read a OpenChannel from a byte array, created by OpenChannel_write
9662 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
9665 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
9667 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
9670 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
9672 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
9675 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
9677 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
9680 * Read a Shutdown from a byte array, created by Shutdown_write
9682 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
9685 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
9687 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
9690 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
9692 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
9695 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
9697 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
9700 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
9702 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
9705 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
9707 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
9710 * Read a UpdateFee from a byte array, created by UpdateFee_write
9712 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
9715 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
9717 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
9720 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
9722 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
9725 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
9727 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
9730 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
9732 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
9735 * Serialize the Ping object into a byte array which can be read by Ping_read
9737 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
9740 * Read a Ping from a byte array, created by Ping_write
9742 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
9745 * Serialize the Pong object into a byte array which can be read by Pong_read
9747 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
9750 * Read a Pong from a byte array, created by Pong_write
9752 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
9755 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
9757 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
9760 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
9762 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
9765 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
9767 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
9770 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
9772 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
9775 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
9777 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
9780 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
9782 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
9785 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
9787 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
9790 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
9792 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
9795 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
9797 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
9800 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
9802 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
9805 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
9807 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
9810 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
9812 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
9815 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
9817 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
9820 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
9822 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
9825 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
9827 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
9830 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
9832 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
9835 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
9837 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
9840 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
9842 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
9845 *\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
9847 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
9850 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
9852 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
9855 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
9857 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
9860 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
9862 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
9865 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
9867 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
9870 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
9872 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
9875 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
9877 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
9880 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
9882 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
9885 * Constructs a new IgnoringMessageHandler given each field
9887 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
9890 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
9891 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
9893 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
9896 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
9897 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
9899 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
9902 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
9904 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
9907 * Constructs a new ErroringMessageHandler
9909 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
9912 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
9913 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
9915 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
9918 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
9919 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
9921 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
9924 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
9926 void MessageHandler_free(struct LDKMessageHandler this_obj);
9929 * A message handler which handles messages specific to channels. Usually this is just a
9930 * ChannelManager object or a ErroringMessageHandler.
9932 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
9935 * A message handler which handles messages specific to channels. Usually this is just a
9936 * ChannelManager object or a ErroringMessageHandler.
9938 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
9941 * A message handler which handles messages updating our knowledge of the network channel
9942 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
9944 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
9947 * A message handler which handles messages updating our knowledge of the network channel
9948 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
9950 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
9953 * Constructs a new MessageHandler given each field
9955 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
9958 * Creates a copy of a SocketDescriptor
9960 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
9963 * Calls the free function if one is set
9965 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
9968 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
9970 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
9973 * Used to indicate that we probably can't make any future connections to this peer, implying
9974 * we should go ahead and force-close any channels we have with it.
9976 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
9979 * Used to indicate that we probably can't make any future connections to this peer, implying
9980 * we should go ahead and force-close any channels we have with it.
9982 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
9985 * Constructs a new PeerHandleError given each field
9987 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
9990 * Creates a copy of the PeerHandleError
9992 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
9995 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
9997 void PeerManager_free(struct LDKPeerManager this_obj);
10000 * Constructs a new PeerManager with the given message handlers and node_id secret key
10001 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
10002 * cryptographically secure random bytes.
10004 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);
10007 * Get the list of node ids for peers which have completed the initial handshake.
10009 * For outbound connections, this will be the same as the their_node_id parameter passed in to
10010 * new_outbound_connection, however entries will only appear once the initial handshake has
10011 * completed and we are sure the remote peer has the private key for the given node_id.
10013 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
10016 * Indicates a new outbound connection has been established to a node with the given node_id.
10017 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
10018 * descriptor but must disconnect the connection immediately.
10020 * Returns a small number of bytes to send to the remote node (currently always 50).
10022 * Panics if descriptor is duplicative with some other descriptor which has not yet had a
10023 * socket_disconnected().
10025 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);
10028 * Indicates a new inbound connection has been established.
10030 * May refuse the connection by returning an Err, but will never write bytes to the remote end
10031 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
10032 * call socket_disconnected for the new descriptor but must disconnect the connection
10035 * Panics if descriptor is duplicative with some other descriptor which has not yet had
10036 * socket_disconnected called.
10038 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor);
10041 * Indicates that there is room to write data to the given socket descriptor.
10043 * May return an Err to indicate that the connection should be closed.
10045 * Will most likely call send_data on the descriptor passed in (or the descriptor handed into
10046 * new_*\\_connection) before returning. Thus, be very careful with reentrancy issues! The
10047 * invariants around calling write_buffer_space_avail in case a write did not fully complete
10048 * must still hold - be ready to call write_buffer_space_avail again if a write call generated
10049 * here isn't sufficient! Panics if the descriptor was not previously registered in a
10050 * new_\\*_connection event.
10052 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
10055 * Indicates that data was read from the given socket descriptor.
10057 * May return an Err to indicate that the connection should be closed.
10059 * Will *not* call back into send_data on any descriptors to avoid reentrancy complexity.
10060 * Thus, however, you almost certainly want to call process_events() after any read_event to
10061 * generate send_data calls to handle responses.
10063 * If Ok(true) is returned, further read_events should not be triggered until a send_data call
10064 * on this file descriptor has resume_read set (preventing DoS issues in the send buffer).
10066 * Panics if the descriptor was not previously registered in a new_*_connection event.
10068 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);
10071 * Checks for any events generated by our handlers and processes them. Includes sending most
10072 * response messages as well as messages generated by calls to handler functions directly (eg
10073 * functions like ChannelManager::process_pending_htlc_forward or send_payment).
10075 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
10078 * Indicates that the given socket descriptor's connection is now closed.
10080 * This must only be called if the socket has been disconnected by the peer or your own
10081 * decision to disconnect it and must NOT be called in any case where other parts of this
10082 * library (eg PeerHandleError, explicit disconnect_socket calls) instruct you to disconnect
10085 * Panics if the descriptor was not previously registered in a successful new_*_connection event.
10087 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
10090 * Disconnect a peer given its node id.
10092 * Set no_connection_possible to true to prevent any further connection with this peer,
10093 * force-closing any channels we have with it.
10095 * If a peer is connected, this will call `disconnect_socket` on the descriptor for the peer,
10096 * so be careful about reentrancy issues.
10098 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
10101 * This function should be called roughly once every 30 seconds.
10102 * It will send pings to each peer and disconnect those which did not respond to the last round of pings.
10103 * Will most likely call send_data on all of the registered descriptors, thus, be very careful with reentrancy issues!
10105 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
10108 * Build the commitment secret from the seed and the commitment number
10110 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
10113 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
10114 * from the base secret and the per_commitment_point.
10116 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
10117 * generated (ie our own).
10119 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
10122 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
10123 * from the base point and the per_commitment_key. This is the public equivalent of
10124 * derive_private_key - using only public keys to derive a public key instead of private keys.
10126 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
10127 * generated (ie our own).
10129 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
10132 * Derives a per-commitment-transaction revocation key from its constituent parts.
10134 * Only the cheating participant owns a valid witness to propagate a revoked
10135 * commitment transaction, thus per_commitment_secret always come from cheater
10136 * and revocation_base_secret always come from punisher, which is the broadcaster
10137 * of the transaction spending with this key knowledge.
10139 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
10140 * generated (ie our own).
10142 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
10145 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
10146 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
10147 * public key instead of private keys.
10149 * Only the cheating participant owns a valid witness to propagate a revoked
10150 * commitment transaction, thus per_commitment_point always come from cheater
10151 * and revocation_base_point always come from punisher, which is the broadcaster
10152 * of the transaction spending with this key knowledge.
10154 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
10155 * generated (ie our own).
10157 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
10160 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
10162 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
10165 * The broadcaster's per-commitment public key which was used to derive the other keys.
10167 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
10170 * The broadcaster's per-commitment public key which was used to derive the other keys.
10172 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10175 * The revocation key which is used to allow the broadcaster of the commitment
10176 * transaction to provide their counterparty the ability to punish them if they broadcast
10179 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
10182 * The revocation key which is used to allow the broadcaster of the commitment
10183 * transaction to provide their counterparty the ability to punish them if they broadcast
10186 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10189 * Broadcaster's HTLC Key
10191 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
10194 * Broadcaster's HTLC Key
10196 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10199 * Countersignatory's HTLC Key
10201 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
10204 * Countersignatory's HTLC Key
10206 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10209 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
10211 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
10214 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
10216 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10219 * Constructs a new TxCreationKeys given each field
10221 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);
10224 * Creates a copy of the TxCreationKeys
10226 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
10229 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
10231 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
10234 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
10236 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
10239 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
10241 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
10244 * The public key which is used to sign all commitment transactions, as it appears in the
10245 * on-chain channel lock-in 2-of-2 multisig output.
10247 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
10250 * The public key which is used to sign all commitment transactions, as it appears in the
10251 * on-chain channel lock-in 2-of-2 multisig output.
10253 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10256 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
10257 * revocation keys. This is combined with the per-commitment-secret generated by the
10258 * counterparty to create a secret which the counterparty can reveal to revoke previous
10261 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
10264 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
10265 * revocation keys. This is combined with the per-commitment-secret generated by the
10266 * counterparty to create a secret which the counterparty can reveal to revoke previous
10269 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10272 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
10273 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
10274 * static across every commitment transaction.
10276 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
10279 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
10280 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
10281 * static across every commitment transaction.
10283 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10286 * The base point which is used (with derive_public_key) to derive a per-commitment payment
10287 * public key which receives non-HTLC-encumbered funds which are only available for spending
10288 * after some delay (or can be claimed via the revocation path).
10290 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
10293 * The base point which is used (with derive_public_key) to derive a per-commitment payment
10294 * public key which receives non-HTLC-encumbered funds which are only available for spending
10295 * after some delay (or can be claimed via the revocation path).
10297 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10300 * The base point which is used (with derive_public_key) to derive a per-commitment public key
10301 * which is used to encumber HTLC-in-flight outputs.
10303 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
10306 * The base point which is used (with derive_public_key) to derive a per-commitment public key
10307 * which is used to encumber HTLC-in-flight outputs.
10309 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10312 * Constructs a new ChannelPublicKeys given each field
10314 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);
10317 * Creates a copy of the ChannelPublicKeys
10319 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
10322 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
10324 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
10327 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
10329 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
10332 * Create per-state keys from channel base points and the per-commitment point.
10333 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
10335 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);
10338 * Generate per-state keys from channel static keys.
10339 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
10341 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);
10344 * A script either spendable by the revocation
10345 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
10346 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
10348 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
10351 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
10353 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
10356 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
10357 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
10358 * need to compare this value to whether the commitment transaction in question is that of
10359 * the counterparty or our own.
10361 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
10364 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
10365 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
10366 * need to compare this value to whether the commitment transaction in question is that of
10367 * the counterparty or our own.
10369 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
10372 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
10373 * this divided by 1000.
10375 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
10378 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
10379 * this divided by 1000.
10381 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
10384 * The CLTV lock-time at which this HTLC expires.
10386 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
10389 * The CLTV lock-time at which this HTLC expires.
10391 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
10394 * The hash of the preimage which unlocks this HTLC.
10396 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
10399 * The hash of the preimage which unlocks this HTLC.
10401 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10404 * The position within the commitment transactions' outputs. This may be None if the value is
10405 * below the dust limit (in which case no output appears in the commitment transaction and the
10406 * value is spent to additional transaction fees).
10408 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
10411 * The position within the commitment transactions' outputs. This may be None if the value is
10412 * below the dust limit (in which case no output appears in the commitment transaction and the
10413 * value is spent to additional transaction fees).
10415 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
10418 * Constructs a new HTLCOutputInCommitment given each field
10420 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);
10423 * Creates a copy of the HTLCOutputInCommitment
10425 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
10428 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
10430 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
10433 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
10435 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
10438 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
10439 * does not need to have its previous_output_index filled.
10441 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys);
10444 * Gets the redeemscript for a funding output from the two funding public keys.
10445 * Note that the order of funding public keys does not matter.
10447 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
10450 * panics if htlc.transaction_output_index.is_none()!
10452 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);
10455 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
10457 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
10460 * Holder public keys
10462 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
10465 * Holder public keys
10467 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
10470 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
10472 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
10475 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
10477 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
10480 * Whether the holder is the initiator of this channel.
10481 * This is an input to the commitment number obscure factor computation.
10483 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
10486 * Whether the holder is the initiator of this channel.
10487 * This is an input to the commitment number obscure factor computation.
10489 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
10492 * The late-bound counterparty channel transaction parameters.
10493 * These parameters are populated at the point in the protocol where the counterparty provides them.
10495 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
10498 * The late-bound counterparty channel transaction parameters.
10499 * These parameters are populated at the point in the protocol where the counterparty provides them.
10501 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
10504 * The late-bound funding outpoint
10506 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
10509 * The late-bound funding outpoint
10511 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
10514 * Constructs a new ChannelTransactionParameters given each field
10516 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);
10519 * Creates a copy of the ChannelTransactionParameters
10521 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
10524 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
10526 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
10529 * Counter-party public keys
10531 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
10534 * Counter-party public keys
10536 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
10539 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
10541 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
10544 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
10546 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
10549 * Constructs a new CounterpartyChannelTransactionParameters given each field
10551 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
10554 * Creates a copy of the CounterpartyChannelTransactionParameters
10556 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
10559 * Whether the late bound parameters are populated.
10561 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
10564 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
10565 * given that the holder is the broadcaster.
10567 * self.is_populated() must be true before calling this function.
10569 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
10572 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
10573 * given that the counterparty is the broadcaster.
10575 * self.is_populated() must be true before calling this function.
10577 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
10580 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
10582 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
10585 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
10587 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
10590 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
10592 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
10595 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
10597 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
10600 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
10602 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
10605 * Get the channel pubkeys for the broadcaster
10607 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
10610 * Get the channel pubkeys for the countersignatory
10612 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
10615 * Get the contest delay applicable to the transactions.
10616 * Note that the contest delay was selected by the countersignatory.
10618 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
10621 * Whether the channel is outbound from the broadcaster.
10623 * The boolean representing the side that initiated the channel is
10624 * an input to the commitment number obscure factor computation.
10626 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
10629 * The funding outpoint
10631 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
10634 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
10636 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
10639 * Our counterparty's signature for the transaction
10641 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
10644 * Our counterparty's signature for the transaction
10646 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
10649 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
10651 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
10654 * Creates a copy of the HolderCommitmentTransaction
10656 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
10659 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
10661 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
10664 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
10666 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
10669 * Create a new holder transaction with the given counterparty signatures.
10670 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
10672 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);
10675 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
10677 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
10680 * The commitment transaction
10682 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
10685 * The commitment transaction
10687 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
10690 * The txid for the commitment transaction.
10692 * This is provided as a performance optimization, instead of calling transaction.txid()
10695 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
10698 * The txid for the commitment transaction.
10700 * This is provided as a performance optimization, instead of calling transaction.txid()
10703 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10706 * Constructs a new BuiltCommitmentTransaction given each field
10708 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
10711 * Creates a copy of the BuiltCommitmentTransaction
10713 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
10716 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
10718 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
10721 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
10723 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
10726 * Get the SIGHASH_ALL sighash value of the transaction.
10728 * This can be used to verify a signature.
10730 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);
10733 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
10734 * because we are about to broadcast a holder transaction.
10736 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);
10739 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
10741 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
10744 * Creates a copy of the CommitmentTransaction
10746 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
10749 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
10751 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
10754 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
10756 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
10759 * The backwards-counting commitment number
10761 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
10764 * The value to be sent to the broadcaster
10766 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
10769 * The value to be sent to the counterparty
10771 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
10774 * The feerate paid per 1000-weight-unit in this commitment transaction.
10776 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
10779 * Trust our pre-built transaction and derived transaction creation public keys.
10781 * Applies a wrapper which allows access to these fields.
10783 * This should only be used if you fully trust the builder of this object. It should not
10784 *\tbe used by an external signer - instead use the verify function.
10786 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
10789 * Verify our pre-built transaction and derived transaction creation public keys.
10791 * Applies a wrapper which allows access to these fields.
10793 * An external validating signer must call this method before signing
10794 * or using the built transaction.
10796 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);
10799 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
10801 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
10804 * The transaction ID of the built Bitcoin transaction
10806 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
10809 * The pre-built Bitcoin commitment transaction
10811 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
10814 * The pre-calculated transaction creation public keys.
10816 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
10819 * Get a signature for each HTLC which was included in the commitment transaction (ie for
10820 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
10822 * The returned Vec has one entry for each HTLC, and in the same order.
10824 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);
10827 * Get the transaction number obscure factor
10829 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
10832 * Creates a copy of the InitFeatures
10834 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
10837 * Creates a copy of the NodeFeatures
10839 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
10842 * Creates a copy of the ChannelFeatures
10844 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
10847 * Creates a copy of the InvoiceFeatures
10849 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
10852 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
10854 void InitFeatures_free(struct LDKInitFeatures this_obj);
10857 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
10859 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
10862 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
10864 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
10867 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
10869 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
10872 * Create a blank Features with no features set
10874 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
10877 * Creates a Features with the bits set which are known by the implementation
10879 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
10882 * Create a blank Features with no features set
10884 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
10887 * Creates a Features with the bits set which are known by the implementation
10889 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
10892 * Create a blank Features with no features set
10894 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
10897 * Creates a Features with the bits set which are known by the implementation
10899 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
10902 * Create a blank Features with no features set
10904 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
10907 * Creates a Features with the bits set which are known by the implementation
10909 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
10912 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
10914 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
10917 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
10919 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
10922 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
10924 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
10927 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
10929 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
10932 * Read a InitFeatures from a byte array, created by InitFeatures_write
10934 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
10937 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
10939 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
10942 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
10944 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
10947 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
10949 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
10952 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
10954 void RouteHop_free(struct LDKRouteHop this_obj);
10957 * The node_id of the node at this hop.
10959 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
10962 * The node_id of the node at this hop.
10964 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10967 * The node_announcement features of the node at this hop. For the last hop, these may be
10968 * amended to match the features present in the invoice this node generated.
10970 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
10973 * The node_announcement features of the node at this hop. For the last hop, these may be
10974 * amended to match the features present in the invoice this node generated.
10976 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
10979 * The channel that should be used from the previous hop to reach this node.
10981 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
10984 * The channel that should be used from the previous hop to reach this node.
10986 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
10989 * The channel_announcement features of the channel that should be used from the previous hop
10990 * to reach this node.
10992 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
10995 * The channel_announcement features of the channel that should be used from the previous hop
10996 * to reach this node.
10998 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
11001 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
11002 * For the last hop, this should be the full value of the payment (might be more than
11003 * requested if we had to match htlc_minimum_msat).
11005 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
11008 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
11009 * For the last hop, this should be the full value of the payment (might be more than
11010 * requested if we had to match htlc_minimum_msat).
11012 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
11015 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
11016 * expected at the destination, in excess of the current block height.
11018 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
11021 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
11022 * expected at the destination, in excess of the current block height.
11024 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
11027 * Constructs a new RouteHop given each field
11029 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);
11032 * Creates a copy of the RouteHop
11034 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
11037 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
11039 void Route_free(struct LDKRoute this_obj);
11042 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
11043 * last RouteHop in each path must be the same.
11044 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
11045 * destination. Thus, this must always be at least length one. While the maximum length of any
11046 * given path is variable, keeping the length of any path to less than 20 should currently
11047 * ensure it is viable.
11049 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
11052 * Constructs a new Route given each field
11054 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
11057 * Creates a copy of the Route
11059 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
11062 * Serialize the Route object into a byte array which can be read by Route_read
11064 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
11067 * Read a Route from a byte array, created by Route_write
11069 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
11072 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
11074 void RouteHint_free(struct LDKRouteHint this_obj);
11077 * The node_id of the non-target end of the route
11079 struct LDKPublicKey RouteHint_get_src_node_id(const struct LDKRouteHint *NONNULL_PTR this_ptr);
11082 * The node_id of the non-target end of the route
11084 void RouteHint_set_src_node_id(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11087 * The short_channel_id of this channel
11089 uint64_t RouteHint_get_short_channel_id(const struct LDKRouteHint *NONNULL_PTR this_ptr);
11092 * The short_channel_id of this channel
11094 void RouteHint_set_short_channel_id(struct LDKRouteHint *NONNULL_PTR this_ptr, uint64_t val);
11097 * The fees which must be paid to use this channel
11099 struct LDKRoutingFees RouteHint_get_fees(const struct LDKRouteHint *NONNULL_PTR this_ptr);
11102 * The fees which must be paid to use this channel
11104 void RouteHint_set_fees(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
11107 * The difference in CLTV values between this node and the next node.
11109 uint16_t RouteHint_get_cltv_expiry_delta(const struct LDKRouteHint *NONNULL_PTR this_ptr);
11112 * The difference in CLTV values between this node and the next node.
11114 void RouteHint_set_cltv_expiry_delta(struct LDKRouteHint *NONNULL_PTR this_ptr, uint16_t val);
11117 * The minimum value, in msat, which must be relayed to the next hop.
11119 struct LDKCOption_u64Z RouteHint_get_htlc_minimum_msat(const struct LDKRouteHint *NONNULL_PTR this_ptr);
11122 * The minimum value, in msat, which must be relayed to the next hop.
11124 void RouteHint_set_htlc_minimum_msat(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
11127 * The maximum value in msat available for routing with a single HTLC.
11129 struct LDKCOption_u64Z RouteHint_get_htlc_maximum_msat(const struct LDKRouteHint *NONNULL_PTR this_ptr);
11132 * The maximum value in msat available for routing with a single HTLC.
11134 void RouteHint_set_htlc_maximum_msat(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
11137 * Constructs a new RouteHint given each field
11139 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);
11142 * Creates a copy of the RouteHint
11144 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
11147 * Gets a route from us (payer) to the given target node (payee).
11149 * If the payee provided features in their invoice, they should be provided via payee_features.
11150 * Without this, MPP will only be used if the payee's features are available in the network graph.
11152 * Extra routing hops between known nodes and the target will be used if they are included in
11155 * If some channels aren't announced, it may be useful to fill in a first_hops with the
11156 * results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
11157 * view of our local channels (from net_graph_msg_handler) will be ignored, and only those
11158 * in first_hops will be used.
11160 * Panics if first_hops contains channels without short_channel_ids
11161 * (ChannelManager::list_usable_channels will never include such channels).
11163 * The fees on channels from us to next-hops are ignored (as they are assumed to all be
11164 * equal), however the enabled/disabled bit on such channels as well as the
11165 * htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
11167 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);
11170 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
11172 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
11175 * Creates a copy of the NetworkGraph
11177 struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
11180 * Frees any resources used by the LockedNetworkGraph, if is_owned is set and inner is non-NULL.
11182 void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj);
11185 * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
11187 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
11190 * Creates a new tracker of the actual state of the network of channels and nodes,
11191 * assuming a fresh network graph.
11192 * Chain monitor is used to make sure announced channels exist on-chain,
11193 * channel data is correct, and that the announcement is signed with
11194 * channel owners' keys.
11196 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger);
11199 * Creates a new tracker of the actual state of the network of channels and nodes,
11200 * assuming an existing Network Graph.
11202 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph);
11205 * Adds a provider used to check new announcements. Does not affect
11206 * existing announcements unless they are updated.
11207 * Add, update or remove the provider would replace the current one.
11209 void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKAccess *chain_access);
11212 * Take a read lock on the network_graph and return it in the C-bindings
11213 * newtype helper. This is likely only useful when called via the C
11214 * bindings as you can call `self.network_graph.read().unwrap()` in Rust
11217 MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
11220 * Get a reference to the NetworkGraph which this read-lock contains.
11222 MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg);
11225 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
11226 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
11228 struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
11231 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
11232 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
11234 struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
11237 * Frees any resources used by the DirectionalChannelInfo, if is_owned is set and inner is non-NULL.
11239 void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_obj);
11242 * When the last update to the channel direction was issued.
11243 * Value is opaque, as set in the announcement.
11245 uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
11248 * When the last update to the channel direction was issued.
11249 * Value is opaque, as set in the announcement.
11251 void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val);
11254 * Whether the channel can be currently used for payments (in this one direction).
11256 bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
11259 * Whether the channel can be currently used for payments (in this one direction).
11261 void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, bool val);
11264 * The difference in CLTV values that you must have when routing through this channel.
11266 uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
11269 * The difference in CLTV values that you must have when routing through this channel.
11271 void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint16_t val);
11274 * The minimum value, which must be relayed to the next hop via the channel
11276 uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
11279 * The minimum value, which must be relayed to the next hop via the channel
11281 void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val);
11284 * The maximum value which may be relayed to the next hop via the channel.
11286 struct LDKCOption_u64Z DirectionalChannelInfo_get_htlc_maximum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
11289 * The maximum value which may be relayed to the next hop via the channel.
11291 void DirectionalChannelInfo_set_htlc_maximum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
11294 * Fees charged when the channel is used for routing
11296 struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
11299 * Fees charged when the channel is used for routing
11301 void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
11304 * Most recent update for the channel received from the network
11305 * Mostly redundant with the data we store in fields explicitly.
11306 * Everything else is useful only for sending out for initial routing sync.
11307 * Not stored if contains excess data to prevent DoS.
11309 struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
11312 * Most recent update for the channel received from the network
11313 * Mostly redundant with the data we store in fields explicitly.
11314 * Everything else is useful only for sending out for initial routing sync.
11315 * Not stored if contains excess data to prevent DoS.
11317 void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
11320 * Constructs a new DirectionalChannelInfo given each field
11322 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);
11325 * Creates a copy of the DirectionalChannelInfo
11327 struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig);
11330 * Serialize the DirectionalChannelInfo object into a byte array which can be read by DirectionalChannelInfo_read
11332 struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj);
11335 * Read a DirectionalChannelInfo from a byte array, created by DirectionalChannelInfo_write
11337 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser);
11340 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
11342 void ChannelInfo_free(struct LDKChannelInfo this_obj);
11345 * Protocol features of a channel communicated during its announcement
11347 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
11350 * Protocol features of a channel communicated during its announcement
11352 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
11355 * Source node of the first direction of a channel
11357 struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
11360 * Source node of the first direction of a channel
11362 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11365 * Details about the first direction of a channel
11367 struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
11370 * Details about the first direction of a channel
11372 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
11375 * Source node of the second direction of a channel
11377 struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
11380 * Source node of the second direction of a channel
11382 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11385 * Details about the second direction of a channel
11387 struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
11390 * Details about the second direction of a channel
11392 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
11395 * The channel capacity as seen on-chain, if chain lookup is available.
11397 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
11400 * The channel capacity as seen on-chain, if chain lookup is available.
11402 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
11405 * An initial announcement of the channel
11406 * Mostly redundant with the data we store in fields explicitly.
11407 * Everything else is useful only for sending out for initial routing sync.
11408 * Not stored if contains excess data to prevent DoS.
11410 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
11413 * An initial announcement of the channel
11414 * Mostly redundant with the data we store in fields explicitly.
11415 * Everything else is useful only for sending out for initial routing sync.
11416 * Not stored if contains excess data to prevent DoS.
11418 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
11421 * Constructs a new ChannelInfo given each field
11423 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);
11426 * Creates a copy of the ChannelInfo
11428 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
11431 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
11433 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
11436 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
11438 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
11441 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
11443 void RoutingFees_free(struct LDKRoutingFees this_obj);
11446 * Flat routing fee in satoshis
11448 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
11451 * Flat routing fee in satoshis
11453 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
11456 * Liquidity-based routing fee in millionths of a routed amount.
11457 * In other words, 10000 is 1%.
11459 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
11462 * Liquidity-based routing fee in millionths of a routed amount.
11463 * In other words, 10000 is 1%.
11465 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
11468 * Constructs a new RoutingFees given each field
11470 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
11473 * Creates a copy of the RoutingFees
11475 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
11478 * Read a RoutingFees from a byte array, created by RoutingFees_write
11480 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
11483 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
11485 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
11488 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
11490 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
11493 * Protocol features the node announced support for
11495 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
11498 * Protocol features the node announced support for
11500 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
11503 * When the last known update to the node state was issued.
11504 * Value is opaque, as set in the announcement.
11506 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
11509 * When the last known update to the node state was issued.
11510 * Value is opaque, as set in the announcement.
11512 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
11515 * Color assigned to the node
11517 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
11520 * Color assigned to the node
11522 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
11525 * Moniker assigned to the node.
11526 * May be invalid or malicious (eg control chars),
11527 * should not be exposed to the user.
11529 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
11532 * Moniker assigned to the node.
11533 * May be invalid or malicious (eg control chars),
11534 * should not be exposed to the user.
11536 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11539 * Internet-level addresses via which one can connect to the node
11541 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
11544 * An initial announcement of the node
11545 * Mostly redundant with the data we store in fields explicitly.
11546 * Everything else is useful only for sending out for initial routing sync.
11547 * Not stored if contains excess data to prevent DoS.
11549 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
11552 * An initial announcement of the node
11553 * Mostly redundant with the data we store in fields explicitly.
11554 * Everything else is useful only for sending out for initial routing sync.
11555 * Not stored if contains excess data to prevent DoS.
11557 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
11560 * Constructs a new NodeAnnouncementInfo given each field
11562 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);
11565 * Creates a copy of the NodeAnnouncementInfo
11567 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
11570 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
11572 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
11575 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
11577 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
11580 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
11582 void NodeInfo_free(struct LDKNodeInfo this_obj);
11585 * All valid channels a node has announced
11587 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
11590 * Lowest fees enabling routing via any of the enabled, known channels to a node.
11591 * The two fields (flat and proportional fee) are independent,
11592 * meaning they don't have to refer to the same channel.
11594 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
11597 * Lowest fees enabling routing via any of the enabled, known channels to a node.
11598 * The two fields (flat and proportional fee) are independent,
11599 * meaning they don't have to refer to the same channel.
11601 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
11604 * More information about a node from node_announcement.
11605 * Optional because we store a Node entry after learning about it from
11606 * a channel announcement, but before receiving a node announcement.
11608 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
11611 * More information about a node from node_announcement.
11612 * Optional because we store a Node entry after learning about it from
11613 * a channel announcement, but before receiving a node announcement.
11615 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
11618 * Constructs a new NodeInfo given each field
11620 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
11623 * Creates a copy of the NodeInfo
11625 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
11628 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
11630 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
11633 * Read a NodeInfo from a byte array, created by NodeInfo_write
11635 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
11638 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
11640 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
11643 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
11645 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
11648 * Creates a new, empty, network graph.
11650 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
11653 * For an already known node (from channel announcements), update its stored properties from a
11654 * given node announcement.
11656 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
11657 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
11658 * routing messages from a source using a protocol other than the lightning P2P protocol.
11660 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
11663 * For an already known node (from channel announcements), update its stored properties from a
11664 * given node announcement without verifying the associated signatures. Because we aren't
11665 * given the associated signatures here we cannot relay the node announcement to any of our
11668 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
11671 * Store or update channel info from a channel announcement.
11673 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
11674 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
11675 * routing messages from a source using a protocol other than the lightning P2P protocol.
11677 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
11678 * the corresponding UTXO exists on chain and is correctly-formatted.
11680 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);
11683 * Store or update channel info from a channel announcement without verifying the associated
11684 * signatures. Because we aren't given the associated signatures here we cannot relay the
11685 * channel announcement to any of our peers.
11687 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
11688 * the corresponding UTXO exists on chain and is correctly-formatted.
11690 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);
11693 * Close a channel if a corresponding HTLC fail was sent.
11694 * If permanent, removes a channel from the local storage.
11695 * May cause the removal of nodes too, if this was their last channel.
11696 * If not permanent, makes channels unavailable for routing.
11698 void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
11701 * For an already known (from announcement) channel, update info about one of the directions
11704 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
11705 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
11706 * routing messages from a source using a protocol other than the lightning P2P protocol.
11708 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
11711 * For an already known (from announcement) channel, update info about one of the directions
11712 * of the channel without verifying the associated signatures. Because we aren't given the
11713 * associated signatures here we cannot relay the channel update to any of our peers.
11715 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
11717 /* Text to put at the end of the generated file */