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 void COption_u32Z_free(struct LDKCOption_u32Z _res);
5099 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
5101 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
5103 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
5105 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
5107 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
5109 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
5111 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
5113 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
5115 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
5117 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
5119 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
5121 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
5123 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
5125 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
5127 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
5129 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
5131 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
5133 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
5135 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
5137 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
5139 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
5141 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
5143 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
5145 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
5147 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
5149 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
5151 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
5153 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
5155 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
5157 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
5159 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
5161 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
5163 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
5165 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
5167 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
5169 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
5171 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
5173 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
5175 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
5177 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
5179 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
5181 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
5183 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
5185 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
5187 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
5189 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
5191 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
5193 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
5195 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
5197 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
5199 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
5201 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
5203 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
5205 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
5207 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
5209 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
5211 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
5213 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
5215 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
5217 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
5219 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
5221 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
5223 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
5225 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
5227 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
5229 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
5231 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
5233 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
5235 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
5237 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
5239 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
5241 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
5243 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
5245 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
5247 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
5249 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
5251 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
5253 void COption_u64Z_free(struct LDKCOption_u64Z _res);
5255 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
5257 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o);
5259 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
5261 void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res);
5263 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig);
5265 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
5267 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
5269 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
5271 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
5273 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
5275 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
5277 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
5279 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
5281 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
5283 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
5285 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
5287 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
5289 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
5291 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
5293 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
5295 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
5297 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
5299 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
5301 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
5303 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
5305 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
5307 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
5309 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
5311 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
5313 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
5315 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
5317 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
5319 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
5321 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
5323 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
5325 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
5327 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
5329 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
5331 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
5333 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
5335 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
5337 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
5339 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
5341 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
5343 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
5345 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
5347 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
5349 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
5351 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
5353 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e);
5355 void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res);
5357 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig);
5359 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
5361 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
5363 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
5365 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
5367 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
5369 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
5371 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
5373 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
5375 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
5377 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
5379 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
5381 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
5383 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
5385 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
5387 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
5389 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
5391 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
5393 void CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res);
5395 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
5397 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
5399 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
5401 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
5403 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
5405 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
5407 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
5409 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
5411 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
5413 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
5415 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
5417 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
5419 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
5421 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
5423 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
5425 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
5427 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
5429 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
5431 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
5433 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
5435 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
5437 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
5439 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
5441 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
5443 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
5445 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
5447 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
5449 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
5451 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
5453 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
5455 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
5457 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
5459 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
5461 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
5463 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
5465 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
5467 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
5469 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
5471 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
5473 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
5475 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
5477 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
5479 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
5481 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
5483 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
5485 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
5487 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
5489 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
5491 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
5493 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
5495 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
5497 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
5499 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
5501 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
5503 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
5505 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
5507 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
5509 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
5511 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
5513 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
5515 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
5517 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
5519 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
5521 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
5523 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
5525 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
5527 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
5529 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
5531 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
5533 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
5535 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
5537 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
5539 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
5541 void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
5543 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
5545 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
5547 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
5549 void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
5551 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
5553 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
5555 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
5557 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
5559 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
5561 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
5563 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
5565 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
5567 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
5569 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
5571 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
5573 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
5575 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
5577 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
5579 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
5581 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
5583 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
5585 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
5587 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
5589 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
5591 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
5593 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
5595 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
5597 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
5599 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
5601 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
5603 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
5605 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
5607 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
5609 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
5611 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
5613 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
5615 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
5617 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o);
5619 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e);
5621 void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res);
5623 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig);
5625 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
5627 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
5629 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
5631 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
5633 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
5635 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
5637 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
5639 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
5641 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
5643 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
5645 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
5647 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
5649 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
5651 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
5653 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
5655 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
5657 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
5659 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
5661 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
5663 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
5665 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
5667 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
5669 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
5671 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
5673 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
5675 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
5677 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
5679 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
5681 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
5683 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
5685 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
5687 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
5689 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
5691 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
5693 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
5695 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
5697 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
5699 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
5701 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
5703 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
5705 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
5707 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
5709 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
5711 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
5713 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
5715 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
5717 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
5719 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
5721 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
5723 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
5725 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
5727 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
5729 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
5731 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
5733 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
5735 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
5737 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
5739 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
5741 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
5743 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
5745 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
5747 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
5749 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
5751 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
5753 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
5755 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
5757 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
5759 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
5761 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
5763 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
5765 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
5767 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
5769 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
5771 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
5773 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
5775 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
5777 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
5779 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
5781 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
5783 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
5785 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
5787 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
5789 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
5791 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
5793 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
5795 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
5797 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
5799 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
5801 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
5803 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
5805 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
5807 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
5810 * Frees any resources used by the Event
5812 void Event_free(struct LDKEvent this_ptr);
5815 * Creates a copy of the Event
5817 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
5820 * Serialize the Event object into a byte array which can be read by Event_read
5822 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
5825 * Frees any resources used by the MessageSendEvent
5827 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
5830 * Creates a copy of the MessageSendEvent
5832 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
5835 * Calls the free function if one is set
5837 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
5840 * Calls the free function if one is set
5842 void EventsProvider_free(struct LDKEventsProvider this_ptr);
5845 * Frees any resources used by the APIError
5847 void APIError_free(struct LDKAPIError this_ptr);
5850 * Creates a copy of the APIError
5852 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
5855 * Creates a copy of the Level
5857 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
5860 * Returns the most verbose logging level.
5862 MUST_USE_RES enum LDKLevel Level_max(void);
5865 * Calls the free function if one is set
5867 void Logger_free(struct LDKLogger this_ptr);
5870 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
5872 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
5875 * Confirmations we will wait for before considering the channel locked in.
5876 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
5877 * equivalent limit applied to outbound channels).
5881 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
5884 * Confirmations we will wait for before considering the channel locked in.
5885 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
5886 * equivalent limit applied to outbound channels).
5890 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
5893 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
5894 * the number of blocks we have to punish our counterparty if they broadcast a revoked
5897 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
5898 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
5899 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
5900 * possibly with time in between to RBF the spending transaction).
5902 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
5903 * case of an honest unilateral channel close, which implicitly decrease the economic value of
5906 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
5907 * can tweak config to ask for more security, not less.
5909 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
5912 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
5913 * the number of blocks we have to punish our counterparty if they broadcast a revoked
5916 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
5917 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
5918 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
5919 * possibly with time in between to RBF the spending transaction).
5921 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
5922 * case of an honest unilateral channel close, which implicitly decrease the economic value of
5925 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
5926 * can tweak config to ask for more security, not less.
5928 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
5931 * Set to the smallest value HTLC we will accept to process.
5933 * This value is sent to our counterparty on channel-open and we close the channel any time
5934 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
5936 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
5939 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
5942 * Set to the smallest value HTLC we will accept to process.
5944 * This value is sent to our counterparty on channel-open and we close the channel any time
5945 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
5947 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
5950 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
5953 * Constructs a new ChannelHandshakeConfig given each field
5955 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);
5958 * Creates a copy of the ChannelHandshakeConfig
5960 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
5963 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
5965 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
5968 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
5970 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
5973 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
5974 * only applies to inbound channels.
5978 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
5981 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
5982 * only applies to inbound channels.
5986 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
5989 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
5990 * you to limit the maximum minimum-size they can require.
5992 * Default value: u64::max_value.
5994 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
5997 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
5998 * you to limit the maximum minimum-size they can require.
6000 * Default value: u64::max_value.
6002 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
6005 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
6006 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
6010 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
6013 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
6014 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
6018 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
6021 * The remote node will require we keep a certain amount in direct payment to ourselves at all
6022 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
6023 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
6025 * Default value: u64::max_value.
6027 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
6030 * The remote node will require we keep a certain amount in direct payment to ourselves at all
6031 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
6032 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
6034 * Default value: u64::max_value.
6036 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
6039 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
6040 * time. This allows you to set a minimum such value.
6044 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
6047 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
6048 * time. This allows you to set a minimum such value.
6052 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
6055 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
6056 * required to always be higher than this value so this only applies to HTLC outputs (and
6057 * potentially to-self outputs before any payments have been made).
6058 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
6059 * This setting allows you to set a minimum dust limit for their commitment transactions,
6060 * reflecting the reality that tiny outputs are not considered standard transactions and will
6061 * not propagate through the Bitcoin network.
6063 * Default value: 546, the current dust limit on the Bitcoin network.
6065 uint64_t ChannelHandshakeLimits_get_min_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
6068 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
6069 * required to always be higher than this value so this only applies to HTLC outputs (and
6070 * potentially to-self outputs before any payments have been made).
6071 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
6072 * This setting allows you to set a minimum dust limit for their commitment transactions,
6073 * reflecting the reality that tiny outputs are not considered standard transactions and will
6074 * not propagate through the Bitcoin network.
6076 * Default value: 546, the current dust limit on the Bitcoin network.
6078 void ChannelHandshakeLimits_set_min_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
6081 * Maximum allowed threshold above which outputs will not be generated in their commitment
6083 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
6085 * Default value: u64::max_value.
6087 uint64_t ChannelHandshakeLimits_get_max_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
6090 * Maximum allowed threshold above which outputs will not be generated in their commitment
6092 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
6094 * Default value: u64::max_value.
6096 void ChannelHandshakeLimits_set_max_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
6099 * Before a channel is usable the funding transaction will need to be confirmed by at least a
6100 * certain number of blocks, specified by the node which is not the funder (as the funder can
6101 * assume they aren't going to double-spend themselves).
6102 * This config allows you to set a limit on the maximum amount of time to wait.
6104 * Default value: 144, or roughly one day and only applies to outbound channels.
6106 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
6109 * Before a channel is usable the funding transaction will need to be confirmed by at least a
6110 * certain number of blocks, specified by the node which is not the funder (as the funder can
6111 * assume they aren't going to double-spend themselves).
6112 * This config allows you to set a limit on the maximum amount of time to wait.
6114 * Default value: 144, or roughly one day and only applies to outbound channels.
6116 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
6119 * Set to force the incoming channel to match our announced channel preference in
6122 * Default value: true, to make the default that no announced channels are possible (which is
6123 * appropriate for any nodes which are not online very reliably).
6125 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
6128 * Set to force the incoming channel to match our announced channel preference in
6131 * Default value: true, to make the default that no announced channels are possible (which is
6132 * appropriate for any nodes which are not online very reliably).
6134 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
6137 * Set to the amount of time we're willing to wait to claim money back to us.
6139 * Not checking this value would be a security issue, as our peer would be able to set it to
6140 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
6142 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
6143 * reduce the loss of having useless locked funds (if your peer accepts)
6145 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
6148 * Set to the amount of time we're willing to wait to claim money back to us.
6150 * Not checking this value would be a security issue, as our peer would be able to set it to
6151 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
6153 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
6154 * reduce the loss of having useless locked funds (if your peer accepts)
6156 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
6159 * Constructs a new ChannelHandshakeLimits given each field
6161 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);
6164 * Creates a copy of the ChannelHandshakeLimits
6166 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
6169 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
6171 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
6174 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
6176 void ChannelConfig_free(struct LDKChannelConfig this_obj);
6179 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
6180 * This may be allowed to change at runtime in a later update, however doing so must result in
6181 * update messages sent to notify all nodes of our updated relay fee.
6185 uint32_t ChannelConfig_get_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
6188 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
6189 * This may be allowed to change at runtime in a later update, however doing so must result in
6190 * update messages sent to notify all nodes of our updated relay fee.
6194 void ChannelConfig_set_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
6197 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
6198 * the channel this config applies to.
6200 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
6201 * HTLC balance when a channel appears on-chain whereas
6202 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
6203 * (non-HTLC-encumbered) balance.
6205 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
6206 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
6207 * commitment transaction at least once per this many blocks (minus some margin to allow us
6208 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
6209 * the spending transaction).
6211 * Default value: 72 (12 hours at an average of 6 blocks/hour).
6212 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
6213 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
6215 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
6217 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
6220 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
6221 * the channel this config applies to.
6223 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
6224 * HTLC balance when a channel appears on-chain whereas
6225 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
6226 * (non-HTLC-encumbered) balance.
6228 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
6229 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
6230 * commitment transaction at least once per this many blocks (minus some margin to allow us
6231 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
6232 * the spending transaction).
6234 * Default value: 72 (12 hours at an average of 6 blocks/hour).
6235 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
6236 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
6238 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
6240 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
6243 * Set to announce the channel publicly and notify all nodes that they can route via this
6246 * This should only be set to true for nodes which expect to be online reliably.
6248 * As the node which funds a channel picks this value this will only apply for new outbound
6249 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
6251 * This cannot be changed after the initial channel handshake.
6253 * Default value: false.
6255 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
6258 * Set to announce the channel publicly and notify all nodes that they can route via this
6261 * This should only be set to true for nodes which expect to be online reliably.
6263 * As the node which funds a channel picks this value this will only apply for new outbound
6264 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
6266 * This cannot be changed after the initial channel handshake.
6268 * Default value: false.
6270 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
6273 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
6274 * supports it, they will then enforce the mutual-close output to us matches what we provided
6275 * at intialization, preventing us from closing to an alternate pubkey.
6277 * This is set to true by default to provide a slight increase in security, though ultimately
6278 * any attacker who is able to take control of a channel can just as easily send the funds via
6279 * lightning payments, so we never require that our counterparties support this option.
6281 * This cannot be changed after a channel has been initialized.
6283 * Default value: true.
6285 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
6288 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
6289 * supports it, they will then enforce the mutual-close output to us matches what we provided
6290 * at intialization, preventing us from closing to an alternate pubkey.
6292 * This is set to true by default to provide a slight increase in security, though ultimately
6293 * any attacker who is able to take control of a channel can just as easily send the funds via
6294 * lightning payments, so we never require that our counterparties support this option.
6296 * This cannot be changed after a channel has been initialized.
6298 * Default value: true.
6300 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
6303 * Constructs a new ChannelConfig given each field
6305 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);
6308 * Creates a copy of the ChannelConfig
6310 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
6313 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
6315 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
6318 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
6320 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
6323 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
6325 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
6328 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
6330 void UserConfig_free(struct LDKUserConfig this_obj);
6333 * Channel config that we propose to our counterparty.
6335 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
6338 * Channel config that we propose to our counterparty.
6340 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
6343 * Limits applied to our counterparty's proposed channel config settings.
6345 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
6348 * Limits applied to our counterparty's proposed channel config settings.
6350 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
6353 * Channel config which affects behavior during channel lifetime.
6355 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
6358 * Channel config which affects behavior during channel lifetime.
6360 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
6363 * Constructs a new UserConfig given each field
6365 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);
6368 * Creates a copy of the UserConfig
6370 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
6373 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
6375 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
6378 * Creates a copy of the AccessError
6380 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
6383 * Calls the free function if one is set
6385 void Access_free(struct LDKAccess this_ptr);
6388 * Calls the free function if one is set
6390 void Listen_free(struct LDKListen this_ptr);
6393 * Calls the free function if one is set
6395 void Watch_free(struct LDKWatch this_ptr);
6398 * Calls the free function if one is set
6400 void Filter_free(struct LDKFilter this_ptr);
6403 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
6405 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
6408 * First block where the transaction output may have been spent.
6410 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
6413 * First block where the transaction output may have been spent.
6415 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6418 * Outpoint identifying the transaction output.
6420 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
6423 * Outpoint identifying the transaction output.
6425 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
6428 * Spending condition of the transaction output.
6430 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
6433 * Spending condition of the transaction output.
6435 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
6438 * Constructs a new WatchedOutput given each field
6440 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
6443 * Calls the free function if one is set
6445 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
6448 * Creates a copy of the ConfirmationTarget
6450 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
6453 * Calls the free function if one is set
6455 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
6458 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
6460 void ChainMonitor_free(struct LDKChainMonitor this_obj);
6463 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
6464 * of a channel and reacting accordingly based on transactions in the connected block. See
6465 * [`ChannelMonitor::block_connected`] for details. Any HTLCs that were resolved on chain will
6466 * be returned by [`chain::Watch::release_pending_monitor_events`].
6468 * Calls back to [`chain::Filter`] if any monitor indicated new outputs to watch. Subsequent
6469 * calls must not exclude any transactions matching the new outputs nor any in-block
6470 * descendants of such transactions. It is not necessary to re-fetch the block to obtain
6473 void ChainMonitor_block_connected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
6476 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
6477 * of a channel based on the disconnected block. See [`ChannelMonitor::block_disconnected`] for
6480 void ChainMonitor_block_disconnected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t disconnected_height);
6483 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
6485 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
6486 * will call back to it indicating transactions and outputs of interest. This allows clients to
6487 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
6488 * always need to fetch full blocks absent another means for determining which blocks contain
6489 * transactions relevant to the watched channels.
6491 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
6494 * Constructs a new Watch which calls the relevant methods on this_arg.
6495 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
6497 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
6500 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
6501 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
6503 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
6506 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
6508 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
6511 * The sequence number of this update. Updates *must* be replayed in-order according to this
6512 * sequence number (and updates may panic if they are not). The update_id values are strictly
6513 * increasing and increase by one for each new update, with one exception specified below.
6515 * This sequence number is also used to track up to which points updates which returned
6516 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
6517 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
6519 * The only instance where update_id values are not strictly increasing is the case where we
6520 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
6521 * its docs for more details.
6523 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
6526 * The sequence number of this update. Updates *must* be replayed in-order according to this
6527 * sequence number (and updates may panic if they are not). The update_id values are strictly
6528 * increasing and increase by one for each new update, with one exception specified below.
6530 * This sequence number is also used to track up to which points updates which returned
6531 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
6532 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
6534 * The only instance where update_id values are not strictly increasing is the case where we
6535 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
6536 * its docs for more details.
6538 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
6541 * Creates a copy of the ChannelMonitorUpdate
6543 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
6546 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
6548 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
6551 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
6553 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
6556 * Creates a copy of the ChannelMonitorUpdateErr
6558 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
6561 * Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
6563 void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
6566 * Creates a copy of the MonitorUpdateError
6568 struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
6571 * Frees any resources used by the MonitorEvent
6573 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
6576 * Creates a copy of the MonitorEvent
6578 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
6581 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
6583 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
6586 * Creates a copy of the HTLCUpdate
6588 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
6591 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
6593 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
6596 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
6598 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
6601 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
6603 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
6606 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
6608 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
6611 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
6614 * panics if the given update is not the next update by update_id.
6616 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);
6619 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
6622 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
6625 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
6627 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
6630 * Gets a list of txids, with their output scripts (in the order they appear in the
6631 * transaction), which we must learn about spends of via block_connected().
6633 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
6636 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
6637 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
6638 * have been registered.
6640 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
6643 * Get the list of HTLCs who's status has been updated on chain. This should be called by
6644 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
6646 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
6649 * Gets the list of pending events which were generated by previous actions, clearing the list
6652 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
6653 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
6654 * no internal locking in ChannelMonitors.
6656 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
6659 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
6660 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
6661 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
6662 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
6663 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
6664 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
6665 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
6666 * out-of-band the other node operator to coordinate with him if option is available to you.
6667 * In any-case, choice is up to the user.
6669 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);
6672 * Processes transactions in a newly connected block, which may result in any of the following:
6673 * - update the monitor's state against resolved HTLCs
6674 * - punish the counterparty in the case of seeing a revoked commitment transaction
6675 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
6676 * - detect settled outputs for later spending
6677 * - schedule and bump any in-flight claims
6679 * Returns any new outputs to watch from `txdata`; after called, these are also included in
6680 * [`get_outputs_to_watch`].
6682 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
6684 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);
6687 * Determines if the disconnected block contained any transactions of interest and updates
6690 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);
6693 * Calls the free function if one is set
6695 void Persist_free(struct LDKPersist this_ptr);
6698 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
6700 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
6703 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
6705 void OutPoint_free(struct LDKOutPoint this_obj);
6708 * The referenced transaction's txid.
6710 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
6713 * The referenced transaction's txid.
6715 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6718 * The index of the referenced output in its transaction's vout.
6720 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
6723 * The index of the referenced output in its transaction's vout.
6725 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
6728 * Constructs a new OutPoint given each field
6730 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
6733 * Creates a copy of the OutPoint
6735 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
6738 * Convert an `OutPoint` to a lightning channel id.
6740 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
6743 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
6745 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
6748 * Read a OutPoint from a byte array, created by OutPoint_write
6750 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
6753 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
6755 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
6758 * The outpoint which is spendable
6760 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
6763 * The outpoint which is spendable
6765 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
6768 * Per commitment point to derive delayed_payment_key by key holder
6770 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
6773 * Per commitment point to derive delayed_payment_key by key holder
6775 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6778 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
6779 * the witness_script.
6781 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
6784 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
6785 * the witness_script.
6787 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
6790 * The output which is referenced by the given outpoint
6792 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
6795 * The revocation point specific to the commitment transaction which was broadcast. Used to
6796 * derive the witnessScript for this output.
6798 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
6801 * The revocation point specific to the commitment transaction which was broadcast. Used to
6802 * derive the witnessScript for this output.
6804 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6807 * Arbitrary identification information returned by a call to
6808 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
6809 * the channel to spend the output.
6811 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
6814 * Arbitrary identification information returned by a call to
6815 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
6816 * the channel to spend the output.
6818 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6821 * The value of the channel which this output originated from, possibly indirectly.
6823 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
6826 * The value of the channel which this output originated from, possibly indirectly.
6828 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
6831 * Constructs a new DelayedPaymentOutputDescriptor given each field
6833 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);
6836 * Creates a copy of the DelayedPaymentOutputDescriptor
6838 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
6841 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
6843 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
6846 * The outpoint which is spendable
6848 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
6851 * The outpoint which is spendable
6853 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
6856 * The output which is referenced by the given outpoint
6858 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
6861 * Arbitrary identification information returned by a call to
6862 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
6863 * the channel to spend the output.
6865 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
6868 * Arbitrary identification information returned by a call to
6869 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
6870 * the channel to spend the output.
6872 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6875 * The value of the channel which this transactions spends.
6877 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
6880 * The value of the channel which this transactions spends.
6882 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
6885 * Constructs a new StaticPaymentOutputDescriptor given each field
6887 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);
6890 * Creates a copy of the StaticPaymentOutputDescriptor
6892 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
6895 * Frees any resources used by the SpendableOutputDescriptor
6897 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
6900 * Creates a copy of the SpendableOutputDescriptor
6902 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
6905 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
6907 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
6910 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
6912 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
6915 * Creates a copy of a Sign
6917 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
6920 * Calls the free function if one is set
6922 void Sign_free(struct LDKSign this_ptr);
6925 * Calls the free function if one is set
6927 void KeysInterface_free(struct LDKKeysInterface this_ptr);
6930 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
6932 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
6935 * Private key of anchor tx
6937 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
6940 * Private key of anchor tx
6942 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
6945 * Holder secret key for blinded revocation pubkey
6947 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
6950 * Holder secret key for blinded revocation pubkey
6952 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
6955 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
6957 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
6960 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
6962 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
6965 * Holder secret key used in HTLC tx
6967 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
6970 * Holder secret key used in HTLC tx
6972 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
6975 * Holder htlc secret key used in commitment tx htlc outputs
6977 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
6980 * Holder htlc secret key used in commitment tx htlc outputs
6982 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
6987 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
6992 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6995 * Creates a copy of the InMemorySigner
6997 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
7000 * Create a new InMemorySigner
7002 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);
7005 * Counterparty pubkeys.
7006 * Will panic if ready_channel wasn't called.
7008 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
7011 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
7012 * transactions, ie the amount of time that we have to wait to recover our funds if we
7013 * broadcast a transaction.
7014 * Will panic if ready_channel wasn't called.
7016 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
7019 * The contest_delay value specified by us and applied on transactions broadcastable
7020 * by our counterparty, ie the amount of time that they have to wait to recover their funds
7021 * if they broadcast a transaction.
7022 * Will panic if ready_channel wasn't called.
7024 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
7027 * Whether the holder is the initiator
7028 * Will panic if ready_channel wasn't called.
7030 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
7034 * Will panic if ready_channel wasn't called.
7036 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
7039 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
7040 * building transactions.
7042 * Will panic if ready_channel wasn't called.
7044 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
7047 * Sign the single input of spend_tx at index `input_idx` which spends the output
7048 * described by descriptor, returning the witness stack for the input.
7050 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
7051 * or is not spending the outpoint described by `descriptor.outpoint`.
7053 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);
7056 * Sign the single input of spend_tx at index `input_idx` which spends the output
7057 * described by descriptor, returning the witness stack for the input.
7059 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
7060 * is not spending the outpoint described by `descriptor.outpoint`, or does not have a
7061 * sequence set to `descriptor.to_self_delay`.
7063 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);
7066 * Constructs a new Sign which calls the relevant methods on this_arg.
7067 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
7069 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
7072 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
7074 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
7077 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
7079 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
7082 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
7084 void KeysManager_free(struct LDKKeysManager this_obj);
7087 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
7088 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
7089 * starting_time isn't strictly required to actually be a time, but it must absolutely,
7090 * without a doubt, be unique to this instance. ie if you start multiple times with the same
7091 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
7092 * simply use the current time (with very high precision).
7094 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
7095 * obviously, starting_time should be unique every time you reload the library - it is only
7096 * used to generate new ephemeral key data (which will be stored by the individual channel if
7099 * Note that the seed is required to recover certain on-chain funds independent of
7100 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
7101 * channel, and some on-chain during-closing funds.
7103 * Note that until the 0.1 release there is no guarantee of backward compatibility between
7104 * versions. Once the library is more fully supported, the docs will be updated to include a
7105 * detailed description of the guarantee.
7107 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
7110 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
7112 * Key derivation parameters are accessible through a per-channel secrets
7113 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
7114 * onchain output detection for which a corresponding delayed_payment_key must be derived.
7116 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]);
7119 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
7120 * output to the given change destination (if sufficient change value remains). The
7121 * transaction will have a feerate, at least, of the given value.
7123 * Returns `Err(())` if the output value is greater than the input value minus required fee or
7124 * if a descriptor was duplicated.
7126 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
7128 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
7129 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
7131 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);
7134 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
7135 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
7137 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
7140 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
7142 void ChannelManager_free(struct LDKChannelManager this_obj);
7145 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
7147 void ChainParameters_free(struct LDKChainParameters this_obj);
7150 * The network for determining the `chain_hash` in Lightning messages.
7152 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
7155 * The network for determining the `chain_hash` in Lightning messages.
7157 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
7160 * The hash of the latest block successfully connected.
7162 const uint8_t (*ChainParameters_get_latest_hash(const struct LDKChainParameters *NONNULL_PTR this_ptr))[32];
7165 * The hash of the latest block successfully connected.
7167 void ChainParameters_set_latest_hash(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7170 * The height of the latest block successfully connected.
7172 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
7174 uintptr_t ChainParameters_get_latest_height(const struct LDKChainParameters *NONNULL_PTR this_ptr);
7177 * The height of the latest block successfully connected.
7179 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
7181 void ChainParameters_set_latest_height(struct LDKChainParameters *NONNULL_PTR this_ptr, uintptr_t val);
7184 * Constructs a new ChainParameters given each field
7186 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKThirtyTwoBytes latest_hash_arg, uintptr_t latest_height_arg);
7189 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
7191 void ChannelDetails_free(struct LDKChannelDetails this_obj);
7194 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
7195 * thereafter this is the txid of the funding transaction xor the funding transaction output).
7196 * Note that this means this value is *not* persistent - it can change once during the
7197 * lifetime of the channel.
7199 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
7202 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
7203 * thereafter this is the txid of the funding transaction xor the funding transaction output).
7204 * Note that this means this value is *not* persistent - it can change once during the
7205 * lifetime of the channel.
7207 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7210 * The position of the funding transaction in the chain. None if the funding transaction has
7211 * not yet been confirmed and the channel fully opened.
7213 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7216 * The position of the funding transaction in the chain. None if the funding transaction has
7217 * not yet been confirmed and the channel fully opened.
7219 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
7222 * The node_id of our counterparty
7224 struct LDKPublicKey ChannelDetails_get_remote_network_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7227 * The node_id of our counterparty
7229 void ChannelDetails_set_remote_network_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7232 * The Features the channel counterparty provided upon last connection.
7233 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
7234 * many routing-relevant features are present in the init context.
7236 struct LDKInitFeatures ChannelDetails_get_counterparty_features(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7239 * The Features the channel counterparty provided upon last connection.
7240 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
7241 * many routing-relevant features are present in the init context.
7243 void ChannelDetails_set_counterparty_features(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
7246 * The value, in satoshis, of this channel as appears in the funding output
7248 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7251 * The value, in satoshis, of this channel as appears in the funding output
7253 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
7256 * The user_id passed in to create_channel, or 0 if the channel was inbound.
7258 uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7261 * The user_id passed in to create_channel, or 0 if the channel was inbound.
7263 void ChannelDetails_set_user_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
7266 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
7267 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
7268 * available for inclusion in new outbound HTLCs). This further does not include any pending
7269 * outgoing HTLCs which are awaiting some other resolution to be sent.
7271 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7274 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
7275 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
7276 * available for inclusion in new outbound HTLCs). This further does not include any pending
7277 * outgoing HTLCs which are awaiting some other resolution to be sent.
7279 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
7282 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
7283 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
7284 * available for inclusion in new inbound HTLCs).
7285 * Note that there are some corner cases not fully handled here, so the actual available
7286 * inbound capacity may be slightly higher than this.
7288 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7291 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
7292 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
7293 * available for inclusion in new inbound HTLCs).
7294 * Note that there are some corner cases not fully handled here, so the actual available
7295 * inbound capacity may be slightly higher than this.
7297 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
7300 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
7301 * the peer is connected, and (c) no monitor update failure is pending resolution.
7303 bool ChannelDetails_get_is_live(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7306 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
7307 * the peer is connected, and (c) no monitor update failure is pending resolution.
7309 void ChannelDetails_set_is_live(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
7312 * Creates a copy of the ChannelDetails
7314 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
7317 * Frees any resources used by the PaymentSendFailure
7319 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
7322 * Creates a copy of the PaymentSendFailure
7324 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
7327 * Constructs a new ChannelManager to hold several channels and route between them.
7329 * This is the main \"logic hub\" for all channel-related actions, and implements
7330 * ChannelMessageHandler.
7332 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
7334 * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
7336 * Users need to notify the new ChannelManager when a new block is connected or
7337 * disconnected using its `block_connected` and `block_disconnected` methods, starting
7338 * from after `params.latest_hash`.
7340 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);
7343 * Creates a new outbound channel to the given remote node and with the given value.
7345 * user_id will be provided back as user_channel_id in FundingGenerationReady and
7346 * FundingBroadcastSafe events to allow tracking of which events correspond with which
7347 * create_channel call. Note that user_channel_id defaults to 0 for inbound channels, so you
7348 * may wish to avoid using 0 for user_id here.
7350 * If successful, will generate a SendOpenChannel message event, so you should probably poll
7351 * PeerManager::process_events afterwards.
7353 * Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
7354 * greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
7356 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);
7359 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
7362 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
7365 * Gets the list of usable channels, in random order. Useful as an argument to
7366 * get_route to ensure non-announced channels are used.
7368 * These are guaranteed to have their is_live value set to true, see the documentation for
7369 * ChannelDetails::is_live for more info on exactly what the criteria are.
7371 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
7374 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
7375 * will be accepted on the given channel, and after additional timeout/the closing of all
7376 * pending HTLCs, the channel will be closed on chain.
7378 * May generate a SendShutdown message event on success, which should be relayed.
7380 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
7383 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
7384 * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
7386 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
7389 * Force close all channels, immediately broadcasting the latest local commitment transaction
7390 * for each to the chain and rejecting new HTLCs on each.
7392 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
7395 * Sends a payment along a given route.
7397 * Value parameters are provided via the last hop in route, see documentation for RouteHop
7398 * fields for more info.
7400 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
7401 * payment), we don't do anything to stop you! We always try to ensure that if the provided
7402 * next hop knows the preimage to payment_hash they can claim an additional amount as
7403 * specified in the last hop in the route! Thus, you should probably do your own
7404 * payment_preimage tracking (which you should already be doing as they represent \"proof of
7405 * payment\") and prevent double-sends yourself.
7407 * May generate SendHTLCs message(s) event on success, which should be relayed.
7409 * Each path may have a different return value, and PaymentSendValue may return a Vec with
7410 * each entry matching the corresponding-index entry in the route paths, see
7411 * PaymentSendFailure for more info.
7413 * In general, a path may raise:
7414 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
7415 * node public key) is specified.
7416 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
7417 * (including due to previous monitor update failure or new permanent monitor update
7419 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
7422 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
7423 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
7424 * different route unless you intend to pay twice!
7426 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
7427 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
7428 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
7429 * must not contain multiple paths as multi-path payments require a recipient-provided
7431 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
7432 * bit set (either as required or as available). If multiple paths are present in the Route,
7433 * we assume the invoice had the basic_mpp feature set.
7435 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);
7438 * Call this upon creation of a funding transaction for the given channel.
7440 * Note that ALL inputs in the transaction pointed to by funding_txo MUST spend SegWit outputs
7441 * or your counterparty can steal your funds!
7443 * Panics if a funding transaction has already been provided for this channel.
7445 * May panic if the funding_txo is duplicative with some other channel (note that this should
7446 * be trivially prevented by using unique funding transaction keys per-channel).
7448 void ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKOutPoint funding_txo);
7451 * Generates a signed node_announcement from the given arguments and creates a
7452 * BroadcastNodeAnnouncement event. Note that such messages will be ignored unless peers have
7453 * seen a channel_announcement from us (ie unless we have public channels open).
7455 * RGB is a node \"color\" and alias is a printable human-readable string to describe this node
7456 * to humans. They carry no in-protocol meaning.
7458 * addresses represent the set (possibly empty) of socket addresses on which this node accepts
7459 * incoming connections. These will be broadcast to the network, publicly tying these
7460 * addresses together. If you wish to preserve user privacy, addresses should likely contain
7461 * only Tor Onion addresses.
7463 * Panics if addresses is absurdly large (more than 500).
7465 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
7468 * Processes HTLCs which are pending waiting on random forward delay.
7470 * Should only really ever be called in response to a PendingHTLCsForwardable event.
7471 * Will likely generate further events.
7473 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
7476 * If a peer is disconnected we mark any channels with that peer as 'disabled'.
7477 * After some time, if channels are still disabled we need to broadcast a ChannelUpdate
7478 * to inform the network about the uselessness of these channels.
7480 * This method handles all the details, and must be called roughly once per minute.
7482 * Note that in some rare cases this may generate a `chain::Watch::update_channel` call.
7484 void ChannelManager_timer_chan_freshness_every_min(const struct LDKChannelManager *NONNULL_PTR this_arg);
7487 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
7488 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
7489 * along the path (including in our own channel on which we received it).
7490 * Returns false if no payment was found to fail backwards, true if the process of failing the
7491 * HTLC backwards has been started.
7493 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);
7496 * Provides a payment preimage in response to a PaymentReceived event, returning true and
7497 * generating message events for the net layer to claim the payment, if possible. Thus, you
7498 * should probably kick the net layer to go send messages if this returns true!
7500 * You must specify the expected amounts for this HTLC, and we will only claim HTLCs
7501 * available within a few percent of the expected amount. This is critical for several
7502 * reasons : a) it avoids providing senders with `proof-of-payment` (in the form of the
7503 * payment_preimage without having provided the full value and b) it avoids certain
7504 * privacy-breaking recipient-probing attacks which may reveal payment activity to
7505 * motivated attackers.
7507 * Note that the privacy concerns in (b) are not relevant in payments with a payment_secret
7508 * set. Thus, for such payments we will claim any payments which do not under-pay.
7510 * May panic if called except in response to a PaymentReceived event.
7512 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);
7515 * Gets the node_id held by this ChannelManager
7517 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
7520 * Restores a single, given channel to normal operation after a
7521 * ChannelMonitorUpdateErr::TemporaryFailure was returned from a channel monitor update
7524 * All ChannelMonitor updates up to and including highest_applied_update_id must have been
7525 * fully committed in every copy of the given channels' ChannelMonitors.
7527 * Note that there is no effect to calling with a highest_applied_update_id other than the
7528 * current latest ChannelMonitorUpdate and one call to this function after multiple
7529 * ChannelMonitorUpdateErr::TemporaryFailures is fine. The highest_applied_update_id field
7530 * exists largely only to prevent races between this and concurrent update_monitor calls.
7532 * Thus, the anticipated use is, at a high level:
7533 * 1) You register a chain::Watch with this ChannelManager,
7534 * 2) it stores each update to disk, and begins updating any remote (eg watchtower) copies of
7535 * said ChannelMonitors as it can, returning ChannelMonitorUpdateErr::TemporaryFailures
7536 * any time it cannot do so instantly,
7537 * 3) update(s) are applied to each remote copy of a ChannelMonitor,
7538 * 4) once all remote copies are updated, you call this function with the update_id that
7539 * completed, and once it is the latest the Channel will be re-enabled.
7541 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);
7544 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
7545 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
7547 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
7550 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
7551 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
7553 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
7556 * Constructs a new Listen which calls the relevant methods on this_arg.
7557 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
7559 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
7562 * Updates channel state based on transactions seen in a connected block.
7564 void ChannelManager_block_connected(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
7567 * Updates channel state based on a disconnected block.
7569 * If necessary, the channel may be force-closed without letting the counterparty participate
7572 void ChannelManager_block_disconnected(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80]);
7575 * Blocks until ChannelManager needs to be persisted. Only one listener on
7576 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
7579 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
7582 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
7583 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
7585 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
7588 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
7590 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
7593 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
7595 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
7598 * The keys provider which will give us relevant keys. Some keys will be loaded during
7599 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
7602 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
7605 * The keys provider which will give us relevant keys. Some keys will be loaded during
7606 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
7609 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
7612 * The fee_estimator for use in the ChannelManager in the future.
7614 * No calls to the FeeEstimator will be made during deserialization.
7616 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
7619 * The fee_estimator for use in the ChannelManager in the future.
7621 * No calls to the FeeEstimator will be made during deserialization.
7623 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
7626 * The chain::Watch for use in the ChannelManager in the future.
7628 * No calls to the chain::Watch will be made during deserialization. It is assumed that
7629 * you have deserialized ChannelMonitors separately and will add them to your
7630 * chain::Watch after deserializing this ChannelManager.
7632 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
7635 * The chain::Watch for use in the ChannelManager in the future.
7637 * No calls to the chain::Watch will be made during deserialization. It is assumed that
7638 * you have deserialized ChannelMonitors separately and will add them to your
7639 * chain::Watch after deserializing this ChannelManager.
7641 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
7644 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
7645 * used to broadcast the latest local commitment transactions of channels which must be
7646 * force-closed during deserialization.
7648 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
7651 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
7652 * used to broadcast the latest local commitment transactions of channels which must be
7653 * force-closed during deserialization.
7655 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
7658 * The Logger for use in the ChannelManager and which may be used to log information during
7661 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
7664 * The Logger for use in the ChannelManager and which may be used to log information during
7667 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
7670 * Default settings used for new channels. Any existing channels will continue to use the
7671 * runtime settings which were stored when the ChannelManager was serialized.
7673 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
7676 * Default settings used for new channels. Any existing channels will continue to use the
7677 * runtime settings which were stored when the ChannelManager was serialized.
7679 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
7682 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
7683 * HashMap for you. This is primarily useful for C bindings where it is not practical to
7684 * populate a HashMap directly from C.
7686 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);
7689 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
7691 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
7694 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
7696 void DecodeError_free(struct LDKDecodeError this_obj);
7699 * Creates a copy of the DecodeError
7701 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
7704 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
7706 void Init_free(struct LDKInit this_obj);
7709 * The relevant features which the sender supports
7711 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
7714 * The relevant features which the sender supports
7716 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
7719 * Constructs a new Init given each field
7721 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
7724 * Creates a copy of the Init
7726 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
7729 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
7731 void ErrorMessage_free(struct LDKErrorMessage this_obj);
7734 * The channel ID involved in the error
7736 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
7739 * The channel ID involved in the error
7741 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7744 * A possibly human-readable error description.
7745 * The string should be sanitized before it is used (e.g. emitted to logs
7746 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
7747 * vulnerability in the terminal emulator or the logging subsystem.
7749 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
7752 * A possibly human-readable error description.
7753 * The string should be sanitized before it is used (e.g. emitted to logs
7754 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
7755 * vulnerability in the terminal emulator or the logging subsystem.
7757 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
7760 * Constructs a new ErrorMessage given each field
7762 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg);
7765 * Creates a copy of the ErrorMessage
7767 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
7770 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
7772 void Ping_free(struct LDKPing this_obj);
7775 * The desired response length
7777 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
7780 * The desired response length
7782 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
7785 * The ping packet size.
7786 * This field is not sent on the wire. byteslen zeros are sent.
7788 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
7791 * The ping packet size.
7792 * This field is not sent on the wire. byteslen zeros are sent.
7794 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
7797 * Constructs a new Ping given each field
7799 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
7802 * Creates a copy of the Ping
7804 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
7807 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
7809 void Pong_free(struct LDKPong this_obj);
7812 * The pong packet size.
7813 * This field is not sent on the wire. byteslen zeros are sent.
7815 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
7818 * The pong packet size.
7819 * This field is not sent on the wire. byteslen zeros are sent.
7821 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
7824 * Constructs a new Pong given each field
7826 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
7829 * Creates a copy of the Pong
7831 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
7834 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
7836 void OpenChannel_free(struct LDKOpenChannel this_obj);
7839 * The genesis hash of the blockchain where the channel is to be opened
7841 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
7844 * The genesis hash of the blockchain where the channel is to be opened
7846 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7849 * A temporary channel ID, until the funding outpoint is announced
7851 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
7854 * A temporary channel ID, until the funding outpoint is announced
7856 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7861 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7866 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
7869 * The amount to push to the counterparty as part of the open, in milli-satoshi
7871 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7874 * The amount to push to the counterparty as part of the open, in milli-satoshi
7876 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
7879 * The threshold below which outputs on transactions broadcast by sender will be omitted
7881 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7884 * The threshold below which outputs on transactions broadcast by sender will be omitted
7886 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
7889 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
7891 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7894 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
7896 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
7899 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
7901 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7904 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
7906 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
7909 * The minimum HTLC size incoming to sender, in milli-satoshi
7911 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7914 * The minimum HTLC size incoming to sender, in milli-satoshi
7916 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
7919 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
7921 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7924 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
7926 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
7929 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
7931 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7934 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
7936 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
7939 * The maximum number of inbound HTLCs towards sender
7941 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7944 * The maximum number of inbound HTLCs towards sender
7946 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
7949 * The sender's key controlling the funding transaction
7951 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7954 * The sender's key controlling the funding transaction
7956 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7959 * Used to derive a revocation key for transactions broadcast by counterparty
7961 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7964 * Used to derive a revocation key for transactions broadcast by counterparty
7966 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7969 * A payment key to sender for transactions broadcast by counterparty
7971 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7974 * A payment key to sender for transactions broadcast by counterparty
7976 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7979 * Used to derive a payment key to sender for transactions broadcast by sender
7981 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7984 * Used to derive a payment key to sender for transactions broadcast by sender
7986 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7989 * Used to derive an HTLC payment key to sender
7991 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7994 * Used to derive an HTLC payment key to sender
7996 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7999 * The first to-be-broadcast-by-sender transaction's per commitment point
8001 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
8004 * The first to-be-broadcast-by-sender transaction's per commitment point
8006 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8011 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
8016 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
8019 * Creates a copy of the OpenChannel
8021 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
8024 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
8026 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
8029 * A temporary channel ID, until the funding outpoint is announced
8031 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
8034 * A temporary channel ID, until the funding outpoint is announced
8036 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8039 * The threshold below which outputs on transactions broadcast by sender will be omitted
8041 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8044 * The threshold below which outputs on transactions broadcast by sender will be omitted
8046 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
8049 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
8051 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8054 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
8056 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
8059 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
8061 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8064 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
8066 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
8069 * The minimum HTLC size incoming to sender, in milli-satoshi
8071 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8074 * The minimum HTLC size incoming to sender, in milli-satoshi
8076 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
8079 * Minimum depth of the funding transaction before the channel is considered open
8081 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8084 * Minimum depth of the funding transaction before the channel is considered open
8086 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
8089 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
8091 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8094 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
8096 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
8099 * The maximum number of inbound HTLCs towards sender
8101 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8104 * The maximum number of inbound HTLCs towards sender
8106 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
8109 * The sender's key controlling the funding transaction
8111 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8114 * The sender's key controlling the funding transaction
8116 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8119 * Used to derive a revocation key for transactions broadcast by counterparty
8121 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8124 * Used to derive a revocation key for transactions broadcast by counterparty
8126 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8129 * A payment key to sender for transactions broadcast by counterparty
8131 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8134 * A payment key to sender for transactions broadcast by counterparty
8136 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8139 * Used to derive a payment key to sender for transactions broadcast by sender
8141 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8144 * Used to derive a payment key to sender for transactions broadcast by sender
8146 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8149 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
8151 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8154 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
8156 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8159 * The first to-be-broadcast-by-sender transaction's per commitment point
8161 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
8164 * The first to-be-broadcast-by-sender transaction's per commitment point
8166 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8169 * Creates a copy of the AcceptChannel
8171 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
8174 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
8176 void FundingCreated_free(struct LDKFundingCreated this_obj);
8179 * A temporary channel ID, until the funding is established
8181 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
8184 * A temporary channel ID, until the funding is established
8186 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8189 * The funding transaction ID
8191 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
8194 * The funding transaction ID
8196 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8199 * The specific output index funding this channel
8201 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
8204 * The specific output index funding this channel
8206 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
8209 * The signature of the channel initiator (funder) on the funding transaction
8211 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
8214 * The signature of the channel initiator (funder) on the funding transaction
8216 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
8219 * Constructs a new FundingCreated given each field
8221 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);
8224 * Creates a copy of the FundingCreated
8226 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
8229 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
8231 void FundingSigned_free(struct LDKFundingSigned this_obj);
8236 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
8241 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8244 * The signature of the channel acceptor (fundee) on the funding transaction
8246 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
8249 * The signature of the channel acceptor (fundee) on the funding transaction
8251 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
8254 * Constructs a new FundingSigned given each field
8256 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
8259 * Creates a copy of the FundingSigned
8261 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
8264 * Frees any resources used by the FundingLocked, if is_owned is set and inner is non-NULL.
8266 void FundingLocked_free(struct LDKFundingLocked this_obj);
8271 const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32];
8276 void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8279 * The per-commitment point of the second commitment transaction
8281 struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr);
8284 * The per-commitment point of the second commitment transaction
8286 void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8289 * Constructs a new FundingLocked given each field
8291 MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
8294 * Creates a copy of the FundingLocked
8296 struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
8299 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
8301 void Shutdown_free(struct LDKShutdown this_obj);
8306 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
8311 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8314 * The destination of this peer's funds on closing.
8315 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
8317 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
8320 * The destination of this peer's funds on closing.
8321 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
8323 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
8326 * Constructs a new Shutdown given each field
8328 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
8331 * Creates a copy of the Shutdown
8333 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
8336 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
8338 void ClosingSigned_free(struct LDKClosingSigned this_obj);
8343 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
8348 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8351 * The proposed total fee for the closing transaction
8353 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
8356 * The proposed total fee for the closing transaction
8358 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
8361 * A signature on the closing transaction
8363 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
8366 * A signature on the closing transaction
8368 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
8371 * Constructs a new ClosingSigned given each field
8373 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg);
8376 * Creates a copy of the ClosingSigned
8378 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
8381 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
8383 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
8388 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
8393 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8398 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
8403 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
8406 * The HTLC value in milli-satoshi
8408 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
8411 * The HTLC value in milli-satoshi
8413 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
8416 * The payment hash, the pre-image of which controls HTLC redemption
8418 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
8421 * The payment hash, the pre-image of which controls HTLC redemption
8423 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8426 * The expiry height of the HTLC
8428 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
8431 * The expiry height of the HTLC
8433 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
8436 * Creates a copy of the UpdateAddHTLC
8438 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
8441 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
8443 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
8448 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
8453 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8458 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
8463 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
8466 * The pre-image of the payment hash, allowing HTLC redemption
8468 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
8471 * The pre-image of the payment hash, allowing HTLC redemption
8473 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8476 * Constructs a new UpdateFulfillHTLC given each field
8478 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
8481 * Creates a copy of the UpdateFulfillHTLC
8483 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
8486 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
8488 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
8493 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
8498 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8503 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
8508 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
8511 * Creates a copy of the UpdateFailHTLC
8513 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
8516 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
8518 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
8523 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
8528 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8533 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
8538 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
8543 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
8548 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
8551 * Creates a copy of the UpdateFailMalformedHTLC
8553 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
8556 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
8558 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
8563 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
8568 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8571 * A signature on the commitment transaction
8573 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
8576 * A signature on the commitment transaction
8578 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
8581 * Signatures on the HTLC transactions
8583 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
8586 * Constructs a new CommitmentSigned given each field
8588 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
8591 * Creates a copy of the CommitmentSigned
8593 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
8596 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
8598 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
8603 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
8608 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8611 * The secret corresponding to the per-commitment point
8613 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
8616 * The secret corresponding to the per-commitment point
8618 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8621 * The next sender-broadcast commitment transaction's per-commitment point
8623 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
8626 * The next sender-broadcast commitment transaction's per-commitment point
8628 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8631 * Constructs a new RevokeAndACK given each field
8633 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);
8636 * Creates a copy of the RevokeAndACK
8638 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
8641 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
8643 void UpdateFee_free(struct LDKUpdateFee this_obj);
8648 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
8653 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8656 * Fee rate per 1000-weight of the transaction
8658 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
8661 * Fee rate per 1000-weight of the transaction
8663 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
8666 * Constructs a new UpdateFee given each field
8668 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
8671 * Creates a copy of the UpdateFee
8673 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
8676 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
8678 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
8681 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
8682 * belonging to the recipient
8684 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
8687 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
8688 * belonging to the recipient
8690 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8693 * The sender's per-commitment point for their current commitment transaction
8695 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
8698 * The sender's per-commitment point for their current commitment transaction
8700 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8703 * Constructs a new DataLossProtect given each field
8705 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
8708 * Creates a copy of the DataLossProtect
8710 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
8713 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
8715 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
8720 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
8725 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8728 * The next commitment number for the sender
8730 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
8733 * The next commitment number for the sender
8735 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
8738 * The next commitment number for the recipient
8740 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
8743 * The next commitment number for the recipient
8745 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
8748 * Creates a copy of the ChannelReestablish
8750 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
8753 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
8755 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
8760 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
8765 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8768 * The short channel ID
8770 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
8773 * The short channel ID
8775 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
8778 * A signature by the node key
8780 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
8783 * A signature by the node key
8785 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
8788 * A signature by the funding key
8790 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
8793 * A signature by the funding key
8795 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
8798 * Constructs a new AnnouncementSignatures given each field
8800 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);
8803 * Creates a copy of the AnnouncementSignatures
8805 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
8808 * Frees any resources used by the NetAddress
8810 void NetAddress_free(struct LDKNetAddress this_ptr);
8813 * Creates a copy of the NetAddress
8815 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
8818 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
8820 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
8823 * Read a Result from a byte array, created by Result_write
8825 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
8828 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
8830 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
8833 * The advertised features
8835 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
8838 * The advertised features
8840 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
8843 * A strictly monotonic announcement counter, with gaps allowed
8845 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
8848 * A strictly monotonic announcement counter, with gaps allowed
8850 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
8853 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
8856 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
8859 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
8862 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8865 * An RGB color for UI purposes
8867 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
8870 * An RGB color for UI purposes
8872 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
8875 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
8878 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
8881 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
8884 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8887 * List of addresses on which this node is reachable
8889 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
8892 * Creates a copy of the UnsignedNodeAnnouncement
8894 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
8897 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
8899 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
8902 * The signature by the node key
8904 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
8907 * The signature by the node key
8909 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
8912 * The actual content of the announcement
8914 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
8917 * The actual content of the announcement
8919 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
8922 * Constructs a new NodeAnnouncement given each field
8924 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
8927 * Creates a copy of the NodeAnnouncement
8929 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
8932 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
8934 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
8937 * The advertised channel features
8939 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
8942 * The advertised channel features
8944 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
8947 * The genesis hash of the blockchain where the channel is to be opened
8949 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
8952 * The genesis hash of the blockchain where the channel is to be opened
8954 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8957 * The short channel ID
8959 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
8962 * The short channel ID
8964 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
8967 * One of the two node_ids which are endpoints of this channel
8969 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
8972 * One of the two node_ids which are endpoints of this channel
8974 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8977 * The other of the two node_ids which are endpoints of this channel
8979 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
8982 * The other of the two node_ids which are endpoints of this channel
8984 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8987 * The funding key for the first node
8989 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
8992 * The funding key for the first node
8994 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8997 * The funding key for the second node
8999 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
9002 * The funding key for the second node
9004 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
9007 * Creates a copy of the UnsignedChannelAnnouncement
9009 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
9012 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
9014 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
9017 * Authentication of the announcement by the first public node
9019 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
9022 * Authentication of the announcement by the first public node
9024 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
9027 * Authentication of the announcement by the second public node
9029 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
9032 * Authentication of the announcement by the second public node
9034 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
9037 * Proof of funding UTXO ownership by the first public node
9039 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
9042 * Proof of funding UTXO ownership by the first public node
9044 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
9047 * Proof of funding UTXO ownership by the second public node
9049 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
9052 * Proof of funding UTXO ownership by the second public node
9054 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
9057 * The actual announcement
9059 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
9062 * The actual announcement
9064 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
9067 * Constructs a new ChannelAnnouncement given each field
9069 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);
9072 * Creates a copy of the ChannelAnnouncement
9074 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
9077 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
9079 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
9082 * The genesis hash of the blockchain where the channel is to be opened
9084 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
9087 * The genesis hash of the blockchain where the channel is to be opened
9089 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
9092 * The short channel ID
9094 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
9097 * The short channel ID
9099 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
9102 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
9104 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
9107 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
9109 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
9114 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
9119 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
9122 * The number of blocks such that if:
9123 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
9124 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
9125 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
9126 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
9127 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
9128 * forwarding. Note that the HTLC sender is the one who originally sets this value when
9129 * constructing the route.
9131 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
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 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
9146 * The minimum HTLC size incoming to sender, in milli-satoshi
9148 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
9151 * The minimum HTLC size incoming to sender, in milli-satoshi
9153 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
9156 * The base HTLC fee charged by sender, in milli-satoshi
9158 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
9161 * The base HTLC fee charged by sender, in milli-satoshi
9163 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
9166 * The amount to fee multiplier, in micro-satoshi
9168 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
9171 * The amount to fee multiplier, in micro-satoshi
9173 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
9176 * Creates a copy of the UnsignedChannelUpdate
9178 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
9181 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
9183 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
9186 * A signature of the channel update
9188 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
9191 * A signature of the channel update
9193 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
9196 * The actual channel update
9198 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
9201 * The actual channel update
9203 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
9206 * Constructs a new ChannelUpdate given each field
9208 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
9211 * Creates a copy of the ChannelUpdate
9213 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
9216 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
9218 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
9221 * The genesis hash of the blockchain being queried
9223 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
9226 * The genesis hash of the blockchain being queried
9228 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
9231 * The height of the first block for the channel UTXOs being queried
9233 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
9236 * The height of the first block for the channel UTXOs being queried
9238 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
9241 * The number of blocks to include in the query results
9243 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
9246 * The number of blocks to include in the query results
9248 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
9251 * Constructs a new QueryChannelRange given each field
9253 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
9256 * Creates a copy of the QueryChannelRange
9258 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
9261 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
9263 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
9266 * The genesis hash of the blockchain being queried
9268 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
9271 * The genesis hash of the blockchain being queried
9273 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
9276 * The height of the first block in the range of the reply
9278 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
9281 * The height of the first block in the range of the reply
9283 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
9286 * The number of blocks included in the range of the reply
9288 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
9291 * The number of blocks included in the range of the reply
9293 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
9296 * True when this is the final reply for a query
9298 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
9301 * True when this is the final reply for a query
9303 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
9306 * The short_channel_ids in the channel range
9308 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
9311 * Constructs a new ReplyChannelRange given each field
9313 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);
9316 * Creates a copy of the ReplyChannelRange
9318 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
9321 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
9323 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
9326 * The genesis hash of the blockchain being queried
9328 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
9331 * The genesis hash of the blockchain being queried
9333 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
9336 * The short_channel_ids that are being queried
9338 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
9341 * Constructs a new QueryShortChannelIds given each field
9343 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
9346 * Creates a copy of the QueryShortChannelIds
9348 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
9351 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
9353 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
9356 * The genesis hash of the blockchain that was queried
9358 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
9361 * The genesis hash of the blockchain that was queried
9363 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
9366 * Indicates if the query recipient maintains up-to-date channel
9367 * information for the chain_hash
9369 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
9372 * Indicates if the query recipient maintains up-to-date channel
9373 * information for the chain_hash
9375 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
9378 * Constructs a new ReplyShortChannelIdsEnd given each field
9380 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
9383 * Creates a copy of the ReplyShortChannelIdsEnd
9385 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
9388 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
9390 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
9393 * The genesis hash of the blockchain for channel and node information
9395 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
9398 * The genesis hash of the blockchain for channel and node information
9400 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
9403 * The starting unix timestamp
9405 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
9408 * The starting unix timestamp
9410 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
9413 * The range of information in seconds
9415 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
9418 * The range of information in seconds
9420 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
9423 * Constructs a new GossipTimestampFilter given each field
9425 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
9428 * Creates a copy of the GossipTimestampFilter
9430 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
9433 * Frees any resources used by the ErrorAction
9435 void ErrorAction_free(struct LDKErrorAction this_ptr);
9438 * Creates a copy of the ErrorAction
9440 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
9443 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
9445 void LightningError_free(struct LDKLightningError this_obj);
9448 * A human-readable message describing the error
9450 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
9453 * A human-readable message describing the error
9455 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
9458 * The action which should be taken against the offending peer.
9460 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
9463 * The action which should be taken against the offending peer.
9465 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
9468 * Constructs a new LightningError given each field
9470 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKCVec_u8Z err_arg, struct LDKErrorAction action_arg);
9473 * Creates a copy of the LightningError
9475 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
9478 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
9480 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
9483 * update_add_htlc messages which should be sent
9485 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
9488 * update_fulfill_htlc messages which should be sent
9490 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
9493 * update_fail_htlc messages which should be sent
9495 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
9498 * update_fail_malformed_htlc messages which should be sent
9500 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
9503 * An update_fee message which should be sent
9505 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
9508 * An update_fee message which should be sent
9510 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
9513 * Finally, the commitment_signed message which should be sent
9515 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
9518 * Finally, the commitment_signed message which should be sent
9520 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
9523 * Constructs a new CommitmentUpdate given each field
9525 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);
9528 * Creates a copy of the CommitmentUpdate
9530 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
9533 * Frees any resources used by the HTLCFailChannelUpdate
9535 void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr);
9538 * Creates a copy of the HTLCFailChannelUpdate
9540 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig);
9543 * Calls the free function if one is set
9545 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
9548 * Calls the free function if one is set
9550 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
9553 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
9555 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
9558 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
9560 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
9563 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
9565 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
9568 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
9570 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
9573 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
9575 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
9578 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
9580 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
9583 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
9585 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
9588 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
9590 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
9593 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
9595 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
9598 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
9600 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
9603 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
9605 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
9608 * Read a FundingCreated from a byte array, created by FundingCreated_write
9610 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
9613 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
9615 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
9618 * Read a FundingSigned from a byte array, created by FundingSigned_write
9620 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
9623 * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
9625 struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
9628 * Read a FundingLocked from a byte array, created by FundingLocked_write
9630 struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
9633 * Serialize the Init object into a byte array which can be read by Init_read
9635 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
9638 * Read a Init from a byte array, created by Init_write
9640 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
9643 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
9645 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
9648 * Read a OpenChannel from a byte array, created by OpenChannel_write
9650 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
9653 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
9655 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
9658 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
9660 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
9663 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
9665 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
9668 * Read a Shutdown from a byte array, created by Shutdown_write
9670 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
9673 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
9675 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
9678 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
9680 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
9683 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
9685 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
9688 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
9690 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
9693 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
9695 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
9698 * Read a UpdateFee from a byte array, created by UpdateFee_write
9700 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
9703 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
9705 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
9708 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
9710 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
9713 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
9715 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
9718 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
9720 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
9723 * Serialize the Ping object into a byte array which can be read by Ping_read
9725 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
9728 * Read a Ping from a byte array, created by Ping_write
9730 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
9733 * Serialize the Pong object into a byte array which can be read by Pong_read
9735 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
9738 * Read a Pong from a byte array, created by Pong_write
9740 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
9743 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
9745 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
9748 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
9750 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
9753 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
9755 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
9758 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
9760 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
9763 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
9765 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
9768 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
9770 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
9773 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
9775 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
9778 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
9780 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
9783 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
9785 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
9788 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
9790 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
9793 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
9795 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
9798 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
9800 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
9803 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
9805 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
9808 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
9810 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
9813 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
9815 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
9818 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
9820 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
9823 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
9825 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
9828 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
9830 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
9833 *\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
9835 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
9838 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
9840 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
9843 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
9845 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
9848 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
9850 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
9853 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
9855 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
9858 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
9860 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
9863 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
9865 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
9868 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
9870 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
9873 * Constructs a new IgnoringMessageHandler given each field
9875 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
9878 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
9879 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
9881 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
9884 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
9885 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
9887 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
9890 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
9892 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
9895 * Constructs a new ErroringMessageHandler
9897 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
9900 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
9901 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
9903 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
9906 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
9907 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
9909 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
9912 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
9914 void MessageHandler_free(struct LDKMessageHandler this_obj);
9917 * A message handler which handles messages specific to channels. Usually this is just a
9918 * ChannelManager object or a ErroringMessageHandler.
9920 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
9923 * A message handler which handles messages specific to channels. Usually this is just a
9924 * ChannelManager object or a ErroringMessageHandler.
9926 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
9929 * A message handler which handles messages updating our knowledge of the network channel
9930 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
9932 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
9935 * A message handler which handles messages updating our knowledge of the network channel
9936 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
9938 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
9941 * Constructs a new MessageHandler given each field
9943 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
9946 * Creates a copy of a SocketDescriptor
9948 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
9951 * Calls the free function if one is set
9953 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
9956 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
9958 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
9961 * Used to indicate that we probably can't make any future connections to this peer, implying
9962 * we should go ahead and force-close any channels we have with it.
9964 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
9967 * Used to indicate that we probably can't make any future connections to this peer, implying
9968 * we should go ahead and force-close any channels we have with it.
9970 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
9973 * Constructs a new PeerHandleError given each field
9975 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
9978 * Creates a copy of the PeerHandleError
9980 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
9983 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
9985 void PeerManager_free(struct LDKPeerManager this_obj);
9988 * Constructs a new PeerManager with the given message handlers and node_id secret key
9989 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
9990 * cryptographically secure random bytes.
9992 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);
9995 * Get the list of node ids for peers which have completed the initial handshake.
9997 * For outbound connections, this will be the same as the their_node_id parameter passed in to
9998 * new_outbound_connection, however entries will only appear once the initial handshake has
9999 * completed and we are sure the remote peer has the private key for the given node_id.
10001 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
10004 * Indicates a new outbound connection has been established to a node with the given node_id.
10005 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
10006 * descriptor but must disconnect the connection immediately.
10008 * Returns a small number of bytes to send to the remote node (currently always 50).
10010 * Panics if descriptor is duplicative with some other descriptor which has not yet had a
10011 * socket_disconnected().
10013 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);
10016 * Indicates a new inbound connection has been established.
10018 * May refuse the connection by returning an Err, but will never write bytes to the remote end
10019 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
10020 * call socket_disconnected for the new descriptor but must disconnect the connection
10023 * Panics if descriptor is duplicative with some other descriptor which has not yet had
10024 * socket_disconnected called.
10026 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor);
10029 * Indicates that there is room to write data to the given socket descriptor.
10031 * May return an Err to indicate that the connection should be closed.
10033 * Will most likely call send_data on the descriptor passed in (or the descriptor handed into
10034 * new_*\\_connection) before returning. Thus, be very careful with reentrancy issues! The
10035 * invariants around calling write_buffer_space_avail in case a write did not fully complete
10036 * must still hold - be ready to call write_buffer_space_avail again if a write call generated
10037 * here isn't sufficient! Panics if the descriptor was not previously registered in a
10038 * new_\\*_connection event.
10040 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
10043 * Indicates that data was read from the given socket descriptor.
10045 * May return an Err to indicate that the connection should be closed.
10047 * Will *not* call back into send_data on any descriptors to avoid reentrancy complexity.
10048 * Thus, however, you almost certainly want to call process_events() after any read_event to
10049 * generate send_data calls to handle responses.
10051 * If Ok(true) is returned, further read_events should not be triggered until a send_data call
10052 * on this file descriptor has resume_read set (preventing DoS issues in the send buffer).
10054 * Panics if the descriptor was not previously registered in a new_*_connection event.
10056 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);
10059 * Checks for any events generated by our handlers and processes them. Includes sending most
10060 * response messages as well as messages generated by calls to handler functions directly (eg
10061 * functions like ChannelManager::process_pending_htlc_forward or send_payment).
10063 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
10066 * Indicates that the given socket descriptor's connection is now closed.
10068 * This must only be called if the socket has been disconnected by the peer or your own
10069 * decision to disconnect it and must NOT be called in any case where other parts of this
10070 * library (eg PeerHandleError, explicit disconnect_socket calls) instruct you to disconnect
10073 * Panics if the descriptor was not previously registered in a successful new_*_connection event.
10075 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
10078 * Disconnect a peer given its node id.
10080 * Set no_connection_possible to true to prevent any further connection with this peer,
10081 * force-closing any channels we have with it.
10083 * If a peer is connected, this will call `disconnect_socket` on the descriptor for the peer,
10084 * so be careful about reentrancy issues.
10086 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
10089 * This function should be called roughly once every 30 seconds.
10090 * It will send pings to each peer and disconnect those which did not respond to the last round of pings.
10091 * Will most likely call send_data on all of the registered descriptors, thus, be very careful with reentrancy issues!
10093 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
10096 * Build the commitment secret from the seed and the commitment number
10098 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
10101 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
10102 * from the base secret and the per_commitment_point.
10104 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
10105 * generated (ie our own).
10107 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
10110 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
10111 * from the base point and the per_commitment_key. This is the public equivalent of
10112 * derive_private_key - using only public keys to derive a public key instead of private keys.
10114 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
10115 * generated (ie our own).
10117 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
10120 * Derives a per-commitment-transaction revocation key from its constituent parts.
10122 * Only the cheating participant owns a valid witness to propagate a revoked
10123 * commitment transaction, thus per_commitment_secret always come from cheater
10124 * and revocation_base_secret always come from punisher, which is the broadcaster
10125 * of the transaction spending with this key knowledge.
10127 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
10128 * generated (ie our own).
10130 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
10133 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
10134 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
10135 * public key instead of private keys.
10137 * Only the cheating participant owns a valid witness to propagate a revoked
10138 * commitment transaction, thus per_commitment_point always come from cheater
10139 * and revocation_base_point always come from punisher, which is the broadcaster
10140 * of the transaction spending with this key knowledge.
10142 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
10143 * generated (ie our own).
10145 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
10148 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
10150 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
10153 * The broadcaster's per-commitment public key which was used to derive the other keys.
10155 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
10158 * The broadcaster's per-commitment public key which was used to derive the other keys.
10160 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10163 * The revocation key which is used to allow the broadcaster of the commitment
10164 * transaction to provide their counterparty the ability to punish them if they broadcast
10167 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
10170 * The revocation key which is used to allow the broadcaster of the commitment
10171 * transaction to provide their counterparty the ability to punish them if they broadcast
10174 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10177 * Broadcaster's HTLC Key
10179 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
10182 * Broadcaster's HTLC Key
10184 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10187 * Countersignatory's HTLC Key
10189 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
10192 * Countersignatory's HTLC Key
10194 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10197 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
10199 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
10202 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
10204 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10207 * Constructs a new TxCreationKeys given each field
10209 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);
10212 * Creates a copy of the TxCreationKeys
10214 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
10217 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
10219 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
10222 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
10224 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
10227 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
10229 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
10232 * The public key which is used to sign all commitment transactions, as it appears in the
10233 * on-chain channel lock-in 2-of-2 multisig output.
10235 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
10238 * The public key which is used to sign all commitment transactions, as it appears in the
10239 * on-chain channel lock-in 2-of-2 multisig output.
10241 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10244 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
10245 * revocation keys. This is combined with the per-commitment-secret generated by the
10246 * counterparty to create a secret which the counterparty can reveal to revoke previous
10249 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
10252 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
10253 * revocation keys. This is combined with the per-commitment-secret generated by the
10254 * counterparty to create a secret which the counterparty can reveal to revoke previous
10257 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10260 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
10261 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
10262 * static across every commitment transaction.
10264 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
10267 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
10268 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
10269 * static across every commitment transaction.
10271 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10274 * The base point which is used (with derive_public_key) to derive a per-commitment payment
10275 * public key which receives non-HTLC-encumbered funds which are only available for spending
10276 * after some delay (or can be claimed via the revocation path).
10278 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
10281 * The base point which is used (with derive_public_key) to derive a per-commitment payment
10282 * public key which receives non-HTLC-encumbered funds which are only available for spending
10283 * after some delay (or can be claimed via the revocation path).
10285 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10288 * The base point which is used (with derive_public_key) to derive a per-commitment public key
10289 * which is used to encumber HTLC-in-flight outputs.
10291 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
10294 * The base point which is used (with derive_public_key) to derive a per-commitment public key
10295 * which is used to encumber HTLC-in-flight outputs.
10297 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10300 * Constructs a new ChannelPublicKeys given each field
10302 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);
10305 * Creates a copy of the ChannelPublicKeys
10307 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
10310 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
10312 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
10315 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
10317 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
10320 * Create per-state keys from channel base points and the per-commitment point.
10321 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
10323 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);
10326 * Generate per-state keys from channel static keys.
10327 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
10329 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);
10332 * A script either spendable by the revocation
10333 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
10334 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
10336 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
10339 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
10341 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
10344 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
10345 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
10346 * need to compare this value to whether the commitment transaction in question is that of
10347 * the counterparty or our own.
10349 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
10352 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
10353 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
10354 * need to compare this value to whether the commitment transaction in question is that of
10355 * the counterparty or our own.
10357 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
10360 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
10361 * this divided by 1000.
10363 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
10366 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
10367 * this divided by 1000.
10369 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
10372 * The CLTV lock-time at which this HTLC expires.
10374 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
10377 * The CLTV lock-time at which this HTLC expires.
10379 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
10382 * The hash of the preimage which unlocks this HTLC.
10384 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
10387 * The hash of the preimage which unlocks this HTLC.
10389 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10392 * The position within the commitment transactions' outputs. This may be None if the value is
10393 * below the dust limit (in which case no output appears in the commitment transaction and the
10394 * value is spent to additional transaction fees).
10396 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
10399 * The position within the commitment transactions' outputs. This may be None if the value is
10400 * below the dust limit (in which case no output appears in the commitment transaction and the
10401 * value is spent to additional transaction fees).
10403 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
10406 * Constructs a new HTLCOutputInCommitment given each field
10408 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);
10411 * Creates a copy of the HTLCOutputInCommitment
10413 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
10416 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
10418 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
10421 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
10423 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
10426 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
10427 * does not need to have its previous_output_index filled.
10429 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys);
10432 * Gets the redeemscript for a funding output from the two funding public keys.
10433 * Note that the order of funding public keys does not matter.
10435 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
10438 * panics if htlc.transaction_output_index.is_none()!
10440 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);
10443 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
10445 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
10448 * Holder public keys
10450 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
10453 * Holder public keys
10455 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
10458 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
10460 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
10463 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
10465 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
10468 * Whether the holder is the initiator of this channel.
10469 * This is an input to the commitment number obscure factor computation.
10471 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
10474 * Whether the holder is the initiator of this channel.
10475 * This is an input to the commitment number obscure factor computation.
10477 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
10480 * The late-bound counterparty channel transaction parameters.
10481 * These parameters are populated at the point in the protocol where the counterparty provides them.
10483 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
10486 * The late-bound counterparty channel transaction parameters.
10487 * These parameters are populated at the point in the protocol where the counterparty provides them.
10489 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
10492 * The late-bound funding outpoint
10494 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
10497 * The late-bound funding outpoint
10499 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
10502 * Constructs a new ChannelTransactionParameters given each field
10504 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);
10507 * Creates a copy of the ChannelTransactionParameters
10509 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
10512 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
10514 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
10517 * Counter-party public keys
10519 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
10522 * Counter-party public keys
10524 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
10527 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
10529 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
10532 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
10534 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
10537 * Constructs a new CounterpartyChannelTransactionParameters given each field
10539 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
10542 * Creates a copy of the CounterpartyChannelTransactionParameters
10544 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
10547 * Whether the late bound parameters are populated.
10549 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
10552 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
10553 * given that the holder is the broadcaster.
10555 * self.is_populated() must be true before calling this function.
10557 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
10560 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
10561 * given that the counterparty is the broadcaster.
10563 * self.is_populated() must be true before calling this function.
10565 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
10568 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
10570 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
10573 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
10575 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
10578 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
10580 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
10583 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
10585 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
10588 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
10590 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
10593 * Get the channel pubkeys for the broadcaster
10595 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
10598 * Get the channel pubkeys for the countersignatory
10600 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
10603 * Get the contest delay applicable to the transactions.
10604 * Note that the contest delay was selected by the countersignatory.
10606 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
10609 * Whether the channel is outbound from the broadcaster.
10611 * The boolean representing the side that initiated the channel is
10612 * an input to the commitment number obscure factor computation.
10614 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
10617 * The funding outpoint
10619 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
10622 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
10624 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
10627 * Our counterparty's signature for the transaction
10629 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
10632 * Our counterparty's signature for the transaction
10634 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
10637 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
10639 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
10642 * Creates a copy of the HolderCommitmentTransaction
10644 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
10647 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
10649 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
10652 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
10654 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
10657 * Create a new holder transaction with the given counterparty signatures.
10658 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
10660 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);
10663 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
10665 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
10668 * The commitment transaction
10670 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
10673 * The commitment transaction
10675 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
10678 * The txid for the commitment transaction.
10680 * This is provided as a performance optimization, instead of calling transaction.txid()
10683 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
10686 * The txid for the commitment transaction.
10688 * This is provided as a performance optimization, instead of calling transaction.txid()
10691 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10694 * Constructs a new BuiltCommitmentTransaction given each field
10696 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
10699 * Creates a copy of the BuiltCommitmentTransaction
10701 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
10704 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
10706 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
10709 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
10711 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
10714 * Get the SIGHASH_ALL sighash value of the transaction.
10716 * This can be used to verify a signature.
10718 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);
10721 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
10722 * because we are about to broadcast a holder transaction.
10724 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);
10727 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
10729 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
10732 * Creates a copy of the CommitmentTransaction
10734 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
10737 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
10739 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
10742 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
10744 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
10747 * The backwards-counting commitment number
10749 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
10752 * The value to be sent to the broadcaster
10754 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
10757 * The value to be sent to the counterparty
10759 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
10762 * The feerate paid per 1000-weight-unit in this commitment transaction.
10764 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
10767 * Trust our pre-built transaction and derived transaction creation public keys.
10769 * Applies a wrapper which allows access to these fields.
10771 * This should only be used if you fully trust the builder of this object. It should not
10772 *\tbe used by an external signer - instead use the verify function.
10774 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
10777 * Verify our pre-built transaction and derived transaction creation public keys.
10779 * Applies a wrapper which allows access to these fields.
10781 * An external validating signer must call this method before signing
10782 * or using the built transaction.
10784 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);
10787 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
10789 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
10792 * The transaction ID of the built Bitcoin transaction
10794 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
10797 * The pre-built Bitcoin commitment transaction
10799 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
10802 * The pre-calculated transaction creation public keys.
10804 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
10807 * Get a signature for each HTLC which was included in the commitment transaction (ie for
10808 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
10810 * The returned Vec has one entry for each HTLC, and in the same order.
10812 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);
10815 * Get the transaction number obscure factor
10817 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
10820 * Creates a copy of the InitFeatures
10822 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
10825 * Creates a copy of the NodeFeatures
10827 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
10830 * Creates a copy of the ChannelFeatures
10832 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
10835 * Creates a copy of the InvoiceFeatures
10837 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
10840 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
10842 void InitFeatures_free(struct LDKInitFeatures this_obj);
10845 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
10847 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
10850 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
10852 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
10855 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
10857 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
10860 * Create a blank Features with no features set
10862 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
10865 * Creates a Features with the bits set which are known by the implementation
10867 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
10870 * Create a blank Features with no features set
10872 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
10875 * Creates a Features with the bits set which are known by the implementation
10877 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
10880 * Create a blank Features with no features set
10882 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
10885 * Creates a Features with the bits set which are known by the implementation
10887 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
10890 * Create a blank Features with no features set
10892 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
10895 * Creates a Features with the bits set which are known by the implementation
10897 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
10900 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
10902 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
10905 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
10907 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
10910 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
10912 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
10915 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
10917 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
10920 * Read a InitFeatures from a byte array, created by InitFeatures_write
10922 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
10925 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
10927 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
10930 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
10932 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
10935 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
10937 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
10940 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
10942 void RouteHop_free(struct LDKRouteHop this_obj);
10945 * The node_id of the node at this hop.
10947 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
10950 * The node_id of the node at this hop.
10952 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10955 * The node_announcement features of the node at this hop. For the last hop, these may be
10956 * amended to match the features present in the invoice this node generated.
10958 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
10961 * The node_announcement features of the node at this hop. For the last hop, these may be
10962 * amended to match the features present in the invoice this node generated.
10964 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
10967 * The channel that should be used from the previous hop to reach this node.
10969 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
10972 * The channel that should be used from the previous hop to reach this node.
10974 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
10977 * The channel_announcement features of the channel that should be used from the previous hop
10978 * to reach this node.
10980 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
10983 * The channel_announcement features of the channel that should be used from the previous hop
10984 * to reach this node.
10986 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
10989 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
10990 * For the last hop, this should be the full value of the payment (might be more than
10991 * requested if we had to match htlc_minimum_msat).
10993 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
10996 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
10997 * For the last hop, this should be the full value of the payment (might be more than
10998 * requested if we had to match htlc_minimum_msat).
11000 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
11003 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
11004 * expected at the destination, in excess of the current block height.
11006 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
11009 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
11010 * expected at the destination, in excess of the current block height.
11012 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
11015 * Constructs a new RouteHop given each field
11017 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);
11020 * Creates a copy of the RouteHop
11022 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
11025 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
11027 void Route_free(struct LDKRoute this_obj);
11030 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
11031 * last RouteHop in each path must be the same.
11032 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
11033 * destination. Thus, this must always be at least length one. While the maximum length of any
11034 * given path is variable, keeping the length of any path to less than 20 should currently
11035 * ensure it is viable.
11037 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
11040 * Constructs a new Route given each field
11042 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
11045 * Creates a copy of the Route
11047 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
11050 * Serialize the Route object into a byte array which can be read by Route_read
11052 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
11055 * Read a Route from a byte array, created by Route_write
11057 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
11060 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
11062 void RouteHint_free(struct LDKRouteHint this_obj);
11065 * The node_id of the non-target end of the route
11067 struct LDKPublicKey RouteHint_get_src_node_id(const struct LDKRouteHint *NONNULL_PTR this_ptr);
11070 * The node_id of the non-target end of the route
11072 void RouteHint_set_src_node_id(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11075 * The short_channel_id of this channel
11077 uint64_t RouteHint_get_short_channel_id(const struct LDKRouteHint *NONNULL_PTR this_ptr);
11080 * The short_channel_id of this channel
11082 void RouteHint_set_short_channel_id(struct LDKRouteHint *NONNULL_PTR this_ptr, uint64_t val);
11085 * The fees which must be paid to use this channel
11087 struct LDKRoutingFees RouteHint_get_fees(const struct LDKRouteHint *NONNULL_PTR this_ptr);
11090 * The fees which must be paid to use this channel
11092 void RouteHint_set_fees(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
11095 * The difference in CLTV values between this node and the next node.
11097 uint16_t RouteHint_get_cltv_expiry_delta(const struct LDKRouteHint *NONNULL_PTR this_ptr);
11100 * The difference in CLTV values between this node and the next node.
11102 void RouteHint_set_cltv_expiry_delta(struct LDKRouteHint *NONNULL_PTR this_ptr, uint16_t val);
11105 * The minimum value, in msat, which must be relayed to the next hop.
11107 struct LDKCOption_u64Z RouteHint_get_htlc_minimum_msat(const struct LDKRouteHint *NONNULL_PTR this_ptr);
11110 * The minimum value, in msat, which must be relayed to the next hop.
11112 void RouteHint_set_htlc_minimum_msat(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
11115 * The maximum value in msat available for routing with a single HTLC.
11117 struct LDKCOption_u64Z RouteHint_get_htlc_maximum_msat(const struct LDKRouteHint *NONNULL_PTR this_ptr);
11120 * The maximum value in msat available for routing with a single HTLC.
11122 void RouteHint_set_htlc_maximum_msat(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
11125 * Constructs a new RouteHint given each field
11127 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);
11130 * Creates a copy of the RouteHint
11132 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
11135 * Gets a route from us (payer) to the given target node (payee).
11137 * If the payee provided features in their invoice, they should be provided via payee_features.
11138 * Without this, MPP will only be used if the payee's features are available in the network graph.
11140 * Extra routing hops between known nodes and the target will be used if they are included in
11143 * If some channels aren't announced, it may be useful to fill in a first_hops with the
11144 * results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
11145 * view of our local channels (from net_graph_msg_handler) will be ignored, and only those
11146 * in first_hops will be used.
11148 * Panics if first_hops contains channels without short_channel_ids
11149 * (ChannelManager::list_usable_channels will never include such channels).
11151 * The fees on channels from us to next-hops are ignored (as they are assumed to all be
11152 * equal), however the enabled/disabled bit on such channels as well as the
11153 * htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
11155 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);
11158 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
11160 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
11163 * Creates a copy of the NetworkGraph
11165 struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
11168 * Frees any resources used by the LockedNetworkGraph, if is_owned is set and inner is non-NULL.
11170 void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj);
11173 * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
11175 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
11178 * Creates a new tracker of the actual state of the network of channels and nodes,
11179 * assuming a fresh network graph.
11180 * Chain monitor is used to make sure announced channels exist on-chain,
11181 * channel data is correct, and that the announcement is signed with
11182 * channel owners' keys.
11184 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger);
11187 * Creates a new tracker of the actual state of the network of channels and nodes,
11188 * assuming an existing Network Graph.
11190 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph);
11193 * Adds a provider used to check new announcements. Does not affect
11194 * existing announcements unless they are updated.
11195 * Add, update or remove the provider would replace the current one.
11197 void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKAccess *chain_access);
11200 * Take a read lock on the network_graph and return it in the C-bindings
11201 * newtype helper. This is likely only useful when called via the C
11202 * bindings as you can call `self.network_graph.read().unwrap()` in Rust
11205 MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
11208 * Get a reference to the NetworkGraph which this read-lock contains.
11210 MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg);
11213 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
11214 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
11216 struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
11219 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
11220 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
11222 struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
11225 * Frees any resources used by the DirectionalChannelInfo, if is_owned is set and inner is non-NULL.
11227 void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_obj);
11230 * When the last update to the channel direction was issued.
11231 * Value is opaque, as set in the announcement.
11233 uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
11236 * When the last update to the channel direction was issued.
11237 * Value is opaque, as set in the announcement.
11239 void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val);
11242 * Whether the channel can be currently used for payments (in this one direction).
11244 bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
11247 * Whether the channel can be currently used for payments (in this one direction).
11249 void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, bool val);
11252 * The difference in CLTV values that you must have when routing through this channel.
11254 uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
11257 * The difference in CLTV values that you must have when routing through this channel.
11259 void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint16_t val);
11262 * The minimum value, which must be relayed to the next hop via the channel
11264 uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
11267 * The minimum value, which must be relayed to the next hop via the channel
11269 void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val);
11272 * The maximum value which may be relayed to the next hop via the channel.
11274 struct LDKCOption_u64Z DirectionalChannelInfo_get_htlc_maximum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
11277 * The maximum value which may be relayed to the next hop via the channel.
11279 void DirectionalChannelInfo_set_htlc_maximum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
11282 * Fees charged when the channel is used for routing
11284 struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
11287 * Fees charged when the channel is used for routing
11289 void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
11292 * Most recent update for the channel received from the network
11293 * Mostly redundant with the data we store in fields explicitly.
11294 * Everything else is useful only for sending out for initial routing sync.
11295 * Not stored if contains excess data to prevent DoS.
11297 struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
11300 * Most recent update for the channel received from the network
11301 * Mostly redundant with the data we store in fields explicitly.
11302 * Everything else is useful only for sending out for initial routing sync.
11303 * Not stored if contains excess data to prevent DoS.
11305 void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
11308 * Constructs a new DirectionalChannelInfo given each field
11310 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);
11313 * Creates a copy of the DirectionalChannelInfo
11315 struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig);
11318 * Serialize the DirectionalChannelInfo object into a byte array which can be read by DirectionalChannelInfo_read
11320 struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj);
11323 * Read a DirectionalChannelInfo from a byte array, created by DirectionalChannelInfo_write
11325 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser);
11328 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
11330 void ChannelInfo_free(struct LDKChannelInfo this_obj);
11333 * Protocol features of a channel communicated during its announcement
11335 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
11338 * Protocol features of a channel communicated during its announcement
11340 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
11343 * Source node of the first direction of a channel
11345 struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
11348 * Source node of the first direction of a channel
11350 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11353 * Details about the first direction of a channel
11355 struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
11358 * Details about the first direction of a channel
11360 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
11363 * Source node of the second direction of a channel
11365 struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
11368 * Source node of the second direction of a channel
11370 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11373 * Details about the second direction of a channel
11375 struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
11378 * Details about the second direction of a channel
11380 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
11383 * The channel capacity as seen on-chain, if chain lookup is available.
11385 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
11388 * The channel capacity as seen on-chain, if chain lookup is available.
11390 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
11393 * An initial announcement of the channel
11394 * Mostly redundant with the data we store in fields explicitly.
11395 * Everything else is useful only for sending out for initial routing sync.
11396 * Not stored if contains excess data to prevent DoS.
11398 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
11401 * An initial announcement of the channel
11402 * Mostly redundant with the data we store in fields explicitly.
11403 * Everything else is useful only for sending out for initial routing sync.
11404 * Not stored if contains excess data to prevent DoS.
11406 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
11409 * Constructs a new ChannelInfo given each field
11411 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);
11414 * Creates a copy of the ChannelInfo
11416 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
11419 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
11421 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
11424 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
11426 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
11429 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
11431 void RoutingFees_free(struct LDKRoutingFees this_obj);
11434 * Flat routing fee in satoshis
11436 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
11439 * Flat routing fee in satoshis
11441 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
11444 * Liquidity-based routing fee in millionths of a routed amount.
11445 * In other words, 10000 is 1%.
11447 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
11450 * Liquidity-based routing fee in millionths of a routed amount.
11451 * In other words, 10000 is 1%.
11453 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
11456 * Constructs a new RoutingFees given each field
11458 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
11461 * Creates a copy of the RoutingFees
11463 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
11466 * Read a RoutingFees from a byte array, created by RoutingFees_write
11468 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
11471 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
11473 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
11476 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
11478 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
11481 * Protocol features the node announced support for
11483 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
11486 * Protocol features the node announced support for
11488 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
11491 * When the last known update to the node state was issued.
11492 * Value is opaque, as set in the announcement.
11494 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
11497 * When the last known update to the node state was issued.
11498 * Value is opaque, as set in the announcement.
11500 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
11503 * Color assigned to the node
11505 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
11508 * Color assigned to the node
11510 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
11513 * Moniker assigned to the node.
11514 * May be invalid or malicious (eg control chars),
11515 * should not be exposed to the user.
11517 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
11520 * Moniker assigned to the node.
11521 * May be invalid or malicious (eg control chars),
11522 * should not be exposed to the user.
11524 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11527 * Internet-level addresses via which one can connect to the node
11529 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
11532 * An initial announcement of the node
11533 * Mostly redundant with the data we store in fields explicitly.
11534 * Everything else is useful only for sending out for initial routing sync.
11535 * Not stored if contains excess data to prevent DoS.
11537 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
11540 * An initial announcement of the node
11541 * Mostly redundant with the data we store in fields explicitly.
11542 * Everything else is useful only for sending out for initial routing sync.
11543 * Not stored if contains excess data to prevent DoS.
11545 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
11548 * Constructs a new NodeAnnouncementInfo given each field
11550 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);
11553 * Creates a copy of the NodeAnnouncementInfo
11555 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
11558 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
11560 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
11563 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
11565 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
11568 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
11570 void NodeInfo_free(struct LDKNodeInfo this_obj);
11573 * All valid channels a node has announced
11575 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
11578 * Lowest fees enabling routing via any of the enabled, known channels to a node.
11579 * The two fields (flat and proportional fee) are independent,
11580 * meaning they don't have to refer to the same channel.
11582 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
11585 * Lowest fees enabling routing via any of the enabled, known channels to a node.
11586 * The two fields (flat and proportional fee) are independent,
11587 * meaning they don't have to refer to the same channel.
11589 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
11592 * More information about a node from node_announcement.
11593 * Optional because we store a Node entry after learning about it from
11594 * a channel announcement, but before receiving a node announcement.
11596 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
11599 * More information about a node from node_announcement.
11600 * Optional because we store a Node entry after learning about it from
11601 * a channel announcement, but before receiving a node announcement.
11603 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
11606 * Constructs a new NodeInfo given each field
11608 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
11611 * Creates a copy of the NodeInfo
11613 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
11616 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
11618 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
11621 * Read a NodeInfo from a byte array, created by NodeInfo_write
11623 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
11626 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
11628 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
11631 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
11633 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
11636 * Creates a new, empty, network graph.
11638 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
11641 * For an already known node (from channel announcements), update its stored properties from a
11642 * given node announcement.
11644 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
11645 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
11646 * routing messages from a source using a protocol other than the lightning P2P protocol.
11648 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
11651 * For an already known node (from channel announcements), update its stored properties from a
11652 * given node announcement without verifying the associated signatures. Because we aren't
11653 * given the associated signatures here we cannot relay the node announcement to any of our
11656 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
11659 * Store or update channel info from a channel announcement.
11661 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
11662 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
11663 * routing messages from a source using a protocol other than the lightning P2P protocol.
11665 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
11666 * the corresponding UTXO exists on chain and is correctly-formatted.
11668 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);
11671 * Store or update channel info from a channel announcement without verifying the associated
11672 * signatures. Because we aren't given the associated signatures here we cannot relay the
11673 * channel announcement to any of our peers.
11675 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
11676 * the corresponding UTXO exists on chain and is correctly-formatted.
11678 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);
11681 * Close a channel if a corresponding HTLC fail was sent.
11682 * If permanent, removes a channel from the local storage.
11683 * May cause the removal of nodes too, if this was their last channel.
11684 * If not permanent, makes channels unavailable for routing.
11686 void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
11689 * For an already known (from announcement) channel, update info about one of the directions
11692 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
11693 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
11694 * routing messages from a source using a protocol other than the lightning P2P protocol.
11696 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
11699 * For an already known (from announcement) channel, update info about one of the directions
11700 * of the channel without verifying the associated signatures. Because we aren't given the
11701 * associated signatures here we cannot relay the channel update to any of our peers.
11703 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
11705 /* Text to put at the end of the generated file */