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 * [`Access`]: trait.Access.html
17 typedef enum LDKAccessError {
19 * The requested chain is unknown.
21 LDKAccessError_UnknownChain,
23 * The requested transaction doesn't exist or hasn't confirmed.
25 LDKAccessError_UnknownTx,
27 * Must be last for serialization purposes
29 LDKAccessError_Sentinel,
33 * An error enum representing a failure to persist a channel monitor update.
35 typedef enum LDKChannelMonitorUpdateErr {
37 * Used to indicate a temporary failure (eg connection to a watchtower or remote backup of
38 * our state failed, but is expected to succeed at some point in the future).
40 * Such a failure will \"freeze\" a channel, preventing us from revoking old states or
41 * submitting new commitment transactions to the counterparty. Once the update(s) which failed
42 * have been successfully applied, ChannelManager::channel_monitor_updated can be used to
43 * restore the channel to an operational state.
45 * Note that a given ChannelManager will *never* re-generate a given ChannelMonitorUpdate. If
46 * you return a TemporaryFailure you must ensure that it is written to disk safely before
47 * writing out the latest ChannelManager state.
49 * Even when a channel has been \"frozen\" updates to the ChannelMonitor can continue to occur
50 * (eg if an inbound HTLC which we forwarded was claimed upstream resulting in us attempting
51 * to claim it on this channel) and those updates must be applied wherever they can be. At
52 * least one such updated ChannelMonitor must be persisted otherwise PermanentFailure should
53 * be returned to get things on-chain ASAP using only the in-memory copy. Obviously updates to
54 * the channel which would invalidate previous ChannelMonitors are not made when a channel has
57 * Note that even if updates made after TemporaryFailure succeed you must still call
58 * channel_monitor_updated to ensure you have the latest monitor and re-enable normal channel
61 * Note that the update being processed here will not be replayed for you when you call
62 * ChannelManager::channel_monitor_updated, so you must store the update itself along
63 * with the persisted ChannelMonitor on your own local disk prior to returning a
64 * TemporaryFailure. You may, of course, employ a journaling approach, storing only the
65 * ChannelMonitorUpdate on disk without updating the monitor itself, replaying the journal at
68 * For deployments where a copy of ChannelMonitors and other local state are backed up in a
69 * remote location (with local copies persisted immediately), it is anticipated that all
70 * updates will return TemporaryFailure until the remote copies could be updated.
72 LDKChannelMonitorUpdateErr_TemporaryFailure,
74 * Used to indicate no further channel monitor updates will be allowed (eg we've moved on to a
75 * different watchtower and cannot update with all watchtowers that were previously informed
78 * At reception of this error, ChannelManager will force-close the channel and return at
79 * least a final ChannelMonitorUpdate::ChannelForceClosed which must be delivered to at
80 * least one ChannelMonitor copy. Revocation secret MUST NOT be released and offchain channel
81 * update must be rejected.
83 * This failure may also signal a failure to update the local persisted copy of one of
84 * the channel monitor instance.
86 * Note that even when you fail a holder commitment transaction update, you must store the
87 * update to ensure you can claim from it in case of a duplicate copy of this ChannelMonitor
88 * broadcasts it (e.g distributed channel-monitor deployment)
90 * In case of distributed watchtowers deployment, the new version must be written to disk, as
91 * state may have been stored but rejected due to a block forcing a commitment broadcast. This
92 * storage is used to claim outputs of rejected state confirmed onchain by another watchtower,
93 * lagging behind on block processing.
95 LDKChannelMonitorUpdateErr_PermanentFailure,
97 * Must be last for serialization purposes
99 LDKChannelMonitorUpdateErr_Sentinel,
100 } LDKChannelMonitorUpdateErr;
103 * An enum that represents the speed at which we want a transaction to confirm used for feerate
106 typedef enum LDKConfirmationTarget {
108 * We are happy with this transaction confirming slowly when feerate drops some.
110 LDKConfirmationTarget_Background,
112 * We'd like this transaction to confirm without major delay, but 12-18 blocks is fine.
114 LDKConfirmationTarget_Normal,
116 * We'd like this transaction to confirm in the next few blocks.
118 LDKConfirmationTarget_HighPriority,
120 * Must be last for serialization purposes
122 LDKConfirmationTarget_Sentinel,
123 } LDKConfirmationTarget;
126 * An enum representing the available verbosity levels of the logger.
128 typedef enum LDKLevel {
130 *Designates logger being silent
134 * Designates very serious errors
138 * Designates hazardous situations
142 * Designates useful information
146 * Designates lower priority information
150 * Designates very low priority, often extremely verbose, information
154 * Must be last for serialization purposes
159 typedef enum LDKNetwork {
165 * Must be last for serialization purposes
170 typedef enum LDKSecp256k1Error {
171 LDKSecp256k1Error_IncorrectSignature,
172 LDKSecp256k1Error_InvalidMessage,
173 LDKSecp256k1Error_InvalidPublicKey,
174 LDKSecp256k1Error_InvalidSignature,
175 LDKSecp256k1Error_InvalidSecretKey,
176 LDKSecp256k1Error_InvalidRecoveryId,
177 LDKSecp256k1Error_InvalidTweak,
178 LDKSecp256k1Error_TweakCheckFailed,
179 LDKSecp256k1Error_NotEnoughMemory,
181 * Must be last for serialization purposes
183 LDKSecp256k1Error_Sentinel,
187 * A serialized transaction, in (pointer, length) form.
189 * This type optionally owns its own memory, and thus the semantics around access change based on
190 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
191 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
192 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
193 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
194 * you would be invalid.
196 * Note that, while it may change in the future, because transactions on the Rust side are stored
197 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
198 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
199 * `data_is_owned` either set or unset at your discretion.
201 typedef struct LDKTransaction {
203 * This is non-const for your convenience, an object passed to Rust is never written to.
210 typedef struct LDKCVec_u8Z {
216 * A transaction output including a scriptPubKey and value.
217 * This type *does* own its own memory, so must be free'd appropriately.
219 typedef struct LDKTxOut {
220 struct LDKCVec_u8Z script_pubkey;
224 typedef struct LDKSecretKey {
228 typedef union LDKCResult_SecretKeyErrorZPtr {
229 struct LDKSecretKey *result;
230 enum LDKSecp256k1Error *err;
231 } LDKCResult_SecretKeyErrorZPtr;
233 typedef struct LDKCResult_SecretKeyErrorZ {
234 union LDKCResult_SecretKeyErrorZPtr contents;
236 } LDKCResult_SecretKeyErrorZ;
238 typedef struct LDKPublicKey {
239 uint8_t compressed_form[33];
242 typedef union LDKCResult_PublicKeyErrorZPtr {
243 struct LDKPublicKey *result;
244 enum LDKSecp256k1Error *err;
245 } LDKCResult_PublicKeyErrorZPtr;
247 typedef struct LDKCResult_PublicKeyErrorZ {
248 union LDKCResult_PublicKeyErrorZPtr contents;
250 } LDKCResult_PublicKeyErrorZ;
255 * The set of public keys which are used in the creation of one commitment transaction.
256 * These are derived from the channel base keys and per-commitment data.
258 * A broadcaster key is provided from potential broadcaster of the computed transaction.
259 * A countersignatory key is coming from a protocol participant unable to broadcast the
262 * These keys are assumed to be good, either because the code derived them from
263 * channel basepoints via the new function, or they were obtained via
264 * CommitmentTransaction.trust().keys() because we trusted the source of the
265 * pre-calculated keys.
267 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
269 * A pointer to the opaque Rust object.
270 * Nearly everywhere, inner must be non-null, however in places where
271 * the Rust equivalent takes an Option, it may be set to null to indicate None.
273 LDKnativeTxCreationKeys *inner;
275 * Indicates that this is the only struct which contains the same pointer.
276 * Rust functions which take ownership of an object provided via an argument require
277 * this to be true and invalidate the object pointed to by inner.
285 * An error in decoding a message or struct.
287 typedef struct MUST_USE_STRUCT LDKDecodeError {
289 * A pointer to the opaque Rust object.
290 * Nearly everywhere, inner must be non-null, however in places where
291 * the Rust equivalent takes an Option, it may be set to null to indicate None.
293 LDKnativeDecodeError *inner;
295 * Indicates that this is the only struct which contains the same pointer.
296 * Rust functions which take ownership of an object provided via an argument require
297 * this to be true and invalidate the object pointed to by inner.
302 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
303 struct LDKTxCreationKeys *result;
304 struct LDKDecodeError *err;
305 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
307 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
308 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
310 } LDKCResult_TxCreationKeysDecodeErrorZ;
315 * One counterparty's public keys which do not change over the life of a channel.
317 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
319 * A pointer to the opaque Rust object.
320 * Nearly everywhere, inner must be non-null, however in places where
321 * the Rust equivalent takes an Option, it may be set to null to indicate None.
323 LDKnativeChannelPublicKeys *inner;
325 * Indicates that this is the only struct which contains the same pointer.
326 * Rust functions which take ownership of an object provided via an argument require
327 * this to be true and invalidate the object pointed to by inner.
330 } LDKChannelPublicKeys;
332 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
333 struct LDKChannelPublicKeys *result;
334 struct LDKDecodeError *err;
335 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
337 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
338 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
340 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
342 typedef union LDKCResult_TxCreationKeysErrorZPtr {
343 struct LDKTxCreationKeys *result;
344 enum LDKSecp256k1Error *err;
345 } LDKCResult_TxCreationKeysErrorZPtr;
347 typedef struct LDKCResult_TxCreationKeysErrorZ {
348 union LDKCResult_TxCreationKeysErrorZPtr contents;
350 } LDKCResult_TxCreationKeysErrorZ;
355 * Information about an HTLC as it appears in a commitment transaction
357 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
359 * A pointer to the opaque Rust object.
360 * Nearly everywhere, inner must be non-null, however in places where
361 * the Rust equivalent takes an Option, it may be set to null to indicate None.
363 LDKnativeHTLCOutputInCommitment *inner;
365 * Indicates that this is the only struct which contains the same pointer.
366 * Rust functions which take ownership of an object provided via an argument require
367 * this to be true and invalidate the object pointed to by inner.
370 } LDKHTLCOutputInCommitment;
372 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
373 struct LDKHTLCOutputInCommitment *result;
374 struct LDKDecodeError *err;
375 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
377 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
378 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
380 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
385 * Late-bound per-channel counterparty data used to build transactions.
387 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
389 * A pointer to the opaque Rust object.
390 * Nearly everywhere, inner must be non-null, however in places where
391 * the Rust equivalent takes an Option, it may be set to null to indicate None.
393 LDKnativeCounterpartyChannelTransactionParameters *inner;
395 * Indicates that this is the only struct which contains the same pointer.
396 * Rust functions which take ownership of an object provided via an argument require
397 * this to be true and invalidate the object pointed to by inner.
400 } LDKCounterpartyChannelTransactionParameters;
402 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
403 struct LDKCounterpartyChannelTransactionParameters *result;
404 struct LDKDecodeError *err;
405 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
407 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
408 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
410 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
415 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
416 * The fields are organized by holder/counterparty.
418 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
419 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
421 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
423 * A pointer to the opaque Rust object.
424 * Nearly everywhere, inner must be non-null, however in places where
425 * the Rust equivalent takes an Option, it may be set to null to indicate None.
427 LDKnativeChannelTransactionParameters *inner;
429 * Indicates that this is the only struct which contains the same pointer.
430 * Rust functions which take ownership of an object provided via an argument require
431 * this to be true and invalidate the object pointed to by inner.
434 } LDKChannelTransactionParameters;
436 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
437 struct LDKChannelTransactionParameters *result;
438 struct LDKDecodeError *err;
439 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
441 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
442 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
444 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
446 typedef struct LDKSignature {
447 uint8_t compact_form[64];
450 typedef struct LDKCVec_SignatureZ {
451 struct LDKSignature *data;
453 } LDKCVec_SignatureZ;
458 * Information needed to build and sign a holder's commitment transaction.
460 * The transaction is only signed once we are ready to broadcast.
462 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
464 * A pointer to the opaque Rust object.
465 * Nearly everywhere, inner must be non-null, however in places where
466 * the Rust equivalent takes an Option, it may be set to null to indicate None.
468 LDKnativeHolderCommitmentTransaction *inner;
470 * Indicates that this is the only struct which contains the same pointer.
471 * Rust functions which take ownership of an object provided via an argument require
472 * this to be true and invalidate the object pointed to by inner.
475 } LDKHolderCommitmentTransaction;
477 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
478 struct LDKHolderCommitmentTransaction *result;
479 struct LDKDecodeError *err;
480 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
482 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
483 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
485 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
490 * A pre-built Bitcoin commitment transaction and its txid.
492 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
494 * A pointer to the opaque Rust object.
495 * Nearly everywhere, inner must be non-null, however in places where
496 * the Rust equivalent takes an Option, it may be set to null to indicate None.
498 LDKnativeBuiltCommitmentTransaction *inner;
500 * Indicates that this is the only struct which contains the same pointer.
501 * Rust functions which take ownership of an object provided via an argument require
502 * this to be true and invalidate the object pointed to by inner.
505 } LDKBuiltCommitmentTransaction;
507 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
508 struct LDKBuiltCommitmentTransaction *result;
509 struct LDKDecodeError *err;
510 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
512 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
513 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
515 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
520 * This class tracks the per-transaction information needed to build a commitment transaction and to
521 * actually build it and sign. It is used for holder transactions that we sign only when needed
522 * and for transactions we sign for the counterparty.
524 * This class can be used inside a signer implementation to generate a signature given the relevant
527 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
529 * A pointer to the opaque Rust object.
530 * Nearly everywhere, inner must be non-null, however in places where
531 * the Rust equivalent takes an Option, it may be set to null to indicate None.
533 LDKnativeCommitmentTransaction *inner;
535 * Indicates that this is the only struct which contains the same pointer.
536 * Rust functions which take ownership of an object provided via an argument require
537 * this to be true and invalidate the object pointed to by inner.
540 } LDKCommitmentTransaction;
542 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
543 struct LDKCommitmentTransaction *result;
544 struct LDKDecodeError *err;
545 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
547 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
548 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
550 } LDKCResult_CommitmentTransactionDecodeErrorZ;
555 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
556 * transaction and the transaction creation keys) are trusted.
558 * See trust() and verify() functions on CommitmentTransaction.
560 * This structure implements Deref.
562 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
564 * A pointer to the opaque Rust object.
565 * Nearly everywhere, inner must be non-null, however in places where
566 * the Rust equivalent takes an Option, it may be set to null to indicate None.
568 LDKnativeTrustedCommitmentTransaction *inner;
570 * Indicates that this is the only struct which contains the same pointer.
571 * Rust functions which take ownership of an object provided via an argument require
572 * this to be true and invalidate the object pointed to by inner.
575 } LDKTrustedCommitmentTransaction;
577 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
578 struct LDKTrustedCommitmentTransaction *result;
580 * Note that this value is always NULL, as there are no contents in the Err variant
583 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
585 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
586 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
588 } LDKCResult_TrustedCommitmentTransactionNoneZ;
590 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
591 struct LDKCVec_SignatureZ *result;
593 * Note that this value is always NULL, as there are no contents in the Err variant
596 } LDKCResult_CVec_SignatureZNoneZPtr;
598 typedef struct LDKCResult_CVec_SignatureZNoneZ {
599 union LDKCResult_CVec_SignatureZNoneZPtr contents;
601 } LDKCResult_CVec_SignatureZNoneZ;
606 * An accept_channel message to be sent or received from a peer
608 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
610 * A pointer to the opaque Rust object.
611 * Nearly everywhere, inner must be non-null, however in places where
612 * the Rust equivalent takes an Option, it may be set to null to indicate None.
614 LDKnativeAcceptChannel *inner;
616 * Indicates that this is the only struct which contains the same pointer.
617 * Rust functions which take ownership of an object provided via an argument require
618 * this to be true and invalidate the object pointed to by inner.
626 * An open_channel message to be sent or received from a peer
628 typedef struct MUST_USE_STRUCT LDKOpenChannel {
630 * A pointer to the opaque Rust object.
631 * Nearly everywhere, inner must be non-null, however in places where
632 * the Rust equivalent takes an Option, it may be set to null to indicate None.
634 LDKnativeOpenChannel *inner;
636 * Indicates that this is the only struct which contains the same pointer.
637 * Rust functions which take ownership of an object provided via an argument require
638 * this to be true and invalidate the object pointed to by inner.
646 * A funding_created message to be sent or received from a peer
648 typedef struct MUST_USE_STRUCT LDKFundingCreated {
650 * A pointer to the opaque Rust object.
651 * Nearly everywhere, inner must be non-null, however in places where
652 * the Rust equivalent takes an Option, it may be set to null to indicate None.
654 LDKnativeFundingCreated *inner;
656 * Indicates that this is the only struct which contains the same pointer.
657 * Rust functions which take ownership of an object provided via an argument require
658 * this to be true and invalidate the object pointed to by inner.
666 * A funding_signed message to be sent or received from a peer
668 typedef struct MUST_USE_STRUCT LDKFundingSigned {
670 * A pointer to the opaque Rust object.
671 * Nearly everywhere, inner must be non-null, however in places where
672 * the Rust equivalent takes an Option, it may be set to null to indicate None.
674 LDKnativeFundingSigned *inner;
676 * Indicates that this is the only struct which contains the same pointer.
677 * Rust functions which take ownership of an object provided via an argument require
678 * this to be true and invalidate the object pointed to by inner.
686 * A funding_locked message to be sent or received from a peer
688 typedef struct MUST_USE_STRUCT LDKFundingLocked {
690 * A pointer to the opaque Rust object.
691 * Nearly everywhere, inner must be non-null, however in places where
692 * the Rust equivalent takes an Option, it may be set to null to indicate None.
694 LDKnativeFundingLocked *inner;
696 * Indicates that this is the only struct which contains the same pointer.
697 * Rust functions which take ownership of an object provided via an argument require
698 * this to be true and invalidate the object pointed to by inner.
706 * An announcement_signatures message to be sent or received from a peer
708 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
710 * A pointer to the opaque Rust object.
711 * Nearly everywhere, inner must be non-null, however in places where
712 * the Rust equivalent takes an Option, it may be set to null to indicate None.
714 LDKnativeAnnouncementSignatures *inner;
716 * Indicates that this is the only struct which contains the same pointer.
717 * Rust functions which take ownership of an object provided via an argument require
718 * this to be true and invalidate the object pointed to by inner.
721 } LDKAnnouncementSignatures;
726 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
727 * transaction updates if they were pending.
729 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
731 * A pointer to the opaque Rust object.
732 * Nearly everywhere, inner must be non-null, however in places where
733 * the Rust equivalent takes an Option, it may be set to null to indicate None.
735 LDKnativeCommitmentUpdate *inner;
737 * Indicates that this is the only struct which contains the same pointer.
738 * Rust functions which take ownership of an object provided via an argument require
739 * this to be true and invalidate the object pointed to by inner.
742 } LDKCommitmentUpdate;
747 * A revoke_and_ack message to be sent or received from a peer
749 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
751 * A pointer to the opaque Rust object.
752 * Nearly everywhere, inner must be non-null, however in places where
753 * the Rust equivalent takes an Option, it may be set to null to indicate None.
755 LDKnativeRevokeAndACK *inner;
757 * Indicates that this is the only struct which contains the same pointer.
758 * Rust functions which take ownership of an object provided via an argument require
759 * this to be true and invalidate the object pointed to by inner.
767 * A closing_signed message to be sent or received from a peer
769 typedef struct MUST_USE_STRUCT LDKClosingSigned {
771 * A pointer to the opaque Rust object.
772 * Nearly everywhere, inner must be non-null, however in places where
773 * the Rust equivalent takes an Option, it may be set to null to indicate None.
775 LDKnativeClosingSigned *inner;
777 * Indicates that this is the only struct which contains the same pointer.
778 * Rust functions which take ownership of an object provided via an argument require
779 * this to be true and invalidate the object pointed to by inner.
787 * A shutdown message to be sent or received from a peer
789 typedef struct MUST_USE_STRUCT LDKShutdown {
791 * A pointer to the opaque Rust object.
792 * Nearly everywhere, inner must be non-null, however in places where
793 * the Rust equivalent takes an Option, it may be set to null to indicate None.
795 LDKnativeShutdown *inner;
797 * Indicates that this is the only struct which contains the same pointer.
798 * Rust functions which take ownership of an object provided via an argument require
799 * this to be true and invalidate the object pointed to by inner.
807 * A channel_reestablish message to be sent or received from a peer
809 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
811 * A pointer to the opaque Rust object.
812 * Nearly everywhere, inner must be non-null, however in places where
813 * the Rust equivalent takes an Option, it may be set to null to indicate None.
815 LDKnativeChannelReestablish *inner;
817 * Indicates that this is the only struct which contains the same pointer.
818 * Rust functions which take ownership of an object provided via an argument require
819 * this to be true and invalidate the object pointed to by inner.
822 } LDKChannelReestablish;
827 * A channel_announcement message to be sent or received from a peer
829 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
831 * A pointer to the opaque Rust object.
832 * Nearly everywhere, inner must be non-null, however in places where
833 * the Rust equivalent takes an Option, it may be set to null to indicate None.
835 LDKnativeChannelAnnouncement *inner;
837 * Indicates that this is the only struct which contains the same pointer.
838 * Rust functions which take ownership of an object provided via an argument require
839 * this to be true and invalidate the object pointed to by inner.
842 } LDKChannelAnnouncement;
847 * A channel_update message to be sent or received from a peer
849 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
851 * A pointer to the opaque Rust object.
852 * Nearly everywhere, inner must be non-null, however in places where
853 * the Rust equivalent takes an Option, it may be set to null to indicate None.
855 LDKnativeChannelUpdate *inner;
857 * Indicates that this is the only struct which contains the same pointer.
858 * Rust functions which take ownership of an object provided via an argument require
859 * this to be true and invalidate the object pointed to by inner.
867 * A node_announcement message to be sent or received from a peer
869 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
871 * A pointer to the opaque Rust object.
872 * Nearly everywhere, inner must be non-null, however in places where
873 * the Rust equivalent takes an Option, it may be set to null to indicate None.
875 LDKnativeNodeAnnouncement *inner;
877 * Indicates that this is the only struct which contains the same pointer.
878 * Rust functions which take ownership of an object provided via an argument require
879 * this to be true and invalidate the object pointed to by inner.
882 } LDKNodeAnnouncement;
887 * An error message to be sent or received from a peer
889 typedef struct MUST_USE_STRUCT LDKErrorMessage {
891 * A pointer to the opaque Rust object.
892 * Nearly everywhere, inner must be non-null, however in places where
893 * the Rust equivalent takes an Option, it may be set to null to indicate None.
895 LDKnativeErrorMessage *inner;
897 * Indicates that this is the only struct which contains the same pointer.
898 * Rust functions which take ownership of an object provided via an argument require
899 * this to be true and invalidate the object pointed to by inner.
905 * Used to put an error message in a LightningError
907 typedef enum LDKErrorAction_Tag {
909 * The peer took some action which made us think they were useless. Disconnect them.
911 LDKErrorAction_DisconnectPeer,
913 * The peer did something harmless that we weren't able to process, just log and ignore
915 LDKErrorAction_IgnoreError,
917 * The peer did something incorrect. Tell them.
919 LDKErrorAction_SendErrorMessage,
921 * Must be last for serialization purposes
923 LDKErrorAction_Sentinel,
924 } LDKErrorAction_Tag;
926 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
928 * An error message which we should make an effort to send before we disconnect.
930 struct LDKErrorMessage msg;
931 } LDKErrorAction_LDKDisconnectPeer_Body;
933 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
935 * The message to send.
937 struct LDKErrorMessage msg;
938 } LDKErrorAction_LDKSendErrorMessage_Body;
940 typedef struct MUST_USE_STRUCT LDKErrorAction {
941 LDKErrorAction_Tag tag;
943 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
944 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
949 * The information we received from a peer along the route of a payment we originated. This is
950 * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
951 * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
953 typedef enum LDKHTLCFailChannelUpdate_Tag {
955 * We received an error which included a full ChannelUpdate message.
957 LDKHTLCFailChannelUpdate_ChannelUpdateMessage,
959 * We received an error which indicated only that a channel has been closed
961 LDKHTLCFailChannelUpdate_ChannelClosed,
963 * We received an error which indicated only that a node has failed
965 LDKHTLCFailChannelUpdate_NodeFailure,
967 * Must be last for serialization purposes
969 LDKHTLCFailChannelUpdate_Sentinel,
970 } LDKHTLCFailChannelUpdate_Tag;
972 typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body {
974 * The unwrapped message we received
976 struct LDKChannelUpdate msg;
977 } LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
979 typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
981 * The short_channel_id which has now closed.
983 uint64_t short_channel_id;
985 * when this true, this channel should be permanently removed from the
986 * consideration. Otherwise, this channel can be restored as new channel_update is received
989 } LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
991 typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
993 * The node_id that has failed.
995 struct LDKPublicKey node_id;
997 * when this true, node should be permanently removed from the
998 * consideration. Otherwise, the channels connected to this node can be
999 * restored as new channel_update is received
1002 } LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
1004 typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate {
1005 LDKHTLCFailChannelUpdate_Tag tag;
1007 LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message;
1008 LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed;
1009 LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure;
1011 } LDKHTLCFailChannelUpdate;
1016 * A query_channel_range message is used to query a peer for channel
1017 * UTXOs in a range of blocks. The recipient of a query makes a best
1018 * effort to reply to the query using one or more reply_channel_range
1021 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
1023 * A pointer to the opaque Rust object.
1024 * Nearly everywhere, inner must be non-null, however in places where
1025 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1027 LDKnativeQueryChannelRange *inner;
1029 * Indicates that this is the only struct which contains the same pointer.
1030 * Rust functions which take ownership of an object provided via an argument require
1031 * this to be true and invalidate the object pointed to by inner.
1034 } LDKQueryChannelRange;
1039 * A query_short_channel_ids message is used to query a peer for
1040 * routing gossip messages related to one or more short_channel_ids.
1041 * The query recipient will reply with the latest, if available,
1042 * channel_announcement, channel_update and node_announcement messages
1043 * it maintains for the requested short_channel_ids followed by a
1044 * reply_short_channel_ids_end message. The short_channel_ids sent in
1045 * this query are encoded. We only support encoding_type=0 uncompressed
1046 * serialization and do not support encoding_type=1 zlib serialization.
1048 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
1050 * A pointer to the opaque Rust object.
1051 * Nearly everywhere, inner must be non-null, however in places where
1052 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1054 LDKnativeQueryShortChannelIds *inner;
1056 * Indicates that this is the only struct which contains the same pointer.
1057 * Rust functions which take ownership of an object provided via an argument require
1058 * this to be true and invalidate the object pointed to by inner.
1061 } LDKQueryShortChannelIds;
1064 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
1065 * broadcast to most peers).
1066 * These events are handled by PeerManager::process_events if you are using a PeerManager.
1068 typedef enum LDKMessageSendEvent_Tag {
1070 * Used to indicate that we've accepted a channel open and should send the accept_channel
1071 * message provided to the given peer.
1073 LDKMessageSendEvent_SendAcceptChannel,
1075 * Used to indicate that we've initiated a channel open and should send the open_channel
1076 * message provided to the given peer.
1078 LDKMessageSendEvent_SendOpenChannel,
1080 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
1082 LDKMessageSendEvent_SendFundingCreated,
1084 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
1086 LDKMessageSendEvent_SendFundingSigned,
1088 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
1090 LDKMessageSendEvent_SendFundingLocked,
1092 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
1094 LDKMessageSendEvent_SendAnnouncementSignatures,
1096 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
1097 * message should be sent to the peer with the given node_id.
1099 LDKMessageSendEvent_UpdateHTLCs,
1101 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
1103 LDKMessageSendEvent_SendRevokeAndACK,
1105 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
1107 LDKMessageSendEvent_SendClosingSigned,
1109 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
1111 LDKMessageSendEvent_SendShutdown,
1113 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
1115 LDKMessageSendEvent_SendChannelReestablish,
1117 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
1118 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
1120 * Note that after doing so, you very likely (unless you did so very recently) want to call
1121 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
1122 * This ensures that any nodes which see our channel_announcement also have a relevant
1123 * node_announcement, including relevant feature flags which may be important for routing
1126 LDKMessageSendEvent_BroadcastChannelAnnouncement,
1128 * Used to indicate that a node_announcement should be broadcast to all peers.
1130 LDKMessageSendEvent_BroadcastNodeAnnouncement,
1132 * Used to indicate that a channel_update should be broadcast to all peers.
1134 LDKMessageSendEvent_BroadcastChannelUpdate,
1136 * Broadcast an error downstream to be handled
1138 LDKMessageSendEvent_HandleError,
1140 * When a payment fails we may receive updates back from the hop where it failed. In such
1141 * cases this event is generated so that we can inform the network graph of this information.
1143 LDKMessageSendEvent_PaymentFailureNetworkUpdate,
1145 * Query a peer for channels with funding transaction UTXOs in a block range.
1147 LDKMessageSendEvent_SendChannelRangeQuery,
1149 * Request routing gossip messages from a peer for a list of channels identified by
1150 * their short_channel_ids.
1152 LDKMessageSendEvent_SendShortIdsQuery,
1154 * Must be last for serialization purposes
1156 LDKMessageSendEvent_Sentinel,
1157 } LDKMessageSendEvent_Tag;
1159 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
1161 * The node_id of the node which should receive this message
1163 struct LDKPublicKey node_id;
1165 * The message which should be sent.
1167 struct LDKAcceptChannel msg;
1168 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
1170 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
1172 * The node_id of the node which should receive this message
1174 struct LDKPublicKey node_id;
1176 * The message which should be sent.
1178 struct LDKOpenChannel msg;
1179 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
1181 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
1183 * The node_id of the node which should receive this message
1185 struct LDKPublicKey node_id;
1187 * The message which should be sent.
1189 struct LDKFundingCreated msg;
1190 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
1192 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
1194 * The node_id of the node which should receive this message
1196 struct LDKPublicKey node_id;
1198 * The message which should be sent.
1200 struct LDKFundingSigned msg;
1201 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
1203 typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
1205 * The node_id of the node which should receive these message(s)
1207 struct LDKPublicKey node_id;
1209 * The funding_locked message which should be sent.
1211 struct LDKFundingLocked msg;
1212 } LDKMessageSendEvent_LDKSendFundingLocked_Body;
1214 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
1216 * The node_id of the node which should receive these message(s)
1218 struct LDKPublicKey node_id;
1220 * The announcement_signatures message which should be sent.
1222 struct LDKAnnouncementSignatures msg;
1223 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
1225 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
1227 * The node_id of the node which should receive these message(s)
1229 struct LDKPublicKey node_id;
1231 * The update messages which should be sent. ALL messages in the struct should be sent!
1233 struct LDKCommitmentUpdate updates;
1234 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
1236 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
1238 * The node_id of the node which should receive this message
1240 struct LDKPublicKey node_id;
1242 * The message which should be sent.
1244 struct LDKRevokeAndACK msg;
1245 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
1247 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
1249 * The node_id of the node which should receive this message
1251 struct LDKPublicKey node_id;
1253 * The message which should be sent.
1255 struct LDKClosingSigned msg;
1256 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
1258 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
1260 * The node_id of the node which should receive this message
1262 struct LDKPublicKey node_id;
1264 * The message which should be sent.
1266 struct LDKShutdown msg;
1267 } LDKMessageSendEvent_LDKSendShutdown_Body;
1269 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
1271 * The node_id of the node which should receive this message
1273 struct LDKPublicKey node_id;
1275 * The message which should be sent.
1277 struct LDKChannelReestablish msg;
1278 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
1280 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
1282 * The channel_announcement which should be sent.
1284 struct LDKChannelAnnouncement msg;
1286 * The followup channel_update which should be sent.
1288 struct LDKChannelUpdate update_msg;
1289 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
1291 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
1293 * The node_announcement which should be sent.
1295 struct LDKNodeAnnouncement msg;
1296 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
1298 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
1300 * The channel_update which should be sent.
1302 struct LDKChannelUpdate msg;
1303 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
1305 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
1307 * The node_id of the node which should receive this message
1309 struct LDKPublicKey node_id;
1311 * The action which should be taken.
1313 struct LDKErrorAction action;
1314 } LDKMessageSendEvent_LDKHandleError_Body;
1316 typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
1318 * The channel/node update which should be sent to NetGraphMsgHandler
1320 struct LDKHTLCFailChannelUpdate update;
1321 } LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
1323 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
1325 * The node_id of this message recipient
1327 struct LDKPublicKey node_id;
1329 * The query_channel_range which should be sent.
1331 struct LDKQueryChannelRange msg;
1332 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
1334 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
1336 * The node_id of this message recipient
1338 struct LDKPublicKey node_id;
1340 * The query_short_channel_ids which should be sent.
1342 struct LDKQueryShortChannelIds msg;
1343 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
1345 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
1346 LDKMessageSendEvent_Tag tag;
1348 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
1349 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
1350 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
1351 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
1352 LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
1353 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
1354 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
1355 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
1356 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
1357 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
1358 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
1359 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
1360 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
1361 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
1362 LDKMessageSendEvent_LDKHandleError_Body handle_error;
1363 LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update;
1364 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
1365 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
1367 } LDKMessageSendEvent;
1369 typedef struct LDKCVec_MessageSendEventZ {
1370 struct LDKMessageSendEvent *data;
1372 } LDKCVec_MessageSendEventZ;
1377 * An Err type for failure to process messages.
1379 typedef struct MUST_USE_STRUCT LDKLightningError {
1381 * A pointer to the opaque Rust object.
1382 * Nearly everywhere, inner must be non-null, however in places where
1383 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1385 LDKnativeLightningError *inner;
1387 * Indicates that this is the only struct which contains the same pointer.
1388 * Rust functions which take ownership of an object provided via an argument require
1389 * this to be true and invalidate the object pointed to by inner.
1392 } LDKLightningError;
1394 typedef union LDKCResult_boolLightningErrorZPtr {
1396 struct LDKLightningError *err;
1397 } LDKCResult_boolLightningErrorZPtr;
1399 typedef struct LDKCResult_boolLightningErrorZ {
1400 union LDKCResult_boolLightningErrorZPtr contents;
1402 } LDKCResult_boolLightningErrorZ;
1404 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
1405 struct LDKChannelAnnouncement a;
1406 struct LDKChannelUpdate b;
1407 struct LDKChannelUpdate c;
1408 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
1410 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
1411 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
1413 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
1415 typedef struct LDKCVec_NodeAnnouncementZ {
1416 struct LDKNodeAnnouncement *data;
1418 } LDKCVec_NodeAnnouncementZ;
1420 typedef union LDKCResult_NoneLightningErrorZPtr {
1422 * Note that this value is always NULL, as there are no contents in the OK variant
1425 struct LDKLightningError *err;
1426 } LDKCResult_NoneLightningErrorZPtr;
1428 typedef struct LDKCResult_NoneLightningErrorZ {
1429 union LDKCResult_NoneLightningErrorZPtr contents;
1431 } LDKCResult_NoneLightningErrorZ;
1433 typedef struct LDKCVec_PublicKeyZ {
1434 struct LDKPublicKey *data;
1436 } LDKCVec_PublicKeyZ;
1441 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
1442 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
1445 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
1447 * A pointer to the opaque Rust object.
1448 * Nearly everywhere, inner must be non-null, however in places where
1449 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1451 LDKnativePeerHandleError *inner;
1453 * Indicates that this is the only struct which contains the same pointer.
1454 * Rust functions which take ownership of an object provided via an argument require
1455 * this to be true and invalidate the object pointed to by inner.
1458 } LDKPeerHandleError;
1460 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
1461 struct LDKCVec_u8Z *result;
1462 struct LDKPeerHandleError *err;
1463 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
1465 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
1466 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
1468 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
1470 typedef union LDKCResult_NonePeerHandleErrorZPtr {
1472 * Note that this value is always NULL, as there are no contents in the OK variant
1475 struct LDKPeerHandleError *err;
1476 } LDKCResult_NonePeerHandleErrorZPtr;
1478 typedef struct LDKCResult_NonePeerHandleErrorZ {
1479 union LDKCResult_NonePeerHandleErrorZPtr contents;
1481 } LDKCResult_NonePeerHandleErrorZ;
1483 typedef union LDKCResult_boolPeerHandleErrorZPtr {
1485 struct LDKPeerHandleError *err;
1486 } LDKCResult_boolPeerHandleErrorZPtr;
1488 typedef struct LDKCResult_boolPeerHandleErrorZ {
1489 union LDKCResult_boolPeerHandleErrorZPtr contents;
1491 } LDKCResult_boolPeerHandleErrorZ;
1496 * Features used within an `init` message.
1498 typedef struct MUST_USE_STRUCT LDKInitFeatures {
1500 * A pointer to the opaque Rust object.
1501 * Nearly everywhere, inner must be non-null, however in places where
1502 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1504 LDKnativeInitFeatures *inner;
1506 * Indicates that this is the only struct which contains the same pointer.
1507 * Rust functions which take ownership of an object provided via an argument require
1508 * this to be true and invalidate the object pointed to by inner.
1513 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
1514 struct LDKInitFeatures *result;
1515 struct LDKDecodeError *err;
1516 } LDKCResult_InitFeaturesDecodeErrorZPtr;
1518 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
1519 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
1521 } LDKCResult_InitFeaturesDecodeErrorZ;
1526 * Features used within a `node_announcement` message.
1528 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
1530 * A pointer to the opaque Rust object.
1531 * Nearly everywhere, inner must be non-null, however in places where
1532 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1534 LDKnativeNodeFeatures *inner;
1536 * Indicates that this is the only struct which contains the same pointer.
1537 * Rust functions which take ownership of an object provided via an argument require
1538 * this to be true and invalidate the object pointed to by inner.
1543 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
1544 struct LDKNodeFeatures *result;
1545 struct LDKDecodeError *err;
1546 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
1548 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
1549 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
1551 } LDKCResult_NodeFeaturesDecodeErrorZ;
1556 * Features used within a `channel_announcement` message.
1558 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
1560 * A pointer to the opaque Rust object.
1561 * Nearly everywhere, inner must be non-null, however in places where
1562 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1564 LDKnativeChannelFeatures *inner;
1566 * Indicates that this is the only struct which contains the same pointer.
1567 * Rust functions which take ownership of an object provided via an argument require
1568 * this to be true and invalidate the object pointed to by inner.
1571 } LDKChannelFeatures;
1573 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
1574 struct LDKChannelFeatures *result;
1575 struct LDKDecodeError *err;
1576 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
1578 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
1579 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
1581 } LDKCResult_ChannelFeaturesDecodeErrorZ;
1586 * Features used within an invoice.
1588 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
1590 * A pointer to the opaque Rust object.
1591 * Nearly everywhere, inner must be non-null, however in places where
1592 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1594 LDKnativeInvoiceFeatures *inner;
1596 * Indicates that this is the only struct which contains the same pointer.
1597 * Rust functions which take ownership of an object provided via an argument require
1598 * this to be true and invalidate the object pointed to by inner.
1601 } LDKInvoiceFeatures;
1603 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
1604 struct LDKInvoiceFeatures *result;
1605 struct LDKDecodeError *err;
1606 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
1608 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
1609 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
1611 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
1616 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
1617 * with our counterparty.
1619 typedef struct MUST_USE_STRUCT LDKChannelConfig {
1621 * A pointer to the opaque Rust object.
1622 * Nearly everywhere, inner must be non-null, however in places where
1623 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1625 LDKnativeChannelConfig *inner;
1627 * Indicates that this is the only struct which contains the same pointer.
1628 * Rust functions which take ownership of an object provided via an argument require
1629 * this to be true and invalidate the object pointed to by inner.
1634 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
1635 struct LDKChannelConfig *result;
1636 struct LDKDecodeError *err;
1637 } LDKCResult_ChannelConfigDecodeErrorZPtr;
1639 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
1640 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
1642 } LDKCResult_ChannelConfigDecodeErrorZ;
1647 * Details about one direction of a channel. Received
1648 * within a channel update.
1650 typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
1652 * A pointer to the opaque Rust object.
1653 * Nearly everywhere, inner must be non-null, however in places where
1654 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1656 LDKnativeDirectionalChannelInfo *inner;
1658 * Indicates that this is the only struct which contains the same pointer.
1659 * Rust functions which take ownership of an object provided via an argument require
1660 * this to be true and invalidate the object pointed to by inner.
1663 } LDKDirectionalChannelInfo;
1665 typedef union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr {
1666 struct LDKDirectionalChannelInfo *result;
1667 struct LDKDecodeError *err;
1668 } LDKCResult_DirectionalChannelInfoDecodeErrorZPtr;
1670 typedef struct LDKCResult_DirectionalChannelInfoDecodeErrorZ {
1671 union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr contents;
1673 } LDKCResult_DirectionalChannelInfoDecodeErrorZ;
1678 * Details about a channel (both directions).
1679 * Received within a channel announcement.
1681 typedef struct MUST_USE_STRUCT LDKChannelInfo {
1683 * A pointer to the opaque Rust object.
1684 * Nearly everywhere, inner must be non-null, however in places where
1685 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1687 LDKnativeChannelInfo *inner;
1689 * Indicates that this is the only struct which contains the same pointer.
1690 * Rust functions which take ownership of an object provided via an argument require
1691 * this to be true and invalidate the object pointed to by inner.
1696 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
1697 struct LDKChannelInfo *result;
1698 struct LDKDecodeError *err;
1699 } LDKCResult_ChannelInfoDecodeErrorZPtr;
1701 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
1702 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
1704 } LDKCResult_ChannelInfoDecodeErrorZ;
1709 * Fees for routing via a given channel or a node
1711 typedef struct MUST_USE_STRUCT LDKRoutingFees {
1713 * A pointer to the opaque Rust object.
1714 * Nearly everywhere, inner must be non-null, however in places where
1715 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1717 LDKnativeRoutingFees *inner;
1719 * Indicates that this is the only struct which contains the same pointer.
1720 * Rust functions which take ownership of an object provided via an argument require
1721 * this to be true and invalidate the object pointed to by inner.
1726 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
1727 struct LDKRoutingFees *result;
1728 struct LDKDecodeError *err;
1729 } LDKCResult_RoutingFeesDecodeErrorZPtr;
1731 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
1732 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
1734 } LDKCResult_RoutingFeesDecodeErrorZ;
1736 typedef struct LDKFourBytes {
1740 typedef struct LDKSixteenBytes {
1744 typedef struct LDKTenBytes {
1749 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
1750 * look up the corresponding function in rust-lightning's docs.
1752 typedef struct LDKThirtyTwoBytes {
1754 } LDKThirtyTwoBytes;
1757 * An address which can be used to connect to a remote peer
1759 typedef enum LDKNetAddress_Tag {
1761 * An IPv4 address/port on which the peer is listening.
1765 * An IPv6 address/port on which the peer is listening.
1769 * An old-style Tor onion address/port on which the peer is listening.
1771 LDKNetAddress_OnionV2,
1773 * A new-style Tor onion address/port on which the peer is listening.
1774 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
1775 * wrap as base32 and append \".onion\".
1777 LDKNetAddress_OnionV3,
1779 * Must be last for serialization purposes
1781 LDKNetAddress_Sentinel,
1782 } LDKNetAddress_Tag;
1784 typedef struct LDKNetAddress_LDKIPv4_Body {
1786 * The 4-byte IPv4 address
1788 struct LDKFourBytes addr;
1790 * The port on which the node is listening
1793 } LDKNetAddress_LDKIPv4_Body;
1795 typedef struct LDKNetAddress_LDKIPv6_Body {
1797 * The 16-byte IPv6 address
1799 struct LDKSixteenBytes addr;
1801 * The port on which the node is listening
1804 } LDKNetAddress_LDKIPv6_Body;
1806 typedef struct LDKNetAddress_LDKOnionV2_Body {
1808 * The bytes (usually encoded in base32 with \".onion\" appended)
1810 struct LDKTenBytes addr;
1812 * The port on which the node is listening
1815 } LDKNetAddress_LDKOnionV2_Body;
1817 typedef struct LDKNetAddress_LDKOnionV3_Body {
1819 * The ed25519 long-term public key of the peer
1821 struct LDKThirtyTwoBytes ed25519_pubkey;
1823 * The checksum of the pubkey and version, as included in the onion address
1827 * The version byte, as defined by the Tor Onion v3 spec.
1831 * The port on which the node is listening
1834 } LDKNetAddress_LDKOnionV3_Body;
1836 typedef struct MUST_USE_STRUCT LDKNetAddress {
1837 LDKNetAddress_Tag tag;
1839 LDKNetAddress_LDKIPv4_Body i_pv4;
1840 LDKNetAddress_LDKIPv6_Body i_pv6;
1841 LDKNetAddress_LDKOnionV2_Body onion_v2;
1842 LDKNetAddress_LDKOnionV3_Body onion_v3;
1846 typedef struct LDKCVec_NetAddressZ {
1847 struct LDKNetAddress *data;
1849 } LDKCVec_NetAddressZ;
1854 * Information received in the latest node_announcement from this node.
1856 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
1858 * A pointer to the opaque Rust object.
1859 * Nearly everywhere, inner must be non-null, however in places where
1860 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1862 LDKnativeNodeAnnouncementInfo *inner;
1864 * Indicates that this is the only struct which contains the same pointer.
1865 * Rust functions which take ownership of an object provided via an argument require
1866 * this to be true and invalidate the object pointed to by inner.
1869 } LDKNodeAnnouncementInfo;
1871 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
1872 struct LDKNodeAnnouncementInfo *result;
1873 struct LDKDecodeError *err;
1874 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
1876 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
1877 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
1879 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
1881 typedef struct LDKCVec_u64Z {
1889 * Details about a node in the network, known from the network announcement.
1891 typedef struct MUST_USE_STRUCT LDKNodeInfo {
1893 * A pointer to the opaque Rust object.
1894 * Nearly everywhere, inner must be non-null, however in places where
1895 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1897 LDKnativeNodeInfo *inner;
1899 * Indicates that this is the only struct which contains the same pointer.
1900 * Rust functions which take ownership of an object provided via an argument require
1901 * this to be true and invalidate the object pointed to by inner.
1906 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
1907 struct LDKNodeInfo *result;
1908 struct LDKDecodeError *err;
1909 } LDKCResult_NodeInfoDecodeErrorZPtr;
1911 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
1912 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
1914 } LDKCResult_NodeInfoDecodeErrorZ;
1919 * Represents the network as nodes and channels between them
1921 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
1923 * A pointer to the opaque Rust object.
1924 * Nearly everywhere, inner must be non-null, however in places where
1925 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1927 LDKnativeNetworkGraph *inner;
1929 * Indicates that this is the only struct which contains the same pointer.
1930 * Rust functions which take ownership of an object provided via an argument require
1931 * this to be true and invalidate the object pointed to by inner.
1936 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
1937 struct LDKNetworkGraph *result;
1938 struct LDKDecodeError *err;
1939 } LDKCResult_NetworkGraphDecodeErrorZPtr;
1941 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
1942 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
1944 } LDKCResult_NetworkGraphDecodeErrorZ;
1946 typedef struct LDKC2Tuple_usizeTransactionZ {
1948 struct LDKTransaction b;
1949 } LDKC2Tuple_usizeTransactionZ;
1951 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
1952 struct LDKC2Tuple_usizeTransactionZ *data;
1954 } LDKCVec_C2Tuple_usizeTransactionZZ;
1956 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
1958 * Note that this value is always NULL, as there are no contents in the OK variant
1961 enum LDKChannelMonitorUpdateErr *err;
1962 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
1964 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
1965 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
1967 } LDKCResult_NoneChannelMonitorUpdateErrZ;
1972 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
1973 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
1974 * preimage claim backward will lead to loss of funds.
1976 * [`chain::Watch`]: ../trait.Watch.html
1978 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
1980 * A pointer to the opaque Rust object.
1981 * Nearly everywhere, inner must be non-null, however in places where
1982 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1984 LDKnativeHTLCUpdate *inner;
1986 * Indicates that this is the only struct which contains the same pointer.
1987 * Rust functions which take ownership of an object provided via an argument require
1988 * this to be true and invalidate the object pointed to by inner.
1996 * A reference to a transaction output.
1998 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
1999 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
2001 typedef struct MUST_USE_STRUCT LDKOutPoint {
2003 * A pointer to the opaque Rust object.
2004 * Nearly everywhere, inner must be non-null, however in places where
2005 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2007 LDKnativeOutPoint *inner;
2009 * Indicates that this is the only struct which contains the same pointer.
2010 * Rust functions which take ownership of an object provided via an argument require
2011 * this to be true and invalidate the object pointed to by inner.
2017 * An event to be processed by the ChannelManager.
2019 typedef enum LDKMonitorEvent_Tag {
2021 * A monitor event containing an HTLCUpdate.
2023 LDKMonitorEvent_HTLCEvent,
2025 * A monitor event that the Channel's commitment transaction was broadcasted.
2027 LDKMonitorEvent_CommitmentTxBroadcasted,
2029 * Must be last for serialization purposes
2031 LDKMonitorEvent_Sentinel,
2032 } LDKMonitorEvent_Tag;
2034 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
2035 LDKMonitorEvent_Tag tag;
2038 struct LDKHTLCUpdate htlc_event;
2041 struct LDKOutPoint commitment_tx_broadcasted;
2046 typedef struct LDKCVec_MonitorEventZ {
2047 struct LDKMonitorEvent *data;
2049 } LDKCVec_MonitorEventZ;
2054 * Information about a spendable output to a P2WSH script. See
2055 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
2057 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
2059 * A pointer to the opaque Rust object.
2060 * Nearly everywhere, inner must be non-null, however in places where
2061 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2063 LDKnativeDelayedPaymentOutputDescriptor *inner;
2065 * Indicates that this is the only struct which contains the same pointer.
2066 * Rust functions which take ownership of an object provided via an argument require
2067 * this to be true and invalidate the object pointed to by inner.
2070 } LDKDelayedPaymentOutputDescriptor;
2075 * Information about a spendable output to our \"payment key\". See
2076 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
2078 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
2080 * A pointer to the opaque Rust object.
2081 * Nearly everywhere, inner must be non-null, however in places where
2082 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2084 LDKnativeStaticPaymentOutputDescriptor *inner;
2086 * Indicates that this is the only struct which contains the same pointer.
2087 * Rust functions which take ownership of an object provided via an argument require
2088 * this to be true and invalidate the object pointed to by inner.
2091 } LDKStaticPaymentOutputDescriptor;
2094 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
2095 * claim at any point in the future) an event is generated which you must track and be able to
2096 * spend on-chain. The information needed to do this is provided in this enum, including the
2097 * outpoint describing which txid and output index is available, the full output which exists at
2098 * that txid/index, and any keys or other information required to sign.
2100 typedef enum LDKSpendableOutputDescriptor_Tag {
2102 * An output to a script which was provided via KeysInterface directly, either from
2103 * `get_destination_script()` or `get_shutdown_pubkey()`, thus you should already know how to
2104 * spend it. No secret keys are provided as rust-lightning was never given any key.
2105 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
2106 * on-chain using the payment preimage or after it has timed out.
2108 LDKSpendableOutputDescriptor_StaticOutput,
2110 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
2112 * The witness in the spending input should be:
2113 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
2115 * Note that the nSequence field in the spending input must be set to to_self_delay
2116 * (which means the transaction is not broadcastable until at least to_self_delay
2117 * blocks after the outpoint confirms).
2119 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
2120 * it is an output from an old state which we broadcast (which should never happen).
2122 * To derive the delayed_payment key which is used to sign for this input, you must pass the
2123 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
2124 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
2125 * chan_utils::derive_private_key. The public key can be generated without the secret key
2126 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
2129 * To derive the revocation_pubkey provided here (which is used in the witness
2130 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
2131 * call to Sign::ready_channel) and the provided per_commitment point
2132 * to chan_utils::derive_public_revocation_key.
2134 * The witness script which is hashed and included in the output script_pubkey may be
2135 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
2136 * (derived as above), and the to_self_delay contained here to
2137 * chan_utils::get_revokeable_redeemscript.
2139 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
2141 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
2142 * corresponds to the public key in Sign::pubkeys().payment_point).
2143 * The witness in the spending input, is, thus, simply:
2144 * <BIP 143 signature> <payment key>
2146 * These are generally the result of our counterparty having broadcast the current state,
2147 * allowing us to claim the non-HTLC-encumbered outputs immediately.
2149 LDKSpendableOutputDescriptor_StaticPaymentOutput,
2151 * Must be last for serialization purposes
2153 LDKSpendableOutputDescriptor_Sentinel,
2154 } LDKSpendableOutputDescriptor_Tag;
2156 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
2158 * The outpoint which is spendable
2160 struct LDKOutPoint outpoint;
2162 * The output which is referenced by the given outpoint.
2164 struct LDKTxOut output;
2165 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
2167 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
2168 LDKSpendableOutputDescriptor_Tag tag;
2170 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
2172 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
2175 struct LDKStaticPaymentOutputDescriptor static_payment_output;
2178 } LDKSpendableOutputDescriptor;
2180 typedef struct LDKCVec_SpendableOutputDescriptorZ {
2181 struct LDKSpendableOutputDescriptor *data;
2183 } LDKCVec_SpendableOutputDescriptorZ;
2186 * An Event which you should probably take some action in response to.
2188 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
2189 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
2190 * written as it makes no sense to respond to it after reconnecting to peers).
2192 typedef enum LDKEvent_Tag {
2194 * Used to indicate that the client should generate a funding transaction with the given
2195 * parameters and then call ChannelManager::funding_transaction_generated.
2196 * Generated in ChannelManager message handling.
2197 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
2198 * counterparty can steal your funds!
2200 LDKEvent_FundingGenerationReady,
2202 * Used to indicate that the client may now broadcast the funding transaction it created for a
2203 * channel. Broadcasting such a transaction prior to this event may lead to our counterparty
2204 * trivially stealing all funds in the funding transaction!
2206 LDKEvent_FundingBroadcastSafe,
2208 * Indicates we've received money! Just gotta dig out that payment preimage and feed it to
2209 * ChannelManager::claim_funds to get it....
2210 * Note that if the preimage is not known or the amount paid is incorrect, you should call
2211 * ChannelManager::fail_htlc_backwards to free up resources for this HTLC and avoid
2212 * network congestion.
2213 * The amount paid should be considered 'incorrect' when it is less than or more than twice
2214 * the amount expected.
2215 * If you fail to call either ChannelManager::claim_funds or
2216 * ChannelManager::fail_htlc_backwards within the HTLC's timeout, the HTLC will be
2217 * automatically failed.
2219 LDKEvent_PaymentReceived,
2221 * Indicates an outbound payment we made succeeded (ie it made it all the way to its target
2222 * and we got back the payment preimage for it).
2223 * Note that duplicative PaymentSent Events may be generated - it is your responsibility to
2224 * deduplicate them by payment_preimage (which MUST be unique)!
2226 LDKEvent_PaymentSent,
2228 * Indicates an outbound payment we made failed. Probably some intermediary node dropped
2229 * something. You may wish to retry with a different route.
2230 * Note that duplicative PaymentFailed Events may be generated - it is your responsibility to
2231 * deduplicate them by payment_hash (which MUST be unique)!
2233 LDKEvent_PaymentFailed,
2235 * Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
2236 * time in the future.
2238 LDKEvent_PendingHTLCsForwardable,
2240 * Used to indicate that an output was generated on-chain which you should know how to spend.
2241 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
2242 * counterparty spending them due to some kind of timeout. Thus, you need to store them
2243 * somewhere and spend them when you create on-chain transactions.
2245 LDKEvent_SpendableOutputs,
2247 * Must be last for serialization purposes
2252 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
2254 * The random channel_id we picked which you'll need to pass into
2255 * ChannelManager::funding_transaction_generated.
2257 struct LDKThirtyTwoBytes temporary_channel_id;
2259 * The value, in satoshis, that the output should have.
2261 uint64_t channel_value_satoshis;
2263 * The script which should be used in the transaction output.
2265 struct LDKCVec_u8Z output_script;
2267 * The value passed in to ChannelManager::create_channel
2269 uint64_t user_channel_id;
2270 } LDKEvent_LDKFundingGenerationReady_Body;
2272 typedef struct LDKEvent_LDKFundingBroadcastSafe_Body {
2274 * The output, which was passed to ChannelManager::funding_transaction_generated, which is
2275 * now safe to broadcast.
2277 struct LDKOutPoint funding_txo;
2279 * The value passed in to ChannelManager::create_channel
2281 uint64_t user_channel_id;
2282 } LDKEvent_LDKFundingBroadcastSafe_Body;
2284 typedef struct LDKEvent_LDKPaymentReceived_Body {
2286 * The hash for which the preimage should be handed to the ChannelManager.
2288 struct LDKThirtyTwoBytes payment_hash;
2290 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
2291 * number of deanonymization attacks during the routing process.
2292 * As nodes upgrade, the invoices you provide should likely migrate to setting the
2293 * payment_secret feature to required, at which point you should fail_backwards any HTLCs
2294 * which have a None here.
2295 * Until then, however, values of None should be ignored, and only incorrect Some values
2296 * should result in an HTLC fail_backwards.
2297 * Note that, in any case, this value must be passed as-is to any fail or claim calls as
2298 * the HTLC index includes this value.
2300 struct LDKThirtyTwoBytes payment_secret;
2302 * The value, in thousandths of a satoshi, that this payment is for. Note that you must
2303 * compare this to the expected value before accepting the payment (as otherwise you are
2304 * providing proof-of-payment for less than the value you expected!).
2307 } LDKEvent_LDKPaymentReceived_Body;
2309 typedef struct LDKEvent_LDKPaymentSent_Body {
2311 * The preimage to the hash given to ChannelManager::send_payment.
2312 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
2315 struct LDKThirtyTwoBytes payment_preimage;
2316 } LDKEvent_LDKPaymentSent_Body;
2318 typedef struct LDKEvent_LDKPaymentFailed_Body {
2320 * The hash which was given to ChannelManager::send_payment.
2322 struct LDKThirtyTwoBytes payment_hash;
2324 * Indicates the payment was rejected for some reason by the recipient. This implies that
2325 * the payment has failed, not just the route in question. If this is not set, you may
2326 * retry the payment via a different route.
2328 bool rejected_by_dest;
2329 } LDKEvent_LDKPaymentFailed_Body;
2331 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
2333 * The minimum amount of time that should be waited prior to calling
2334 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
2335 * you should wait a random amount of time in roughly the range (now + time_forwardable,
2336 * now + 5*time_forwardable).
2338 uint64_t time_forwardable;
2339 } LDKEvent_LDKPendingHTLCsForwardable_Body;
2341 typedef struct LDKEvent_LDKSpendableOutputs_Body {
2343 * The outputs which you should store as spendable by you.
2345 struct LDKCVec_SpendableOutputDescriptorZ outputs;
2346 } LDKEvent_LDKSpendableOutputs_Body;
2348 typedef struct MUST_USE_STRUCT LDKEvent {
2351 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
2352 LDKEvent_LDKFundingBroadcastSafe_Body funding_broadcast_safe;
2353 LDKEvent_LDKPaymentReceived_Body payment_received;
2354 LDKEvent_LDKPaymentSent_Body payment_sent;
2355 LDKEvent_LDKPaymentFailed_Body payment_failed;
2356 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
2357 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
2361 typedef struct LDKCVec_EventZ {
2362 struct LDKEvent *data;
2366 typedef union LDKCResult_OutPointDecodeErrorZPtr {
2367 struct LDKOutPoint *result;
2368 struct LDKDecodeError *err;
2369 } LDKCResult_OutPointDecodeErrorZPtr;
2371 typedef struct LDKCResult_OutPointDecodeErrorZ {
2372 union LDKCResult_OutPointDecodeErrorZPtr contents;
2374 } LDKCResult_OutPointDecodeErrorZ;
2379 * An update generated by the underlying Channel itself which contains some new information the
2380 * ChannelMonitor should be made aware of.
2382 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
2384 * A pointer to the opaque Rust object.
2385 * Nearly everywhere, inner must be non-null, however in places where
2386 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2388 LDKnativeChannelMonitorUpdate *inner;
2390 * Indicates that this is the only struct which contains the same pointer.
2391 * Rust functions which take ownership of an object provided via an argument require
2392 * this to be true and invalidate the object pointed to by inner.
2395 } LDKChannelMonitorUpdate;
2397 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
2398 struct LDKChannelMonitorUpdate *result;
2399 struct LDKDecodeError *err;
2400 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
2402 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
2403 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
2405 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
2407 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
2408 struct LDKHTLCUpdate *result;
2409 struct LDKDecodeError *err;
2410 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
2412 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
2413 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
2415 } LDKCResult_HTLCUpdateDecodeErrorZ;
2420 * General Err type for ChannelMonitor actions. Generally, this implies that the data provided is
2421 * inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this
2422 * means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was
2424 * Contains a developer-readable error message.
2426 typedef struct MUST_USE_STRUCT LDKMonitorUpdateError {
2428 * A pointer to the opaque Rust object.
2429 * Nearly everywhere, inner must be non-null, however in places where
2430 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2432 LDKnativeMonitorUpdateError *inner;
2434 * Indicates that this is the only struct which contains the same pointer.
2435 * Rust functions which take ownership of an object provided via an argument require
2436 * this to be true and invalidate the object pointed to by inner.
2439 } LDKMonitorUpdateError;
2441 typedef union LDKCResult_NoneMonitorUpdateErrorZPtr {
2443 * Note that this value is always NULL, as there are no contents in the OK variant
2446 struct LDKMonitorUpdateError *err;
2447 } LDKCResult_NoneMonitorUpdateErrorZPtr;
2449 typedef struct LDKCResult_NoneMonitorUpdateErrorZ {
2450 union LDKCResult_NoneMonitorUpdateErrorZPtr contents;
2452 } LDKCResult_NoneMonitorUpdateErrorZ;
2454 typedef struct LDKC2Tuple_OutPointScriptZ {
2455 struct LDKOutPoint a;
2456 struct LDKCVec_u8Z b;
2457 } LDKC2Tuple_OutPointScriptZ;
2459 typedef struct LDKC2Tuple_u32ScriptZ {
2461 struct LDKCVec_u8Z b;
2462 } LDKC2Tuple_u32ScriptZ;
2464 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
2465 struct LDKC2Tuple_u32ScriptZ *data;
2467 } LDKCVec_C2Tuple_u32ScriptZZ;
2469 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
2470 struct LDKThirtyTwoBytes a;
2471 struct LDKCVec_C2Tuple_u32ScriptZZ b;
2472 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
2474 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
2475 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
2477 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
2479 typedef struct LDKCVec_TransactionZ {
2480 struct LDKTransaction *data;
2482 } LDKCVec_TransactionZ;
2484 typedef struct LDKC2Tuple_u32TxOutZ {
2487 } LDKC2Tuple_u32TxOutZ;
2489 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
2490 struct LDKC2Tuple_u32TxOutZ *data;
2492 } LDKCVec_C2Tuple_u32TxOutZZ;
2494 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
2495 struct LDKThirtyTwoBytes a;
2496 struct LDKCVec_C2Tuple_u32TxOutZZ b;
2497 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
2499 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ {
2500 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
2502 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ;
2504 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
2505 struct LDKSignature a;
2506 struct LDKCVec_SignatureZ b;
2507 } LDKC2Tuple_SignatureCVec_SignatureZZ;
2509 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
2510 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
2512 * Note that this value is always NULL, as there are no contents in the Err variant
2515 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
2517 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
2518 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
2520 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
2522 typedef union LDKCResult_SignatureNoneZPtr {
2523 struct LDKSignature *result;
2525 * Note that this value is always NULL, as there are no contents in the Err variant
2528 } LDKCResult_SignatureNoneZPtr;
2530 typedef struct LDKCResult_SignatureNoneZ {
2531 union LDKCResult_SignatureNoneZPtr contents;
2533 } LDKCResult_SignatureNoneZ;
2538 * The unsigned part of a channel_announcement
2540 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
2542 * A pointer to the opaque Rust object.
2543 * Nearly everywhere, inner must be non-null, however in places where
2544 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2546 LDKnativeUnsignedChannelAnnouncement *inner;
2548 * Indicates that this is the only struct which contains the same pointer.
2549 * Rust functions which take ownership of an object provided via an argument require
2550 * this to be true and invalidate the object pointed to by inner.
2553 } LDKUnsignedChannelAnnouncement;
2556 * A trait to sign lightning channel transactions as described in BOLT 3.
2558 * Signing services could be implemented on a hardware wallet. In this case,
2559 * the current Sign would be a front-end on top of a communication
2560 * channel connected to your secure device and lightning key material wouldn't
2561 * reside on a hot server. Nevertheless, a this deployment would still need
2562 * to trust the ChannelManager to avoid loss of funds as this latest component
2563 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
2565 * A more secure iteration would be to use hashlock (or payment points) to pair
2566 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
2567 * at the price of more state and computation on the hardware wallet side. In the future,
2568 * we are looking forward to design such interface.
2570 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
2571 * to act, as liveness and breach reply correctness are always going to be hard requirements
2572 * of LN security model, orthogonal of key management issues.
2574 typedef struct LDKSign {
2576 * An opaque pointer which is passed to your function implementations as an argument.
2577 * This has no meaning in the LDK, and can be NULL or any other value.
2581 * Gets the per-commitment point for a specific commitment number
2583 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
2585 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
2587 * Gets the commitment secret for a specific commitment number as part of the revocation process
2589 * An external signer implementation should error here if the commitment was already signed
2590 * and should refuse to sign it in the future.
2592 * May be called more than once for the same index.
2594 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
2596 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
2598 * Gets the holder's channel public keys and basepoints
2600 struct LDKChannelPublicKeys pubkeys;
2602 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
2603 * Note that this takes a pointer to this object, not the this_ptr like other methods do
2604 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
2606 void (*set_pubkeys)(const struct LDKSign*NONNULL_PTR );
2608 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
2609 * some SpendableOutputDescriptor types. This should be sufficient to identify this
2610 * Sign object uniquely and lookup or re-derive its keys.
2612 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
2614 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
2616 * Note that if signing fails or is rejected, the channel will be force-closed.
2618 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx);
2620 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
2621 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
2622 * latest commitment_tx when we initiate a force-close.
2623 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
2624 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
2626 * This may be called multiple times for the same transaction.
2628 * An external signer implementation should check that the commitment has not been revoked.
2630 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
2632 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
2634 * Create a signature for the given input in a transaction spending an HTLC or commitment
2635 * transaction output when our counterparty broadcasts an old state.
2637 * A justice transaction may claim multiples outputs at the same time if timelocks are
2638 * similar, but only a signature for the input at index `input` should be signed for here.
2639 * It may be called multiples time for same output(s) if a fee-bump is needed with regards
2640 * to an upcoming timelock expiration.
2642 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2644 * per_commitment_key is revocation secret which was provided by our counterparty when they
2645 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2646 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
2649 * htlc holds HTLC elements (hash, timelock) if the output being spent is a HTLC output, thus
2650 * changing the format of the witness script (which is committed to in the BIP 143
2653 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);
2655 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
2656 * transaction, either offered or received.
2658 * Such a transaction may claim multiples offered outputs at same time if we know the
2659 * preimage for each when we create it, but only the input at index `input` should be
2660 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
2661 * needed with regards to an upcoming timelock expiration.
2663 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
2666 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2668 * Per_commitment_point is the dynamic point corresponding to the channel state
2669 * detected onchain. It has been generated by our counterparty and is used to derive
2670 * channel state keys, which are then included in the witness script and committed to in the
2671 * BIP 143 signature.
2673 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);
2675 * Create a signature for a (proposed) closing transaction.
2677 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
2678 * chosen to forgo their output as dust.
2680 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, struct LDKTransaction closing_tx);
2682 * Signs a channel announcement message with our funding key, proving it comes from one
2683 * of the channel participants.
2685 * Note that if this fails or is rejected, the channel will not be publicly announced and
2686 * our counterparty may (though likely will not) close the channel on us for violating the
2689 struct LDKCResult_SignatureNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
2691 * Set the counterparty static channel data, including basepoints,
2692 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
2693 * This is done as soon as the funding outpoint is known. Since these are static channel data,
2694 * they MUST NOT be allowed to change to different values once set.
2696 * channel_parameters.is_populated() MUST be true.
2698 * We bind holder_selected_contest_delay late here for API convenience.
2700 * Will be called before any signatures are applied.
2702 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
2704 * Creates a copy of the object pointed to by this_arg, for a copy of this Sign.
2705 * Note that the ultimate copy of the Sign will have all function pointers the same as the original.
2706 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new Sign.
2708 void *(*clone)(const void *this_arg);
2710 * Serialize the object into a byte array
2712 struct LDKCVec_u8Z (*write)(const void *this_arg);
2714 * Frees any resources associated with this object given its this_arg pointer.
2715 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2717 void (*free)(void *this_arg);
2723 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
2724 * on-chain transactions to ensure no loss of funds occurs.
2726 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
2727 * information and are actively monitoring the chain.
2729 * Pending Events or updated HTLCs which have not yet been read out by
2730 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
2731 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
2732 * gotten are fully handled before re-serializing the new state.
2734 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
2735 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
2736 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
2737 * returned block hash and the the current chain and then reconnecting blocks to get to the
2738 * best chain) upon deserializing the object!
2740 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
2742 * A pointer to the opaque Rust object.
2743 * Nearly everywhere, inner must be non-null, however in places where
2744 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2746 LDKnativeChannelMonitor *inner;
2748 * Indicates that this is the only struct which contains the same pointer.
2749 * Rust functions which take ownership of an object provided via an argument require
2750 * this to be true and invalidate the object pointed to by inner.
2753 } LDKChannelMonitor;
2755 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
2756 struct LDKThirtyTwoBytes a;
2757 struct LDKChannelMonitor b;
2758 } LDKC2Tuple_BlockHashChannelMonitorZ;
2760 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
2761 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
2762 struct LDKDecodeError *err;
2763 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
2765 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
2766 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
2768 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
2770 typedef union LDKCResult_TxOutAccessErrorZPtr {
2771 struct LDKTxOut *result;
2772 enum LDKAccessError *err;
2773 } LDKCResult_TxOutAccessErrorZPtr;
2775 typedef struct LDKCResult_TxOutAccessErrorZ {
2776 union LDKCResult_TxOutAccessErrorZPtr contents;
2778 } LDKCResult_TxOutAccessErrorZ;
2781 * A Rust str object, ie a reference to a UTF8-valid string.
2782 * This is *not* null-terminated so cannot be used directly as a C string!
2784 typedef struct LDKStr {
2785 const uint8_t *chars;
2790 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
2793 typedef enum LDKAPIError_Tag {
2795 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
2796 * are documented, but generally indicates some precondition of a function was violated.
2798 LDKAPIError_APIMisuseError,
2800 * Due to a high feerate, we were unable to complete the request.
2801 * For example, this may be returned if the feerate implies we cannot open a channel at the
2802 * requested value, but opening a larger channel would succeed.
2804 LDKAPIError_FeeRateTooHigh,
2806 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
2807 * too-many-hops, etc).
2809 LDKAPIError_RouteError,
2811 * We were unable to complete the request as the Channel required to do so is unable to
2812 * complete the request (or was not found). This can take many forms, including disconnected
2813 * peer, channel at capacity, channel shutting down, etc.
2815 LDKAPIError_ChannelUnavailable,
2817 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
2818 * attempted action to fail.
2820 LDKAPIError_MonitorUpdateFailed,
2822 * Must be last for serialization purposes
2824 LDKAPIError_Sentinel,
2827 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
2829 * A human-readable error message
2831 struct LDKCVec_u8Z err;
2832 } LDKAPIError_LDKAPIMisuseError_Body;
2834 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
2836 * A human-readable error message
2838 struct LDKCVec_u8Z err;
2840 * The feerate which was too high.
2843 } LDKAPIError_LDKFeeRateTooHigh_Body;
2845 typedef struct LDKAPIError_LDKRouteError_Body {
2847 * A human-readable error message
2850 } LDKAPIError_LDKRouteError_Body;
2852 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
2854 * A human-readable error message
2856 struct LDKCVec_u8Z err;
2857 } LDKAPIError_LDKChannelUnavailable_Body;
2859 typedef struct MUST_USE_STRUCT LDKAPIError {
2860 LDKAPIError_Tag tag;
2862 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
2863 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
2864 LDKAPIError_LDKRouteError_Body route_error;
2865 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
2869 typedef union LDKCResult_NoneAPIErrorZPtr {
2871 * Note that this value is always NULL, as there are no contents in the OK variant
2874 struct LDKAPIError *err;
2875 } LDKCResult_NoneAPIErrorZPtr;
2877 typedef struct LDKCResult_NoneAPIErrorZ {
2878 union LDKCResult_NoneAPIErrorZPtr contents;
2880 } LDKCResult_NoneAPIErrorZ;
2882 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
2883 struct LDKCResult_NoneAPIErrorZ *data;
2885 } LDKCVec_CResult_NoneAPIErrorZZ;
2887 typedef struct LDKCVec_APIErrorZ {
2888 struct LDKAPIError *data;
2890 } LDKCVec_APIErrorZ;
2895 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
2897 typedef struct MUST_USE_STRUCT LDKChannelDetails {
2899 * A pointer to the opaque Rust object.
2900 * Nearly everywhere, inner must be non-null, however in places where
2901 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2903 LDKnativeChannelDetails *inner;
2905 * Indicates that this is the only struct which contains the same pointer.
2906 * Rust functions which take ownership of an object provided via an argument require
2907 * this to be true and invalidate the object pointed to by inner.
2910 } LDKChannelDetails;
2912 typedef struct LDKCVec_ChannelDetailsZ {
2913 struct LDKChannelDetails *data;
2915 } LDKCVec_ChannelDetailsZ;
2918 * If a payment fails to send, it can be in one of several states. This enum is returned as the
2919 * Err() type describing which state the payment is in, see the description of individual enum
2922 typedef enum LDKPaymentSendFailure_Tag {
2924 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
2925 * send the payment at all. No channel state has been changed or messages sent to peers, and
2926 * once you've changed the parameter at error, you can freely retry the payment in full.
2928 LDKPaymentSendFailure_ParameterError,
2930 * A parameter in a single path which was passed to send_payment was invalid, preventing us
2931 * from attempting to send the payment at all. No channel state has been changed or messages
2932 * sent to peers, and once you've changed the parameter at error, you can freely retry the
2935 * The results here are ordered the same as the paths in the route object which was passed to
2938 LDKPaymentSendFailure_PathParameterError,
2940 * All paths which were attempted failed to send, with no channel state change taking place.
2941 * You can freely retry the payment in full (though you probably want to do so over different
2942 * paths than the ones selected).
2944 LDKPaymentSendFailure_AllFailedRetrySafe,
2946 * Some paths which were attempted failed to send, though possibly not all. At least some
2947 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
2948 * in over-/re-payment.
2950 * The results here are ordered the same as the paths in the route object which was passed to
2951 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
2952 * retried (though there is currently no API with which to do so).
2954 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
2955 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
2956 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
2957 * with the latest update_id.
2959 LDKPaymentSendFailure_PartialFailure,
2961 * Must be last for serialization purposes
2963 LDKPaymentSendFailure_Sentinel,
2964 } LDKPaymentSendFailure_Tag;
2966 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
2967 LDKPaymentSendFailure_Tag tag;
2970 struct LDKAPIError parameter_error;
2973 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
2976 struct LDKCVec_APIErrorZ all_failed_retry_safe;
2979 struct LDKCVec_CResult_NoneAPIErrorZZ partial_failure;
2982 } LDKPaymentSendFailure;
2984 typedef union LDKCResult_NonePaymentSendFailureZPtr {
2986 * Note that this value is always NULL, as there are no contents in the OK variant
2989 struct LDKPaymentSendFailure *err;
2990 } LDKCResult_NonePaymentSendFailureZPtr;
2992 typedef struct LDKCResult_NonePaymentSendFailureZ {
2993 union LDKCResult_NonePaymentSendFailureZPtr contents;
2995 } LDKCResult_NonePaymentSendFailureZ;
2997 typedef struct LDKCVec_ChannelMonitorZ {
2998 struct LDKChannelMonitor *data;
3000 } LDKCVec_ChannelMonitorZ;
3003 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
3004 * blocks are connected and disconnected.
3006 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
3007 * responsible for maintaining a set of monitors such that they can be updated accordingly as
3008 * channel state changes and HTLCs are resolved. See method documentation for specific
3011 * Implementations **must** ensure that updates are successfully applied and persisted upon method
3012 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
3013 * without taking any further action such as persisting the current state.
3015 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
3016 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
3017 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
3018 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
3019 * multiple instances.
3021 * [`ChannelMonitor`]: channelmonitor/struct.ChannelMonitor.html
3022 * [`ChannelMonitorUpdateErr`]: channelmonitor/enum.ChannelMonitorUpdateErr.html
3023 * [`PermanentFailure`]: channelmonitor/enum.ChannelMonitorUpdateErr.html#variant.PermanentFailure
3025 typedef struct LDKWatch {
3027 * An opaque pointer which is passed to your function implementations as an argument.
3028 * This has no meaning in the LDK, and can be NULL or any other value.
3032 * Watches a channel identified by `funding_txo` using `monitor`.
3034 * Implementations are responsible for watching the chain for the funding transaction along
3035 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
3036 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
3038 * [`get_outputs_to_watch`]: channelmonitor/struct.ChannelMonitor.html#method.get_outputs_to_watch
3039 * [`block_connected`]: channelmonitor/struct.ChannelMonitor.html#method.block_connected
3040 * [`block_disconnected`]: channelmonitor/struct.ChannelMonitor.html#method.block_disconnected
3042 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
3044 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
3046 * Implementations must call [`update_monitor`] with the given update. See
3047 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
3049 * [`update_monitor`]: channelmonitor/struct.ChannelMonitor.html#method.update_monitor
3050 * [`ChannelMonitorUpdateErr`]: channelmonitor/enum.ChannelMonitorUpdateErr.html
3052 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
3054 * Returns any monitor events since the last call. Subsequent calls must only return new
3057 struct LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
3059 * Frees any resources associated with this object given its this_arg pointer.
3060 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3062 void (*free)(void *this_arg);
3066 * An interface to send a transaction to the Bitcoin network.
3068 typedef struct LDKBroadcasterInterface {
3070 * An opaque pointer which is passed to your function implementations as an argument.
3071 * This has no meaning in the LDK, and can be NULL or any other value.
3075 * Sends a transaction out to (hopefully) be mined.
3077 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
3079 * Frees any resources associated with this object given its this_arg pointer.
3080 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3082 void (*free)(void *this_arg);
3083 } LDKBroadcasterInterface;
3085 typedef union LDKCResult_SignDecodeErrorZPtr {
3086 struct LDKSign *result;
3087 struct LDKDecodeError *err;
3088 } LDKCResult_SignDecodeErrorZPtr;
3090 typedef struct LDKCResult_SignDecodeErrorZ {
3091 union LDKCResult_SignDecodeErrorZPtr contents;
3093 } LDKCResult_SignDecodeErrorZ;
3095 typedef struct LDKu8slice {
3096 const uint8_t *data;
3101 * A trait to describe an object which can get user secrets and key material.
3103 typedef struct LDKKeysInterface {
3105 * An opaque pointer which is passed to your function implementations as an argument.
3106 * This has no meaning in the LDK, and can be NULL or any other value.
3110 * Get node secret key (aka node_id or network_key).
3112 * This method must return the same value each time it is called.
3114 struct LDKSecretKey (*get_node_secret)(const void *this_arg);
3116 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
3118 * This method should return a different value each time it is called, to avoid linking
3119 * on-chain funds across channels as controlled to the same user.
3121 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
3123 * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing
3126 * This method should return a different value each time it is called, to avoid linking
3127 * on-chain funds across channels as controlled to the same user.
3129 struct LDKPublicKey (*get_shutdown_pubkey)(const void *this_arg);
3131 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
3132 * restarted with some stale data!
3134 * This method must return a different value each time it is called.
3136 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
3138 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
3139 * onion packets and for temporary channel IDs. There is no requirement that these be
3140 * persisted anywhere, though they must be unique across restarts.
3142 * This method must return a different value each time it is called.
3144 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
3146 * Reads a `Signer` for this `KeysInterface` from the given input stream.
3147 * This is only called during deserialization of other objects which contain
3148 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
3149 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
3150 * contain no versioning scheme. You may wish to include your own version prefix and ensure
3151 * you've read all of the provided bytes to ensure no corruption occurred.
3153 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
3155 * Frees any resources associated with this object given its this_arg pointer.
3156 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3158 void (*free)(void *this_arg);
3162 * A trait which should be implemented to provide feerate information on a number of time
3165 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
3166 * called from inside the library in response to chain events, P2P events, or timer events).
3168 typedef struct LDKFeeEstimator {
3170 * An opaque pointer which is passed to your function implementations as an argument.
3171 * This has no meaning in the LDK, and can be NULL or any other value.
3175 * Gets estimated satoshis of fee required per 1000 Weight-Units.
3177 * Must be no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later round-downs
3178 * don't put us below 1 satoshi-per-byte).
3180 * This translates to:
3181 * * satoshis-per-byte * 250
3182 * * ceil(satoshis-per-kbyte / 4)
3184 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
3186 * Frees any resources associated with this object given its this_arg pointer.
3187 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3189 void (*free)(void *this_arg);
3193 * A trait encapsulating the operations required of a logger
3195 typedef struct LDKLogger {
3197 * An opaque pointer which is passed to your function implementations as an argument.
3198 * This has no meaning in the LDK, and can be NULL or any other value.
3204 void (*log)(const void *this_arg, const char *record);
3206 * Frees any resources associated with this object given its this_arg pointer.
3207 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3209 void (*free)(void *this_arg);
3215 * Manager which keeps track of a number of channels and sends messages to the appropriate
3216 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
3218 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
3219 * to individual Channels.
3221 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
3222 * all peers during write/read (though does not modify this instance, only the instance being
3223 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
3224 * called funding_transaction_generated for outbound channels).
3226 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
3227 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
3228 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
3229 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
3230 * the serialization process). If the deserialized version is out-of-date compared to the
3231 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
3232 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
3234 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
3235 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
3236 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
3237 * block_connected() to step towards your best block) upon deserialization before using the
3240 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
3241 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
3242 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
3243 * offline for a full minute. In order to track this, you must call
3244 * timer_chan_freshness_every_min roughly once per minute, though it doesn't have to be perfect.
3246 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
3247 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
3248 * essentially you should default to using a SimpleRefChannelManager, and use a
3249 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
3250 * you're using lightning-net-tokio.
3252 typedef struct MUST_USE_STRUCT LDKChannelManager {
3254 * A pointer to the opaque Rust object.
3255 * Nearly everywhere, inner must be non-null, however in places where
3256 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3258 LDKnativeChannelManager *inner;
3260 * Indicates that this is the only struct which contains the same pointer.
3261 * Rust functions which take ownership of an object provided via an argument require
3262 * this to be true and invalidate the object pointed to by inner.
3265 } LDKChannelManager;
3267 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
3268 struct LDKThirtyTwoBytes a;
3269 struct LDKChannelManager b;
3270 } LDKC2Tuple_BlockHashChannelManagerZ;
3272 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
3273 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
3274 struct LDKDecodeError *err;
3275 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
3277 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
3278 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
3280 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
3282 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
3283 struct LDKSpendableOutputDescriptor *result;
3284 struct LDKDecodeError *err;
3285 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
3287 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
3288 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
3290 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
3292 typedef struct LDKCVec_CVec_u8ZZ {
3293 struct LDKCVec_u8Z *data;
3295 } LDKCVec_CVec_u8ZZ;
3297 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
3298 struct LDKCVec_CVec_u8ZZ *result;
3300 * Note that this value is always NULL, as there are no contents in the Err variant
3303 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
3305 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
3306 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
3308 } LDKCResult_CVec_CVec_u8ZZNoneZ;
3313 * A simple implementation of Sign that just keeps the private keys in memory.
3315 * This implementation performs no policy checks and is insufficient by itself as
3316 * a secure external signer.
3318 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
3320 * A pointer to the opaque Rust object.
3321 * Nearly everywhere, inner must be non-null, however in places where
3322 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3324 LDKnativeInMemorySigner *inner;
3326 * Indicates that this is the only struct which contains the same pointer.
3327 * Rust functions which take ownership of an object provided via an argument require
3328 * this to be true and invalidate the object pointed to by inner.
3331 } LDKInMemorySigner;
3333 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
3334 struct LDKInMemorySigner *result;
3335 struct LDKDecodeError *err;
3336 } LDKCResult_InMemorySignerDecodeErrorZPtr;
3338 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
3339 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
3341 } LDKCResult_InMemorySignerDecodeErrorZ;
3343 typedef struct LDKCVec_TxOutZ {
3344 struct LDKTxOut *data;
3348 typedef union LDKCResult_TransactionNoneZPtr {
3349 struct LDKTransaction *result;
3351 * Note that this value is always NULL, as there are no contents in the Err variant
3354 } LDKCResult_TransactionNoneZPtr;
3356 typedef struct LDKCResult_TransactionNoneZ {
3357 union LDKCResult_TransactionNoneZPtr contents;
3359 } LDKCResult_TransactionNoneZ;
3366 typedef struct MUST_USE_STRUCT LDKRouteHop {
3368 * A pointer to the opaque Rust object.
3369 * Nearly everywhere, inner must be non-null, however in places where
3370 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3372 LDKnativeRouteHop *inner;
3374 * Indicates that this is the only struct which contains the same pointer.
3375 * Rust functions which take ownership of an object provided via an argument require
3376 * this to be true and invalidate the object pointed to by inner.
3381 typedef struct LDKCVec_RouteHopZ {
3382 struct LDKRouteHop *data;
3384 } LDKCVec_RouteHopZ;
3386 typedef struct LDKCVec_CVec_RouteHopZZ {
3387 struct LDKCVec_RouteHopZ *data;
3389 } LDKCVec_CVec_RouteHopZZ;
3394 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
3395 * it can take multiple paths. Each path is composed of one or more hops through the network.
3397 typedef struct MUST_USE_STRUCT LDKRoute {
3399 * A pointer to the opaque Rust object.
3400 * Nearly everywhere, inner must be non-null, however in places where
3401 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3403 LDKnativeRoute *inner;
3405 * Indicates that this is the only struct which contains the same pointer.
3406 * Rust functions which take ownership of an object provided via an argument require
3407 * this to be true and invalidate the object pointed to by inner.
3412 typedef union LDKCResult_RouteDecodeErrorZPtr {
3413 struct LDKRoute *result;
3414 struct LDKDecodeError *err;
3415 } LDKCResult_RouteDecodeErrorZPtr;
3417 typedef struct LDKCResult_RouteDecodeErrorZ {
3418 union LDKCResult_RouteDecodeErrorZPtr contents;
3420 } LDKCResult_RouteDecodeErrorZ;
3425 * A channel descriptor which provides a last-hop route to get_route
3427 typedef struct MUST_USE_STRUCT LDKRouteHint {
3429 * A pointer to the opaque Rust object.
3430 * Nearly everywhere, inner must be non-null, however in places where
3431 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3433 LDKnativeRouteHint *inner;
3435 * Indicates that this is the only struct which contains the same pointer.
3436 * Rust functions which take ownership of an object provided via an argument require
3437 * this to be true and invalidate the object pointed to by inner.
3442 typedef struct LDKCVec_RouteHintZ {
3443 struct LDKRouteHint *data;
3445 } LDKCVec_RouteHintZ;
3447 typedef union LDKCResult_RouteLightningErrorZPtr {
3448 struct LDKRoute *result;
3449 struct LDKLightningError *err;
3450 } LDKCResult_RouteLightningErrorZPtr;
3452 typedef struct LDKCResult_RouteLightningErrorZ {
3453 union LDKCResult_RouteLightningErrorZPtr contents;
3455 } LDKCResult_RouteLightningErrorZ;
3457 typedef union LDKCResult_NetAddressu8ZPtr {
3458 struct LDKNetAddress *result;
3460 } LDKCResult_NetAddressu8ZPtr;
3462 typedef struct LDKCResult_NetAddressu8Z {
3463 union LDKCResult_NetAddressu8ZPtr contents;
3465 } LDKCResult_NetAddressu8Z;
3467 typedef union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr {
3468 struct LDKCResult_NetAddressu8Z *result;
3469 struct LDKDecodeError *err;
3470 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr;
3472 typedef struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ {
3473 union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr contents;
3475 } LDKCResult_CResult_NetAddressu8ZDecodeErrorZ;
3480 * An update_add_htlc message to be sent or received from a peer
3482 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
3484 * A pointer to the opaque Rust object.
3485 * Nearly everywhere, inner must be non-null, however in places where
3486 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3488 LDKnativeUpdateAddHTLC *inner;
3490 * Indicates that this is the only struct which contains the same pointer.
3491 * Rust functions which take ownership of an object provided via an argument require
3492 * this to be true and invalidate the object pointed to by inner.
3497 typedef struct LDKCVec_UpdateAddHTLCZ {
3498 struct LDKUpdateAddHTLC *data;
3500 } LDKCVec_UpdateAddHTLCZ;
3505 * An update_fulfill_htlc message to be sent or received from a peer
3507 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
3509 * A pointer to the opaque Rust object.
3510 * Nearly everywhere, inner must be non-null, however in places where
3511 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3513 LDKnativeUpdateFulfillHTLC *inner;
3515 * Indicates that this is the only struct which contains the same pointer.
3516 * Rust functions which take ownership of an object provided via an argument require
3517 * this to be true and invalidate the object pointed to by inner.
3520 } LDKUpdateFulfillHTLC;
3522 typedef struct LDKCVec_UpdateFulfillHTLCZ {
3523 struct LDKUpdateFulfillHTLC *data;
3525 } LDKCVec_UpdateFulfillHTLCZ;
3530 * An update_fail_htlc message to be sent or received from a peer
3532 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
3534 * A pointer to the opaque Rust object.
3535 * Nearly everywhere, inner must be non-null, however in places where
3536 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3538 LDKnativeUpdateFailHTLC *inner;
3540 * Indicates that this is the only struct which contains the same pointer.
3541 * Rust functions which take ownership of an object provided via an argument require
3542 * this to be true and invalidate the object pointed to by inner.
3545 } LDKUpdateFailHTLC;
3547 typedef struct LDKCVec_UpdateFailHTLCZ {
3548 struct LDKUpdateFailHTLC *data;
3550 } LDKCVec_UpdateFailHTLCZ;
3555 * An update_fail_malformed_htlc message to be sent or received from a peer
3557 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
3559 * A pointer to the opaque Rust object.
3560 * Nearly everywhere, inner must be non-null, however in places where
3561 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3563 LDKnativeUpdateFailMalformedHTLC *inner;
3565 * Indicates that this is the only struct which contains the same pointer.
3566 * Rust functions which take ownership of an object provided via an argument require
3567 * this to be true and invalidate the object pointed to by inner.
3570 } LDKUpdateFailMalformedHTLC;
3572 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
3573 struct LDKUpdateFailMalformedHTLC *data;
3575 } LDKCVec_UpdateFailMalformedHTLCZ;
3577 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
3578 struct LDKAcceptChannel *result;
3579 struct LDKDecodeError *err;
3580 } LDKCResult_AcceptChannelDecodeErrorZPtr;
3582 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
3583 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
3585 } LDKCResult_AcceptChannelDecodeErrorZ;
3587 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
3588 struct LDKAnnouncementSignatures *result;
3589 struct LDKDecodeError *err;
3590 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
3592 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
3593 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
3595 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
3597 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
3598 struct LDKChannelReestablish *result;
3599 struct LDKDecodeError *err;
3600 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
3602 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
3603 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
3605 } LDKCResult_ChannelReestablishDecodeErrorZ;
3607 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
3608 struct LDKClosingSigned *result;
3609 struct LDKDecodeError *err;
3610 } LDKCResult_ClosingSignedDecodeErrorZPtr;
3612 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
3613 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
3615 } LDKCResult_ClosingSignedDecodeErrorZ;
3620 * A commitment_signed message to be sent or received from a peer
3622 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
3624 * A pointer to the opaque Rust object.
3625 * Nearly everywhere, inner must be non-null, however in places where
3626 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3628 LDKnativeCommitmentSigned *inner;
3630 * Indicates that this is the only struct which contains the same pointer.
3631 * Rust functions which take ownership of an object provided via an argument require
3632 * this to be true and invalidate the object pointed to by inner.
3635 } LDKCommitmentSigned;
3637 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
3638 struct LDKCommitmentSigned *result;
3639 struct LDKDecodeError *err;
3640 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
3642 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
3643 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
3645 } LDKCResult_CommitmentSignedDecodeErrorZ;
3647 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
3648 struct LDKFundingCreated *result;
3649 struct LDKDecodeError *err;
3650 } LDKCResult_FundingCreatedDecodeErrorZPtr;
3652 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
3653 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
3655 } LDKCResult_FundingCreatedDecodeErrorZ;
3657 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
3658 struct LDKFundingSigned *result;
3659 struct LDKDecodeError *err;
3660 } LDKCResult_FundingSignedDecodeErrorZPtr;
3662 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
3663 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
3665 } LDKCResult_FundingSignedDecodeErrorZ;
3667 typedef union LDKCResult_FundingLockedDecodeErrorZPtr {
3668 struct LDKFundingLocked *result;
3669 struct LDKDecodeError *err;
3670 } LDKCResult_FundingLockedDecodeErrorZPtr;
3672 typedef struct LDKCResult_FundingLockedDecodeErrorZ {
3673 union LDKCResult_FundingLockedDecodeErrorZPtr contents;
3675 } LDKCResult_FundingLockedDecodeErrorZ;
3680 * An init message to be sent or received from a peer
3682 typedef struct MUST_USE_STRUCT LDKInit {
3684 * A pointer to the opaque Rust object.
3685 * Nearly everywhere, inner must be non-null, however in places where
3686 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3688 LDKnativeInit *inner;
3690 * Indicates that this is the only struct which contains the same pointer.
3691 * Rust functions which take ownership of an object provided via an argument require
3692 * this to be true and invalidate the object pointed to by inner.
3697 typedef union LDKCResult_InitDecodeErrorZPtr {
3698 struct LDKInit *result;
3699 struct LDKDecodeError *err;
3700 } LDKCResult_InitDecodeErrorZPtr;
3702 typedef struct LDKCResult_InitDecodeErrorZ {
3703 union LDKCResult_InitDecodeErrorZPtr contents;
3705 } LDKCResult_InitDecodeErrorZ;
3707 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
3708 struct LDKOpenChannel *result;
3709 struct LDKDecodeError *err;
3710 } LDKCResult_OpenChannelDecodeErrorZPtr;
3712 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
3713 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
3715 } LDKCResult_OpenChannelDecodeErrorZ;
3717 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
3718 struct LDKRevokeAndACK *result;
3719 struct LDKDecodeError *err;
3720 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
3722 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
3723 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
3725 } LDKCResult_RevokeAndACKDecodeErrorZ;
3727 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
3728 struct LDKShutdown *result;
3729 struct LDKDecodeError *err;
3730 } LDKCResult_ShutdownDecodeErrorZPtr;
3732 typedef struct LDKCResult_ShutdownDecodeErrorZ {
3733 union LDKCResult_ShutdownDecodeErrorZPtr contents;
3735 } LDKCResult_ShutdownDecodeErrorZ;
3737 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
3738 struct LDKUpdateFailHTLC *result;
3739 struct LDKDecodeError *err;
3740 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
3742 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
3743 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
3745 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
3747 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
3748 struct LDKUpdateFailMalformedHTLC *result;
3749 struct LDKDecodeError *err;
3750 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
3752 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
3753 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
3755 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
3760 * An update_fee message to be sent or received from a peer
3762 typedef struct MUST_USE_STRUCT LDKUpdateFee {
3764 * A pointer to the opaque Rust object.
3765 * Nearly everywhere, inner must be non-null, however in places where
3766 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3768 LDKnativeUpdateFee *inner;
3770 * Indicates that this is the only struct which contains the same pointer.
3771 * Rust functions which take ownership of an object provided via an argument require
3772 * this to be true and invalidate the object pointed to by inner.
3777 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
3778 struct LDKUpdateFee *result;
3779 struct LDKDecodeError *err;
3780 } LDKCResult_UpdateFeeDecodeErrorZPtr;
3782 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
3783 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
3785 } LDKCResult_UpdateFeeDecodeErrorZ;
3787 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
3788 struct LDKUpdateFulfillHTLC *result;
3789 struct LDKDecodeError *err;
3790 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
3792 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
3793 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
3795 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
3797 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
3798 struct LDKUpdateAddHTLC *result;
3799 struct LDKDecodeError *err;
3800 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
3802 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
3803 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
3805 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
3810 * A ping message to be sent or received from a peer
3812 typedef struct MUST_USE_STRUCT LDKPing {
3814 * A pointer to the opaque Rust object.
3815 * Nearly everywhere, inner must be non-null, however in places where
3816 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3818 LDKnativePing *inner;
3820 * Indicates that this is the only struct which contains the same pointer.
3821 * Rust functions which take ownership of an object provided via an argument require
3822 * this to be true and invalidate the object pointed to by inner.
3827 typedef union LDKCResult_PingDecodeErrorZPtr {
3828 struct LDKPing *result;
3829 struct LDKDecodeError *err;
3830 } LDKCResult_PingDecodeErrorZPtr;
3832 typedef struct LDKCResult_PingDecodeErrorZ {
3833 union LDKCResult_PingDecodeErrorZPtr contents;
3835 } LDKCResult_PingDecodeErrorZ;
3840 * A pong message to be sent or received from a peer
3842 typedef struct MUST_USE_STRUCT LDKPong {
3844 * A pointer to the opaque Rust object.
3845 * Nearly everywhere, inner must be non-null, however in places where
3846 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3848 LDKnativePong *inner;
3850 * Indicates that this is the only struct which contains the same pointer.
3851 * Rust functions which take ownership of an object provided via an argument require
3852 * this to be true and invalidate the object pointed to by inner.
3857 typedef union LDKCResult_PongDecodeErrorZPtr {
3858 struct LDKPong *result;
3859 struct LDKDecodeError *err;
3860 } LDKCResult_PongDecodeErrorZPtr;
3862 typedef struct LDKCResult_PongDecodeErrorZ {
3863 union LDKCResult_PongDecodeErrorZPtr contents;
3865 } LDKCResult_PongDecodeErrorZ;
3867 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
3868 struct LDKUnsignedChannelAnnouncement *result;
3869 struct LDKDecodeError *err;
3870 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
3872 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
3873 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
3875 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
3877 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
3878 struct LDKChannelAnnouncement *result;
3879 struct LDKDecodeError *err;
3880 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
3882 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
3883 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
3885 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
3890 * The unsigned part of a channel_update
3892 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
3894 * A pointer to the opaque Rust object.
3895 * Nearly everywhere, inner must be non-null, however in places where
3896 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3898 LDKnativeUnsignedChannelUpdate *inner;
3900 * Indicates that this is the only struct which contains the same pointer.
3901 * Rust functions which take ownership of an object provided via an argument require
3902 * this to be true and invalidate the object pointed to by inner.
3905 } LDKUnsignedChannelUpdate;
3907 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
3908 struct LDKUnsignedChannelUpdate *result;
3909 struct LDKDecodeError *err;
3910 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
3912 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
3913 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
3915 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
3917 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
3918 struct LDKChannelUpdate *result;
3919 struct LDKDecodeError *err;
3920 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
3922 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
3923 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
3925 } LDKCResult_ChannelUpdateDecodeErrorZ;
3927 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
3928 struct LDKErrorMessage *result;
3929 struct LDKDecodeError *err;
3930 } LDKCResult_ErrorMessageDecodeErrorZPtr;
3932 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
3933 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
3935 } LDKCResult_ErrorMessageDecodeErrorZ;
3940 * The unsigned part of a node_announcement
3942 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
3944 * A pointer to the opaque Rust object.
3945 * Nearly everywhere, inner must be non-null, however in places where
3946 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3948 LDKnativeUnsignedNodeAnnouncement *inner;
3950 * Indicates that this is the only struct which contains the same pointer.
3951 * Rust functions which take ownership of an object provided via an argument require
3952 * this to be true and invalidate the object pointed to by inner.
3955 } LDKUnsignedNodeAnnouncement;
3957 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
3958 struct LDKUnsignedNodeAnnouncement *result;
3959 struct LDKDecodeError *err;
3960 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
3962 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
3963 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
3965 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
3967 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
3968 struct LDKNodeAnnouncement *result;
3969 struct LDKDecodeError *err;
3970 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
3972 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
3973 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
3975 } LDKCResult_NodeAnnouncementDecodeErrorZ;
3977 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
3978 struct LDKQueryShortChannelIds *result;
3979 struct LDKDecodeError *err;
3980 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
3982 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
3983 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
3985 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
3990 * A reply_short_channel_ids_end message is sent as a reply to a
3991 * query_short_channel_ids message. The query recipient makes a best
3992 * effort to respond based on their local network view which may not be
3993 * a perfect view of the network.
3995 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
3997 * A pointer to the opaque Rust object.
3998 * Nearly everywhere, inner must be non-null, however in places where
3999 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4001 LDKnativeReplyShortChannelIdsEnd *inner;
4003 * Indicates that this is the only struct which contains the same pointer.
4004 * Rust functions which take ownership of an object provided via an argument require
4005 * this to be true and invalidate the object pointed to by inner.
4008 } LDKReplyShortChannelIdsEnd;
4010 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
4011 struct LDKReplyShortChannelIdsEnd *result;
4012 struct LDKDecodeError *err;
4013 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
4015 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
4016 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
4018 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
4020 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
4021 struct LDKQueryChannelRange *result;
4022 struct LDKDecodeError *err;
4023 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
4025 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
4026 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
4028 } LDKCResult_QueryChannelRangeDecodeErrorZ;
4033 * A reply_channel_range message is a reply to a query_channel_range
4034 * message. Multiple reply_channel_range messages can be sent in reply
4035 * to a single query_channel_range message. The query recipient makes a
4036 * best effort to respond based on their local network view which may
4037 * not be a perfect view of the network. The short_channel_ids in the
4038 * reply are encoded. We only support encoding_type=0 uncompressed
4039 * serialization and do not support encoding_type=1 zlib serialization.
4041 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
4043 * A pointer to the opaque Rust object.
4044 * Nearly everywhere, inner must be non-null, however in places where
4045 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4047 LDKnativeReplyChannelRange *inner;
4049 * Indicates that this is the only struct which contains the same pointer.
4050 * Rust functions which take ownership of an object provided via an argument require
4051 * this to be true and invalidate the object pointed to by inner.
4054 } LDKReplyChannelRange;
4056 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
4057 struct LDKReplyChannelRange *result;
4058 struct LDKDecodeError *err;
4059 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
4061 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
4062 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
4064 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
4069 * A gossip_timestamp_filter message is used by a node to request
4070 * gossip relay for messages in the requested time range when the
4071 * gossip_queries feature has been negotiated.
4073 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
4075 * A pointer to the opaque Rust object.
4076 * Nearly everywhere, inner must be non-null, however in places where
4077 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4079 LDKnativeGossipTimestampFilter *inner;
4081 * Indicates that this is the only struct which contains the same pointer.
4082 * Rust functions which take ownership of an object provided via an argument require
4083 * this to be true and invalidate the object pointed to by inner.
4086 } LDKGossipTimestampFilter;
4088 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
4089 struct LDKGossipTimestampFilter *result;
4090 struct LDKDecodeError *err;
4091 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
4093 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
4094 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
4096 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
4099 * A trait indicating an object may generate message send events
4101 typedef struct LDKMessageSendEventsProvider {
4103 * An opaque pointer which is passed to your function implementations as an argument.
4104 * This has no meaning in the LDK, and can be NULL or any other value.
4108 * Gets the list of pending events which were generated by previous actions, clearing the list
4111 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
4113 * Frees any resources associated with this object given its this_arg pointer.
4114 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4116 void (*free)(void *this_arg);
4117 } LDKMessageSendEventsProvider;
4120 * A trait indicating an object may generate events
4122 typedef struct LDKEventsProvider {
4124 * An opaque pointer which is passed to your function implementations as an argument.
4125 * This has no meaning in the LDK, and can be NULL or any other value.
4129 * Gets the list of pending events which were generated by previous actions, clearing the list
4132 struct LDKCVec_EventZ (*get_and_clear_pending_events)(const void *this_arg);
4134 * Frees any resources associated with this object given its this_arg pointer.
4135 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4137 void (*free)(void *this_arg);
4138 } LDKEventsProvider;
4143 * Configuration we set when applicable.
4145 * Default::default() provides sane defaults.
4147 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
4149 * A pointer to the opaque Rust object.
4150 * Nearly everywhere, inner must be non-null, however in places where
4151 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4153 LDKnativeChannelHandshakeConfig *inner;
4155 * Indicates that this is the only struct which contains the same pointer.
4156 * Rust functions which take ownership of an object provided via an argument require
4157 * this to be true and invalidate the object pointed to by inner.
4160 } LDKChannelHandshakeConfig;
4165 * Optional channel limits which are applied during channel creation.
4167 * These limits are only applied to our counterparty's limits, not our own.
4169 * Use 0/<type>::max_value() as appropriate to skip checking.
4171 * Provides sane defaults for most configurations.
4173 * Most additional limits are disabled except those with which specify a default in individual
4174 * field documentation. Note that this may result in barely-usable channels, but since they
4175 * are applied mostly only to incoming channels that's not much of a problem.
4177 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
4179 * A pointer to the opaque Rust object.
4180 * Nearly everywhere, inner must be non-null, however in places where
4181 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4183 LDKnativeChannelHandshakeLimits *inner;
4185 * Indicates that this is the only struct which contains the same pointer.
4186 * Rust functions which take ownership of an object provided via an argument require
4187 * this to be true and invalidate the object pointed to by inner.
4190 } LDKChannelHandshakeLimits;
4195 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
4197 * Default::default() provides sane defaults for most configurations
4198 * (but currently with 0 relay fees!)
4200 typedef struct MUST_USE_STRUCT LDKUserConfig {
4202 * A pointer to the opaque Rust object.
4203 * Nearly everywhere, inner must be non-null, however in places where
4204 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4206 LDKnativeUserConfig *inner;
4208 * Indicates that this is the only struct which contains the same pointer.
4209 * Rust functions which take ownership of an object provided via an argument require
4210 * this to be true and invalidate the object pointed to by inner.
4216 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
4219 typedef struct LDKAccess {
4221 * An opaque pointer which is passed to your function implementations as an argument.
4222 * This has no meaning in the LDK, and can be NULL or any other value.
4226 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
4227 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
4230 * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
4232 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
4234 * Frees any resources associated with this object given its this_arg pointer.
4235 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4237 void (*free)(void *this_arg);
4241 * The `Listen` trait is used to be notified of when blocks have been connected or disconnected
4244 * Useful when needing to replay chain data upon startup or as new chain events occur.
4246 typedef struct LDKListen {
4248 * An opaque pointer which is passed to your function implementations as an argument.
4249 * This has no meaning in the LDK, and can be NULL or any other value.
4253 * Notifies the listener that a block was added at the given height.
4255 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
4257 * Notifies the listener that a block was removed at the given height.
4259 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
4261 * Frees any resources associated with this object given its this_arg pointer.
4262 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4264 void (*free)(void *this_arg);
4268 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
4271 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
4272 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
4273 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
4274 * receiving full blocks from a chain source, any further filtering is unnecessary.
4276 * After an output has been registered, subsequent block retrievals from the chain source must not
4277 * exclude any transactions matching the new criteria nor any in-block descendants of such
4280 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
4281 * should not block on I/O. Implementations should instead queue the newly monitored data to be
4282 * processed later. Then, in order to block until the data has been processed, any `Watch`
4283 * invocation that has called the `Filter` must return [`TemporaryFailure`].
4285 * [`Watch`]: trait.Watch.html
4286 * [`TemporaryFailure`]: channelmonitor/enum.ChannelMonitorUpdateErr.html#variant.TemporaryFailure
4287 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
4288 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
4290 typedef struct LDKFilter {
4292 * An opaque pointer which is passed to your function implementations as an argument.
4293 * This has no meaning in the LDK, and can be NULL or any other value.
4297 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
4298 * a spending condition.
4300 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
4302 * Registers interest in spends of a transaction output identified by `outpoint` having
4303 * `script_pubkey` as the spending condition.
4305 void (*register_output)(const void *this_arg, const struct LDKOutPoint *NONNULL_PTR outpoint, struct LDKu8slice script_pubkey);
4307 * Frees any resources associated with this object given its this_arg pointer.
4308 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4310 void (*free)(void *this_arg);
4314 * `Persist` defines behavior for persisting channel monitors: this could mean
4315 * writing once to disk, and/or uploading to one or more backup services.
4317 * Note that for every new monitor, you **must** persist the new `ChannelMonitor`
4318 * to disk/backups. And, on every update, you **must** persist either the
4319 * `ChannelMonitorUpdate` or the updated monitor itself. Otherwise, there is risk
4320 * of situations such as revoking a transaction, then crashing before this
4321 * revocation can be persisted, then unintentionally broadcasting a revoked
4322 * transaction and losing money. This is a risk because previous channel states
4323 * are toxic, so it's important that whatever channel state is persisted is
4326 typedef struct LDKPersist {
4328 * An opaque pointer which is passed to your function implementations as an argument.
4329 * This has no meaning in the LDK, and can be NULL or any other value.
4333 * Persist a new channel's data. The data can be stored any way you want, but
4334 * the identifier provided by Rust-Lightning is the channel's outpoint (and
4335 * it is up to you to maintain a correct mapping between the outpoint and the
4336 * stored channel data). Note that you **must** persist every new monitor to
4337 * disk. See the `Persist` trait documentation for more details.
4339 * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`,
4340 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
4342 * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk
4343 * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html
4345 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data);
4347 * Update one channel's data. The provided `ChannelMonitor` has already
4348 * applied the given update.
4350 * Note that on every update, you **must** persist either the
4351 * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See
4352 * the `Persist` trait documentation for more details.
4354 * If an implementer chooses to persist the updates only, they need to make
4355 * sure that all the updates are applied to the `ChannelMonitors` *before*
4356 * the set of channel monitors is given to the `ChannelManager`
4357 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
4358 * applying a monitor update to a monitor. If full `ChannelMonitors` are
4359 * persisted, then there is no need to persist individual updates.
4361 * Note that there could be a performance tradeoff between persisting complete
4362 * channel monitors on every update vs. persisting only updates and applying
4363 * them in batches. The size of each monitor grows `O(number of state updates)`
4364 * whereas updates are small and `O(1)`.
4366 * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`,
4367 * [`ChannelMonitorUpdate::write`] for writing out an update, and
4368 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
4370 * [`ChannelMonitor::update_monitor`]: struct.ChannelMonitor.html#impl-1
4371 * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk
4372 * [`ChannelMonitorUpdate::write`]: struct.ChannelMonitorUpdate.html#method.write
4373 * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html
4375 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);
4377 * Frees any resources associated with this object given its this_arg pointer.
4378 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4380 void (*free)(void *this_arg);
4386 * An implementation of [`chain::Watch`] for monitoring channels.
4388 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
4389 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
4390 * or used independently to monitor channels remotely. See the [module-level documentation] for
4393 * [`chain::Watch`]: ../trait.Watch.html
4394 * [`ChannelManager`]: ../../ln/channelmanager/struct.ChannelManager.html
4395 * [module-level documentation]: index.html
4397 typedef struct MUST_USE_STRUCT LDKChainMonitor {
4399 * A pointer to the opaque Rust object.
4400 * Nearly everywhere, inner must be non-null, however in places where
4401 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4403 LDKnativeChainMonitor *inner;
4405 * Indicates that this is the only struct which contains the same pointer.
4406 * Rust functions which take ownership of an object provided via an argument require
4407 * this to be true and invalidate the object pointed to by inner.
4415 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
4416 * and derives keys from that.
4418 * Your node_id is seed/0'
4419 * ChannelMonitor closes may use seed/1'
4420 * Cooperative closes may use seed/2'
4421 * The two close keys may be needed to claim on-chain funds!
4423 typedef struct MUST_USE_STRUCT LDKKeysManager {
4425 * A pointer to the opaque Rust object.
4426 * Nearly everywhere, inner must be non-null, however in places where
4427 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4429 LDKnativeKeysManager *inner;
4431 * Indicates that this is the only struct which contains the same pointer.
4432 * Rust functions which take ownership of an object provided via an argument require
4433 * this to be true and invalidate the object pointed to by inner.
4441 * Chain-related parameters used to construct a new `ChannelManager`.
4443 * Typically, the block-specific parameters are derived from the best block hash for the network,
4444 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
4445 * are not needed when deserializing a previously constructed `ChannelManager`.
4447 typedef struct MUST_USE_STRUCT LDKChainParameters {
4449 * A pointer to the opaque Rust object.
4450 * Nearly everywhere, inner must be non-null, however in places where
4451 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4453 LDKnativeChainParameters *inner;
4455 * Indicates that this is the only struct which contains the same pointer.
4456 * Rust functions which take ownership of an object provided via an argument require
4457 * this to be true and invalidate the object pointed to by inner.
4460 } LDKChainParameters;
4462 typedef struct LDKThreeBytes {
4467 * A trait to describe an object which can receive channel messages.
4469 * Messages MAY be called in parallel when they originate from different their_node_ids, however
4470 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
4472 typedef struct LDKChannelMessageHandler {
4474 * An opaque pointer which is passed to your function implementations as an argument.
4475 * This has no meaning in the LDK, and can be NULL or any other value.
4479 * Handle an incoming open_channel message from the given peer.
4481 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
4483 * Handle an incoming accept_channel message from the given peer.
4485 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
4487 * Handle an incoming funding_created message from the given peer.
4489 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
4491 * Handle an incoming funding_signed message from the given peer.
4493 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
4495 * Handle an incoming funding_locked message from the given peer.
4497 void (*handle_funding_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg);
4499 * Handle an incoming shutdown message from the given peer.
4501 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);
4503 * Handle an incoming closing_signed message from the given peer.
4505 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
4507 * Handle an incoming update_add_htlc message from the given peer.
4509 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
4511 * Handle an incoming update_fulfill_htlc message from the given peer.
4513 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
4515 * Handle an incoming update_fail_htlc message from the given peer.
4517 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
4519 * Handle an incoming update_fail_malformed_htlc message from the given peer.
4521 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
4523 * Handle an incoming commitment_signed message from the given peer.
4525 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
4527 * Handle an incoming revoke_and_ack message from the given peer.
4529 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
4531 * Handle an incoming update_fee message from the given peer.
4533 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
4535 * Handle an incoming announcement_signatures message from the given peer.
4537 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
4539 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
4540 * is believed to be possible in the future (eg they're sending us messages we don't
4541 * understand or indicate they require unknown feature bits), no_connection_possible is set
4542 * and any outstanding channels should be failed.
4544 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
4546 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
4548 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
4550 * Handle an incoming channel_reestablish message from the given peer.
4552 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
4554 * Handle an incoming error message from the given peer.
4556 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
4558 * Implementation of MessageSendEventsProvider for this object.
4560 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
4562 * Frees any resources associated with this object given its this_arg pointer.
4563 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4565 void (*free)(void *this_arg);
4566 } LDKChannelMessageHandler;
4571 * Arguments for the creation of a ChannelManager that are not deserialized.
4573 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
4575 * 1) Deserialize all stored ChannelMonitors.
4576 * 2) Deserialize the ChannelManager by filling in this struct and calling:
4577 * <(BlockHash, ChannelManager)>::read(reader, args)
4578 * This may result in closing some Channels if the ChannelMonitor is newer than the stored
4579 * ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted.
4580 * 3) If you are not fetching full blocks, register all relevant ChannelMonitor outpoints the same
4581 * way you would handle a `chain::Filter` call using ChannelMonitor::get_outputs_to_watch() and
4582 * ChannelMonitor::get_funding_txo().
4583 * 4) Reconnect blocks on your ChannelMonitors.
4584 * 5) Disconnect/connect blocks on the ChannelManager.
4585 * 6) Move the ChannelMonitors into your local chain::Watch.
4587 * Note that the ordering of #4-6 is not of importance, however all three must occur before you
4588 * call any other methods on the newly-deserialized ChannelManager.
4590 * Note that because some channels may be closed during deserialization, it is critical that you
4591 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
4592 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
4593 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
4594 * not force-close the same channels but consider them live), you may end up revoking a state for
4595 * which you've already broadcasted the transaction.
4597 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
4599 * A pointer to the opaque Rust object.
4600 * Nearly everywhere, inner must be non-null, however in places where
4601 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4603 LDKnativeChannelManagerReadArgs *inner;
4605 * Indicates that this is the only struct which contains the same pointer.
4606 * Rust functions which take ownership of an object provided via an argument require
4607 * this to be true and invalidate the object pointed to by inner.
4610 } LDKChannelManagerReadArgs;
4615 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
4616 * This is used to convince the recipient that the channel is at a certain commitment
4617 * number even if they lost that data due to a local failure. Of course, the peer may lie
4618 * and even later commitments may have been revoked.
4620 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
4622 * A pointer to the opaque Rust object.
4623 * Nearly everywhere, inner must be non-null, however in places where
4624 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4626 LDKnativeDataLossProtect *inner;
4628 * Indicates that this is the only struct which contains the same pointer.
4629 * Rust functions which take ownership of an object provided via an argument require
4630 * this to be true and invalidate the object pointed to by inner.
4633 } LDKDataLossProtect;
4636 * A trait to describe an object which can receive routing messages.
4638 * # Implementor DoS Warnings
4640 * For `gossip_queries` messages there are potential DoS vectors when handling
4641 * inbound queries. Implementors using an on-disk network graph should be aware of
4642 * repeated disk I/O for queries accessing different parts of the network graph.
4644 typedef struct LDKRoutingMessageHandler {
4646 * An opaque pointer which is passed to your function implementations as an argument.
4647 * This has no meaning in the LDK, and can be NULL or any other value.
4651 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
4652 * false or returning an Err otherwise.
4654 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
4656 * Handle a channel_announcement message, returning true if it should be forwarded on, false
4657 * or returning an Err otherwise.
4659 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
4661 * Handle an incoming channel_update message, returning true if it should be forwarded on,
4662 * false or returning an Err otherwise.
4664 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
4666 * Handle some updates to the route graph that we learned due to an outbound failed payment.
4668 void (*handle_htlc_fail_channel_update)(const void *this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update);
4670 * Gets a subset of the channel announcements and updates required to dump our routing table
4671 * to a remote node, starting at the short_channel_id indicated by starting_point and
4672 * including the batch_amount entries immediately higher in numerical value than starting_point.
4674 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
4676 * Gets a subset of the node announcements required to dump our routing table to a remote node,
4677 * starting at the node *after* the provided publickey and including batch_amount entries
4678 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
4679 * If None is provided for starting_point, we start at the first node.
4681 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
4683 * Called when a connection is established with a peer. This can be used to
4684 * perform routing table synchronization using a strategy defined by the
4687 void (*sync_routing_table)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
4689 * Handles the reply of a query we initiated to learn about channels
4690 * for a given range of blocks. We can expect to receive one or more
4691 * replies to a single query.
4693 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
4695 * Handles the reply of a query we initiated asking for routing gossip
4696 * messages for a list of channels. We should receive this message when
4697 * a node has completed its best effort to send us the pertaining routing
4700 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
4702 * Handles when a peer asks us to send a list of short_channel_ids
4703 * for the requested range of blocks.
4705 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
4707 * Handles when a peer asks us to send routing gossip messages for a
4708 * list of short_channel_ids.
4710 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
4712 * Implementation of MessageSendEventsProvider for this object.
4714 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
4716 * Frees any resources associated with this object given its this_arg pointer.
4717 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4719 void (*free)(void *this_arg);
4720 } LDKRoutingMessageHandler;
4725 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
4726 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
4728 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
4730 * A pointer to the opaque Rust object.
4731 * Nearly everywhere, inner must be non-null, however in places where
4732 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4734 LDKnativeIgnoringMessageHandler *inner;
4736 * Indicates that this is the only struct which contains the same pointer.
4737 * Rust functions which take ownership of an object provided via an argument require
4738 * this to be true and invalidate the object pointed to by inner.
4741 } LDKIgnoringMessageHandler;
4746 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
4747 * You can provide one of these as the route_handler in a MessageHandler.
4749 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
4751 * A pointer to the opaque Rust object.
4752 * Nearly everywhere, inner must be non-null, however in places where
4753 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4755 LDKnativeErroringMessageHandler *inner;
4757 * Indicates that this is the only struct which contains the same pointer.
4758 * Rust functions which take ownership of an object provided via an argument require
4759 * this to be true and invalidate the object pointed to by inner.
4762 } LDKErroringMessageHandler;
4767 * Provides references to trait impls which handle different types of messages.
4769 typedef struct MUST_USE_STRUCT LDKMessageHandler {
4771 * A pointer to the opaque Rust object.
4772 * Nearly everywhere, inner must be non-null, however in places where
4773 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4775 LDKnativeMessageHandler *inner;
4777 * Indicates that this is the only struct which contains the same pointer.
4778 * Rust functions which take ownership of an object provided via an argument require
4779 * this to be true and invalidate the object pointed to by inner.
4782 } LDKMessageHandler;
4785 * Provides an object which can be used to send data to and which uniquely identifies a connection
4786 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
4787 * implement Hash to meet the PeerManager API.
4789 * For efficiency, Clone should be relatively cheap for this type.
4791 * You probably want to just extend an int and put a file descriptor in a struct and implement
4792 * send_data. Note that if you are using a higher-level net library that may call close() itself,
4793 * be careful to ensure you don't have races whereby you might register a new connection with an
4794 * fd which is the same as a previous one which has yet to be removed via
4795 * PeerManager::socket_disconnected().
4797 typedef struct LDKSocketDescriptor {
4799 * An opaque pointer which is passed to your function implementations as an argument.
4800 * This has no meaning in the LDK, and can be NULL or any other value.
4804 * Attempts to send some data from the given slice to the peer.
4806 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
4807 * Note that in the disconnected case, socket_disconnected must still fire and further write
4808 * attempts may occur until that time.
4810 * If the returned size is smaller than data.len(), a write_available event must
4811 * trigger the next time more data can be written. Additionally, until the a send_data event
4812 * completes fully, no further read_events should trigger on the same peer!
4814 * If a read_event on this descriptor had previously returned true (indicating that read
4815 * events should be paused to prevent DoS in the send buffer), resume_read may be set
4816 * indicating that read events on this descriptor should resume. A resume_read of false does
4817 * *not* imply that further read events should be paused.
4819 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
4821 * Disconnect the socket pointed to by this SocketDescriptor. Once this function returns, no
4822 * more calls to write_buffer_space_avail, read_event or socket_disconnected may be made with
4823 * this descriptor. No socket_disconnected call should be generated as a result of this call,
4824 * though races may occur whereby disconnect_socket is called after a call to
4825 * socket_disconnected but prior to socket_disconnected returning.
4827 void (*disconnect_socket)(void *this_arg);
4829 * Checks if two objects are equal given this object's this_arg pointer and another object.
4831 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
4833 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
4834 * This is used, for example, for inclusion of this object in a hash map.
4836 uint64_t (*hash)(const void *this_arg);
4838 * Creates a copy of the object pointed to by this_arg, for a copy of this SocketDescriptor.
4839 * Note that the ultimate copy of the SocketDescriptor will have all function pointers the same as the original.
4840 * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new SocketDescriptor.
4842 void *(*clone)(const void *this_arg);
4844 * Frees any resources associated with this object given its this_arg pointer.
4845 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4847 void (*free)(void *this_arg);
4848 } LDKSocketDescriptor;
4853 * A PeerManager manages a set of peers, described by their SocketDescriptor and marshalls socket
4854 * events into messages which it passes on to its MessageHandlers.
4856 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
4857 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
4858 * essentially you should default to using a SimpleRefPeerManager, and use a
4859 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
4860 * you're using lightning-net-tokio.
4862 typedef struct MUST_USE_STRUCT LDKPeerManager {
4864 * A pointer to the opaque Rust object.
4865 * Nearly everywhere, inner must be non-null, however in places where
4866 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4868 LDKnativePeerManager *inner;
4870 * Indicates that this is the only struct which contains the same pointer.
4871 * Rust functions which take ownership of an object provided via an argument require
4872 * this to be true and invalidate the object pointed to by inner.
4880 * Static channel fields used to build transactions given per-commitment fields, organized by
4881 * broadcaster/countersignatory.
4883 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
4884 * as_holder_broadcastable and as_counterparty_broadcastable functions.
4886 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
4888 * A pointer to the opaque Rust object.
4889 * Nearly everywhere, inner must be non-null, however in places where
4890 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4892 LDKnativeDirectedChannelTransactionParameters *inner;
4894 * Indicates that this is the only struct which contains the same pointer.
4895 * Rust functions which take ownership of an object provided via an argument require
4896 * this to be true and invalidate the object pointed to by inner.
4899 } LDKDirectedChannelTransactionParameters;
4904 * A simple newtype for RwLockReadGuard<'a, NetworkGraph>.
4905 * This exists only to make accessing a RwLock<NetworkGraph> possible from
4906 * the C bindings, as it can be done directly in Rust code.
4908 typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
4910 * A pointer to the opaque Rust object.
4911 * Nearly everywhere, inner must be non-null, however in places where
4912 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4914 LDKnativeLockedNetworkGraph *inner;
4916 * Indicates that this is the only struct which contains the same pointer.
4917 * Rust functions which take ownership of an object provided via an argument require
4918 * this to be true and invalidate the object pointed to by inner.
4921 } LDKLockedNetworkGraph;
4926 * Receives and validates network updates from peers,
4927 * stores authentic and relevant data as a network graph.
4928 * This network graph is then used for routing payments.
4929 * Provides interface to help with initial routing sync by
4930 * serving historical announcements.
4932 typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
4934 * A pointer to the opaque Rust object.
4935 * Nearly everywhere, inner must be non-null, however in places where
4936 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4938 LDKnativeNetGraphMsgHandler *inner;
4940 * Indicates that this is the only struct which contains the same pointer.
4941 * Rust functions which take ownership of an object provided via an argument require
4942 * this to be true and invalidate the object pointed to by inner.
4945 } LDKNetGraphMsgHandler;
4947 extern const uintptr_t MAX_BUF_SIZE;
4949 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
4951 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
4953 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
4955 void Transaction_free(struct LDKTransaction _res);
4957 void TxOut_free(struct LDKTxOut _res);
4959 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
4961 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
4963 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
4965 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
4967 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
4969 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
4971 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
4973 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
4975 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
4977 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
4979 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
4981 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
4983 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
4985 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
4987 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
4989 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
4991 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
4993 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
4995 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
4997 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
4999 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
5001 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
5003 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
5005 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
5007 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
5009 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
5011 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
5013 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
5015 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
5017 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
5019 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
5021 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
5023 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
5025 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
5027 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
5029 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
5031 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
5033 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
5035 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
5037 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
5039 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
5041 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
5043 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
5045 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
5047 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
5049 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
5051 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
5053 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
5055 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
5057 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
5059 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
5061 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
5063 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
5065 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
5067 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
5069 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
5071 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
5073 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
5075 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
5077 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
5079 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
5081 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
5083 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
5085 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
5087 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
5089 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
5091 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
5093 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
5095 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
5097 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
5099 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
5101 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
5103 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
5105 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
5107 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
5109 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
5111 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
5113 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
5115 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
5117 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
5119 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
5121 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
5123 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
5125 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
5127 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
5129 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
5131 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
5133 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
5135 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
5137 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
5139 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
5141 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
5143 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
5145 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
5147 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o);
5149 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
5151 void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res);
5153 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig);
5155 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
5157 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
5159 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
5161 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
5163 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
5165 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
5167 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
5169 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
5171 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
5173 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
5175 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
5177 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
5179 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
5181 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
5183 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
5185 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
5187 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
5189 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
5191 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
5193 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
5195 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
5197 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
5199 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
5201 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
5203 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
5205 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
5207 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
5209 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
5211 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
5213 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
5215 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
5217 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
5219 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
5221 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
5223 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
5225 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
5227 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
5229 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
5231 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
5233 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
5235 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
5237 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
5239 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
5241 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
5243 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e);
5245 void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res);
5247 struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_clone(const struct LDKCResult_NoneMonitorUpdateErrorZ *NONNULL_PTR orig);
5249 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
5251 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
5253 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
5255 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
5257 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
5259 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
5261 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
5263 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
5265 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
5267 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
5269 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
5271 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
5273 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
5275 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
5277 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
5279 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
5281 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
5283 void CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res);
5285 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
5287 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
5289 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
5291 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
5293 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
5295 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
5297 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
5299 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
5301 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
5303 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
5305 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
5307 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
5309 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
5311 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
5313 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
5315 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
5317 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
5319 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
5321 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
5323 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
5325 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
5327 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
5329 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
5331 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
5333 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
5335 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
5337 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
5339 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
5341 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
5343 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
5345 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
5347 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
5349 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
5351 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
5353 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
5355 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
5357 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
5359 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
5361 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
5363 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
5365 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
5367 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
5369 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
5371 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
5373 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
5375 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
5377 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
5379 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
5381 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
5383 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
5385 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
5387 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
5389 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
5391 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
5393 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
5395 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
5397 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
5399 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
5401 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
5403 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
5405 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
5407 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
5409 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
5411 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
5413 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
5415 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
5417 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
5419 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
5421 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
5423 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
5425 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
5427 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
5429 void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
5431 struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
5433 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
5435 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
5437 void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
5439 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
5441 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
5443 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
5445 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
5447 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
5449 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
5451 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
5453 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
5455 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
5457 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
5459 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
5461 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
5463 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
5465 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
5467 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
5469 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
5471 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
5473 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
5475 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
5477 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
5479 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
5481 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
5483 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
5485 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
5487 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
5489 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
5491 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
5493 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
5495 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
5497 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
5499 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
5501 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
5503 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
5505 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o);
5507 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e);
5509 void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res);
5511 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig);
5513 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
5515 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
5517 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
5519 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
5521 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
5523 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
5525 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
5527 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
5529 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
5531 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
5533 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
5535 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
5537 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
5539 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
5541 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
5543 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
5545 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
5547 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
5549 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
5551 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
5553 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
5555 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
5557 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
5559 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
5561 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
5563 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
5565 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
5567 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
5569 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
5571 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
5573 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
5575 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
5577 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
5579 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
5581 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
5583 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
5585 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
5587 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
5589 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
5591 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
5593 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
5595 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
5597 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
5599 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
5601 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
5603 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
5605 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
5607 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
5609 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
5611 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
5613 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
5615 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
5617 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
5619 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
5621 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
5623 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
5625 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
5627 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
5629 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
5631 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
5633 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
5635 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
5637 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
5639 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
5641 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
5643 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
5645 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
5647 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
5649 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
5651 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
5653 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
5655 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
5657 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
5659 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
5661 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
5663 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
5665 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
5667 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
5669 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
5671 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
5673 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
5675 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
5677 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
5679 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
5681 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
5683 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
5685 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
5687 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
5689 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
5691 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
5693 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
5695 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
5698 * Frees any resources used by the Event
5700 void Event_free(struct LDKEvent this_ptr);
5703 * Creates a copy of the Event
5705 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
5708 * Serialize the Event object into a byte array which can be read by Event_read
5710 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
5713 * Frees any resources used by the MessageSendEvent
5715 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
5718 * Creates a copy of the MessageSendEvent
5720 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
5723 * Calls the free function if one is set
5725 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
5728 * Calls the free function if one is set
5730 void EventsProvider_free(struct LDKEventsProvider this_ptr);
5733 * Frees any resources used by the APIError
5735 void APIError_free(struct LDKAPIError this_ptr);
5738 * Creates a copy of the APIError
5740 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
5743 * Creates a copy of the Level
5745 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
5748 * Returns the most verbose logging level.
5750 MUST_USE_RES enum LDKLevel Level_max(void);
5753 * Calls the free function if one is set
5755 void Logger_free(struct LDKLogger this_ptr);
5758 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
5760 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
5763 * Confirmations we will wait for before considering the channel locked in.
5764 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
5765 * equivalent limit applied to outbound channels).
5769 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
5772 * Confirmations we will wait for before considering the channel locked in.
5773 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
5774 * equivalent limit applied to outbound channels).
5778 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
5781 * Set to the amount of time we require our counterparty to wait to claim their money.
5783 * It's one of the main parameter of our security model. We (or one of our watchtowers) MUST
5784 * be online to check for peer having broadcast a revoked transaction to steal our funds
5785 * at least once every our_to_self_delay blocks.
5787 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
5788 * case of an honest unilateral channel close, which implicitly decrease the economic value of
5791 * Default value: BREAKDOWN_TIMEOUT (currently 144), we enforce it as a minimum at channel
5792 * opening so you can tweak config to ask for more security, not less.
5794 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
5797 * Set to the amount of time we require our counterparty to wait to claim their money.
5799 * It's one of the main parameter of our security model. We (or one of our watchtowers) MUST
5800 * be online to check for peer having broadcast a revoked transaction to steal our funds
5801 * at least once every our_to_self_delay blocks.
5803 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
5804 * case of an honest unilateral channel close, which implicitly decrease the economic value of
5807 * Default value: BREAKDOWN_TIMEOUT (currently 144), we enforce it as a minimum at channel
5808 * opening so you can tweak config to ask for more security, not less.
5810 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
5813 * Set to the smallest value HTLC we will accept to process.
5815 * This value is sent to our counterparty on channel-open and we close the channel any time
5816 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
5818 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
5821 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
5824 * Set to the smallest value HTLC we will accept to process.
5826 * This value is sent to our counterparty on channel-open and we close the channel any time
5827 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
5829 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
5832 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
5835 * Constructs a new ChannelHandshakeConfig given each field
5837 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);
5840 * Creates a copy of the ChannelHandshakeConfig
5842 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
5845 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
5847 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
5850 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
5852 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
5855 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
5856 * only applies to inbound channels.
5860 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
5863 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
5864 * only applies to inbound channels.
5868 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
5871 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
5872 * you to limit the maximum minimum-size they can require.
5874 * Default value: u64::max_value.
5876 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
5879 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
5880 * you to limit the maximum minimum-size they can require.
5882 * Default value: u64::max_value.
5884 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
5887 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
5888 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
5892 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
5895 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
5896 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
5900 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
5903 * The remote node will require we keep a certain amount in direct payment to ourselves at all
5904 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
5905 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
5907 * Default value: u64::max_value.
5909 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
5912 * The remote node will require we keep a certain amount in direct payment to ourselves at all
5913 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
5914 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
5916 * Default value: u64::max_value.
5918 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
5921 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
5922 * time. This allows you to set a minimum such value.
5926 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
5929 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
5930 * time. This allows you to set a minimum such value.
5934 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
5937 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
5938 * required to always be higher than this value so this only applies to HTLC outputs (and
5939 * potentially to-self outputs before any payments have been made).
5940 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
5941 * This setting allows you to set a minimum dust limit for their commitment transactions,
5942 * reflecting the reality that tiny outputs are not considered standard transactions and will
5943 * not propagate through the Bitcoin network.
5945 * Default value: 546, the current dust limit on the Bitcoin network.
5947 uint64_t ChannelHandshakeLimits_get_min_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
5950 * Outputs below a certain value will not be added to on-chain transactions. The dust value is
5951 * required to always be higher than this value so this only applies to HTLC outputs (and
5952 * potentially to-self outputs before any payments have been made).
5953 * Thus, HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
5954 * This setting allows you to set a minimum dust limit for their commitment transactions,
5955 * reflecting the reality that tiny outputs are not considered standard transactions and will
5956 * not propagate through the Bitcoin network.
5958 * Default value: 546, the current dust limit on the Bitcoin network.
5960 void ChannelHandshakeLimits_set_min_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
5963 * Maximum allowed threshold above which outputs will not be generated in their commitment
5965 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
5967 * Default value: u64::max_value.
5969 uint64_t ChannelHandshakeLimits_get_max_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
5972 * Maximum allowed threshold above which outputs will not be generated in their commitment
5974 * HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
5976 * Default value: u64::max_value.
5978 void ChannelHandshakeLimits_set_max_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
5981 * Before a channel is usable the funding transaction will need to be confirmed by at least a
5982 * certain number of blocks, specified by the node which is not the funder (as the funder can
5983 * assume they aren't going to double-spend themselves).
5984 * This config allows you to set a limit on the maximum amount of time to wait.
5986 * Default value: 144, or roughly one day and only applies to outbound channels.
5988 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
5991 * Before a channel is usable the funding transaction will need to be confirmed by at least a
5992 * certain number of blocks, specified by the node which is not the funder (as the funder can
5993 * assume they aren't going to double-spend themselves).
5994 * This config allows you to set a limit on the maximum amount of time to wait.
5996 * Default value: 144, or roughly one day and only applies to outbound channels.
5998 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
6001 * Set to force the incoming channel to match our announced channel preference in
6004 * Default value: true, to make the default that no announced channels are possible (which is
6005 * appropriate for any nodes which are not online very reliably).
6007 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
6010 * Set to force the incoming channel to match our announced channel preference in
6013 * Default value: true, to make the default that no announced channels are possible (which is
6014 * appropriate for any nodes which are not online very reliably).
6016 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
6019 * Set to the amount of time we're willing to wait to claim money back to us.
6021 * Not checking this value would be a security issue, as our peer would be able to set it to
6022 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
6024 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
6025 * reduce the loss of having useless locked funds (if your peer accepts)
6027 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
6030 * Set to the amount of time we're willing to wait to claim money back to us.
6032 * Not checking this value would be a security issue, as our peer would be able to set it to
6033 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
6035 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
6036 * reduce the loss of having useless locked funds (if your peer accepts)
6038 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
6041 * Constructs a new ChannelHandshakeLimits given each field
6043 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);
6046 * Creates a copy of the ChannelHandshakeLimits
6048 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
6051 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
6053 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
6056 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
6058 void ChannelConfig_free(struct LDKChannelConfig this_obj);
6061 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
6062 * This may be allowed to change at runtime in a later update, however doing so must result in
6063 * update messages sent to notify all nodes of our updated relay fee.
6067 uint32_t ChannelConfig_get_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
6070 * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
6071 * This may be allowed to change at runtime in a later update, however doing so must result in
6072 * update messages sent to notify all nodes of our updated relay fee.
6076 void ChannelConfig_set_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
6079 * Set to announce the channel publicly and notify all nodes that they can route via this
6082 * This should only be set to true for nodes which expect to be online reliably.
6084 * As the node which funds a channel picks this value this will only apply for new outbound
6085 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
6087 * This cannot be changed after the initial channel handshake.
6089 * Default value: false.
6091 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
6094 * Set to announce the channel publicly and notify all nodes that they can route via this
6097 * This should only be set to true for nodes which expect to be online reliably.
6099 * As the node which funds a channel picks this value this will only apply for new outbound
6100 * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
6102 * This cannot be changed after the initial channel handshake.
6104 * Default value: false.
6106 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
6109 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
6110 * supports it, they will then enforce the mutual-close output to us matches what we provided
6111 * at intialization, preventing us from closing to an alternate pubkey.
6113 * This is set to true by default to provide a slight increase in security, though ultimately
6114 * any attacker who is able to take control of a channel can just as easily send the funds via
6115 * lightning payments, so we never require that our counterparties support this option.
6117 * This cannot be changed after a channel has been initialized.
6119 * Default value: true.
6121 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
6124 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
6125 * supports it, they will then enforce the mutual-close output to us matches what we provided
6126 * at intialization, preventing us from closing to an alternate pubkey.
6128 * This is set to true by default to provide a slight increase in security, though ultimately
6129 * any attacker who is able to take control of a channel can just as easily send the funds via
6130 * lightning payments, so we never require that our counterparties support this option.
6132 * This cannot be changed after a channel has been initialized.
6134 * Default value: true.
6136 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
6139 * Constructs a new ChannelConfig given each field
6141 MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional_millionths_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg);
6144 * Creates a copy of the ChannelConfig
6146 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
6149 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
6151 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
6154 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
6156 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
6159 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
6161 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
6164 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
6166 void UserConfig_free(struct LDKUserConfig this_obj);
6169 * Channel config that we propose to our counterparty.
6171 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
6174 * Channel config that we propose to our counterparty.
6176 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
6179 * Limits applied to our counterparty's proposed channel config settings.
6181 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
6184 * Limits applied to our counterparty's proposed channel config settings.
6186 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
6189 * Channel config which affects behavior during channel lifetime.
6191 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
6194 * Channel config which affects behavior during channel lifetime.
6196 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
6199 * Constructs a new UserConfig given each field
6201 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);
6204 * Creates a copy of the UserConfig
6206 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
6209 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
6211 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
6214 * Creates a copy of the AccessError
6216 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
6219 * Calls the free function if one is set
6221 void Access_free(struct LDKAccess this_ptr);
6224 * Calls the free function if one is set
6226 void Listen_free(struct LDKListen this_ptr);
6229 * Calls the free function if one is set
6231 void Watch_free(struct LDKWatch this_ptr);
6234 * Calls the free function if one is set
6236 void Filter_free(struct LDKFilter this_ptr);
6239 * Calls the free function if one is set
6241 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
6244 * Creates a copy of the ConfirmationTarget
6246 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
6249 * Calls the free function if one is set
6251 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
6254 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
6256 void ChainMonitor_free(struct LDKChainMonitor this_obj);
6259 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
6260 * of a channel and reacting accordingly based on transactions in the connected block. See
6261 * [`ChannelMonitor::block_connected`] for details. Any HTLCs that were resolved on chain will
6262 * be returned by [`chain::Watch::release_pending_monitor_events`].
6264 * Calls back to [`chain::Filter`] if any monitor indicated new outputs to watch. Subsequent
6265 * calls must not exclude any transactions matching the new outputs nor any in-block
6266 * descendants of such transactions. It is not necessary to re-fetch the block to obtain
6269 * [`ChannelMonitor::block_connected`]: ../channelmonitor/struct.ChannelMonitor.html#method.block_connected
6270 * [`chain::Watch::release_pending_monitor_events`]: ../trait.Watch.html#tymethod.release_pending_monitor_events
6271 * [`chain::Filter`]: ../trait.Filter.html
6273 void ChainMonitor_block_connected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
6276 * Dispatches to per-channel monitors, which are responsible for updating their on-chain view
6277 * of a channel based on the disconnected block. See [`ChannelMonitor::block_disconnected`] for
6280 * [`ChannelMonitor::block_disconnected`]: ../channelmonitor/struct.ChannelMonitor.html#method.block_disconnected
6282 void ChainMonitor_block_disconnected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t disconnected_height);
6285 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
6287 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
6288 * will call back to it indicating transactions and outputs of interest. This allows clients to
6289 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
6290 * always need to fetch full blocks absent another means for determining which blocks contain
6291 * transactions relevant to the watched channels.
6293 * [`chain::Filter`]: ../trait.Filter.html
6295 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
6298 * Constructs a new Watch which calls the relevant methods on this_arg.
6299 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
6301 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
6304 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
6305 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
6307 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
6310 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
6312 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
6315 * The sequence number of this update. Updates *must* be replayed in-order according to this
6316 * sequence number (and updates may panic if they are not). The update_id values are strictly
6317 * increasing and increase by one for each new update, with one exception specified below.
6319 * This sequence number is also used to track up to which points updates which returned
6320 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
6321 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
6323 * The only instance where update_id values are not strictly increasing is the case where we
6324 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
6325 * its docs for more details.
6327 * [`CLOSED_CHANNEL_UPDATE_ID`]: constant.CLOSED_CHANNEL_UPDATE_ID.html
6329 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
6332 * The sequence number of this update. Updates *must* be replayed in-order according to this
6333 * sequence number (and updates may panic if they are not). The update_id values are strictly
6334 * increasing and increase by one for each new update, with one exception specified below.
6336 * This sequence number is also used to track up to which points updates which returned
6337 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
6338 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
6340 * The only instance where update_id values are not strictly increasing is the case where we
6341 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
6342 * its docs for more details.
6344 * [`CLOSED_CHANNEL_UPDATE_ID`]: constant.CLOSED_CHANNEL_UPDATE_ID.html
6346 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
6349 * Creates a copy of the ChannelMonitorUpdate
6351 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
6354 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
6356 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
6359 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
6361 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
6364 * Creates a copy of the ChannelMonitorUpdateErr
6366 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
6369 * Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
6371 void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
6374 * Creates a copy of the MonitorUpdateError
6376 struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
6379 * Frees any resources used by the MonitorEvent
6381 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
6384 * Creates a copy of the MonitorEvent
6386 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
6389 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
6391 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
6394 * Creates a copy of the HTLCUpdate
6396 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
6399 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
6401 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
6404 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
6406 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
6409 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
6411 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
6414 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
6416 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
6419 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
6422 * panics if the given update is not the next update by update_id.
6424 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);
6427 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
6430 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
6433 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
6435 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
6438 * Gets a list of txids, with their output scripts (in the order they appear in the
6439 * transaction), which we must learn about spends of via block_connected().
6441 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
6444 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
6445 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
6446 * have been registered.
6448 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
6451 * Get the list of HTLCs who's status has been updated on chain. This should be called by
6452 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
6454 * [`chain::Watch::release_pending_monitor_events`]: ../trait.Watch.html#tymethod.release_pending_monitor_events
6456 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
6459 * Gets the list of pending events which were generated by previous actions, clearing the list
6462 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
6463 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
6464 * no internal locking in ChannelMonitors.
6466 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
6469 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
6470 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
6471 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
6472 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
6473 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
6474 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
6475 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
6476 * out-of-band the other node operator to coordinate with him if option is available to you.
6477 * In any-case, choice is up to the user.
6479 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);
6482 * Processes transactions in a newly connected block, which may result in any of the following:
6483 * - update the monitor's state against resolved HTLCs
6484 * - punish the counterparty in the case of seeing a revoked commitment transaction
6485 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
6486 * - detect settled outputs for later spending
6487 * - schedule and bump any in-flight claims
6489 * Returns any new outputs to watch from `txdata`; after called, these are also included in
6490 * [`get_outputs_to_watch`].
6492 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
6494 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);
6497 * Determines if the disconnected block contained any transactions of interest and updates
6500 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);
6503 * Calls the free function if one is set
6505 void Persist_free(struct LDKPersist this_ptr);
6508 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
6510 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
6513 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
6515 void OutPoint_free(struct LDKOutPoint this_obj);
6518 * The referenced transaction's txid.
6520 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
6523 * The referenced transaction's txid.
6525 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6528 * The index of the referenced output in its transaction's vout.
6530 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
6533 * The index of the referenced output in its transaction's vout.
6535 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
6538 * Constructs a new OutPoint given each field
6540 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
6543 * Creates a copy of the OutPoint
6545 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
6548 * Convert an `OutPoint` to a lightning channel id.
6550 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
6553 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
6555 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
6558 * Read a OutPoint from a byte array, created by OutPoint_write
6560 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
6563 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
6565 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
6568 * The outpoint which is spendable
6570 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
6573 * The outpoint which is spendable
6575 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
6578 * Per commitment point to derive delayed_payment_key by key holder
6580 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
6583 * Per commitment point to derive delayed_payment_key by key holder
6585 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6588 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
6589 * the witness_script.
6591 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
6594 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
6595 * the witness_script.
6597 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
6600 * The output which is referenced by the given outpoint
6602 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
6605 * The revocation point specific to the commitment transaction which was broadcast. Used to
6606 * derive the witnessScript for this output.
6608 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
6611 * The revocation point specific to the commitment transaction which was broadcast. Used to
6612 * derive the witnessScript for this output.
6614 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
6617 * Arbitrary identification information returned by a call to
6618 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
6619 * the channel to spend the output.
6621 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
6624 * Arbitrary identification information returned by a call to
6625 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
6626 * the channel to spend the output.
6628 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6631 * The value of the channel which this output originated from, possibly indirectly.
6633 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
6636 * The value of the channel which this output originated from, possibly indirectly.
6638 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
6641 * Constructs a new DelayedPaymentOutputDescriptor given each field
6643 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);
6646 * Creates a copy of the DelayedPaymentOutputDescriptor
6648 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
6651 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
6653 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
6656 * The outpoint which is spendable
6658 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
6661 * The outpoint which is spendable
6663 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
6666 * The output which is referenced by the given outpoint
6668 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
6671 * Arbitrary identification information returned by a call to
6672 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
6673 * the channel to spend the output.
6675 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
6678 * Arbitrary identification information returned by a call to
6679 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
6680 * the channel to spend the output.
6682 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6685 * The value of the channel which this transactions spends.
6687 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
6690 * The value of the channel which this transactions spends.
6692 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
6695 * Constructs a new StaticPaymentOutputDescriptor given each field
6697 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);
6700 * Creates a copy of the StaticPaymentOutputDescriptor
6702 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
6705 * Frees any resources used by the SpendableOutputDescriptor
6707 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
6710 * Creates a copy of the SpendableOutputDescriptor
6712 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
6715 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
6717 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
6720 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
6722 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
6725 * Creates a copy of a Sign
6727 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
6730 * Calls the free function if one is set
6732 void Sign_free(struct LDKSign this_ptr);
6735 * Calls the free function if one is set
6737 void KeysInterface_free(struct LDKKeysInterface this_ptr);
6740 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
6742 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
6745 * Private key of anchor tx
6747 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
6750 * Private key of anchor tx
6752 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
6755 * Holder secret key for blinded revocation pubkey
6757 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
6760 * Holder secret key for blinded revocation pubkey
6762 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
6765 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
6767 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
6770 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
6772 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
6775 * Holder secret key used in HTLC tx
6777 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
6780 * Holder secret key used in HTLC tx
6782 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
6785 * Holder htlc secret key used in commitment tx htlc outputs
6787 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
6790 * Holder htlc secret key used in commitment tx htlc outputs
6792 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
6797 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
6802 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6805 * Creates a copy of the InMemorySigner
6807 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
6810 * Create a new InMemorySigner
6812 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);
6815 * Counterparty pubkeys.
6816 * Will panic if ready_channel wasn't called.
6818 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
6821 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
6822 * transactions, ie the amount of time that we have to wait to recover our funds if we
6823 * broadcast a transaction.
6824 * Will panic if ready_channel wasn't called.
6826 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
6829 * The contest_delay value specified by us and applied on transactions broadcastable
6830 * by our counterparty, ie the amount of time that they have to wait to recover their funds
6831 * if they broadcast a transaction.
6832 * Will panic if ready_channel wasn't called.
6834 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
6837 * Whether the holder is the initiator
6838 * Will panic if ready_channel wasn't called.
6840 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
6844 * Will panic if ready_channel wasn't called.
6846 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
6849 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
6850 * building transactions.
6852 * Will panic if ready_channel wasn't called.
6854 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
6857 * Sign the single input of spend_tx at index `input_idx` which spends the output
6858 * described by descriptor, returning the witness stack for the input.
6860 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
6861 * or is not spending the outpoint described by `descriptor.outpoint`.
6863 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);
6866 * Sign the single input of spend_tx at index `input_idx` which spends the output
6867 * described by descriptor, returning the witness stack for the input.
6869 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
6870 * is not spending the outpoint described by `descriptor.outpoint`, or does not have a
6871 * sequence set to `descriptor.to_self_delay`.
6873 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);
6876 * Constructs a new Sign which calls the relevant methods on this_arg.
6877 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
6879 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
6882 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
6884 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
6887 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
6889 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
6892 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
6894 void KeysManager_free(struct LDKKeysManager this_obj);
6897 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
6898 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
6899 * starting_time isn't strictly required to actually be a time, but it must absolutely,
6900 * without a doubt, be unique to this instance. ie if you start multiple times with the same
6901 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
6902 * simply use the current time (with very high precision).
6904 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
6905 * obviously, starting_time should be unique every time you reload the library - it is only
6906 * used to generate new ephemeral key data (which will be stored by the individual channel if
6909 * Note that the seed is required to recover certain on-chain funds independent of
6910 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
6911 * channel, and some on-chain during-closing funds.
6913 * Note that until the 0.1 release there is no guarantee of backward compatibility between
6914 * versions. Once the library is more fully supported, the docs will be updated to include a
6915 * detailed description of the guarantee.
6917 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
6920 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
6922 * Key derivation parameters are accessible through a per-channel secrets
6923 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
6924 * onchain output detection for which a corresponding delayed_payment_key must be derived.
6926 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]);
6929 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
6930 * output to the given change destination (if sufficient change value remains). The
6931 * transaction will have a feerate, at least, of the given value.
6933 * Returns `Err(())` if the output value is greater than the input value minus required fee or
6934 * if a descriptor was duplicated.
6936 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
6938 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
6939 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
6941 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);
6944 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
6945 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
6947 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
6950 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
6952 void ChannelManager_free(struct LDKChannelManager this_obj);
6955 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
6957 void ChainParameters_free(struct LDKChainParameters this_obj);
6960 * The network for determining the `chain_hash` in Lightning messages.
6962 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
6965 * The network for determining the `chain_hash` in Lightning messages.
6967 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
6970 * The hash of the latest block successfully connected.
6972 const uint8_t (*ChainParameters_get_latest_hash(const struct LDKChainParameters *NONNULL_PTR this_ptr))[32];
6975 * The hash of the latest block successfully connected.
6977 void ChainParameters_set_latest_hash(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
6980 * The height of the latest block successfully connected.
6982 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
6984 uintptr_t ChainParameters_get_latest_height(const struct LDKChainParameters *NONNULL_PTR this_ptr);
6987 * The height of the latest block successfully connected.
6989 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
6991 void ChainParameters_set_latest_height(struct LDKChainParameters *NONNULL_PTR this_ptr, uintptr_t val);
6994 * Constructs a new ChainParameters given each field
6996 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKThirtyTwoBytes latest_hash_arg, uintptr_t latest_height_arg);
6999 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
7001 void ChannelDetails_free(struct LDKChannelDetails this_obj);
7004 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
7005 * thereafter this is the txid of the funding transaction xor the funding transaction output).
7006 * Note that this means this value is *not* persistent - it can change once during the
7007 * lifetime of the channel.
7009 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
7012 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
7013 * thereafter this is the txid of the funding transaction xor the funding transaction output).
7014 * Note that this means this value is *not* persistent - it can change once during the
7015 * lifetime of the channel.
7017 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7020 * The node_id of our counterparty
7022 struct LDKPublicKey ChannelDetails_get_remote_network_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7025 * The node_id of our counterparty
7027 void ChannelDetails_set_remote_network_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7030 * The Features the channel counterparty provided upon last connection.
7031 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
7032 * many routing-relevant features are present in the init context.
7034 struct LDKInitFeatures ChannelDetails_get_counterparty_features(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7037 * The Features the channel counterparty provided upon last connection.
7038 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
7039 * many routing-relevant features are present in the init context.
7041 void ChannelDetails_set_counterparty_features(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
7044 * The value, in satoshis, of this channel as appears in the funding output
7046 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7049 * The value, in satoshis, of this channel as appears in the funding output
7051 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
7054 * The user_id passed in to create_channel, or 0 if the channel was inbound.
7056 uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7059 * The user_id passed in to create_channel, or 0 if the channel was inbound.
7061 void ChannelDetails_set_user_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
7064 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
7065 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
7066 * available for inclusion in new outbound HTLCs). This further does not include any pending
7067 * outgoing HTLCs which are awaiting some other resolution to be sent.
7069 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7072 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
7073 * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
7074 * available for inclusion in new outbound HTLCs). This further does not include any pending
7075 * outgoing HTLCs which are awaiting some other resolution to be sent.
7077 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
7080 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
7081 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
7082 * available for inclusion in new inbound HTLCs).
7083 * Note that there are some corner cases not fully handled here, so the actual available
7084 * inbound capacity may be slightly higher than this.
7086 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7089 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
7090 * include any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
7091 * available for inclusion in new inbound HTLCs).
7092 * Note that there are some corner cases not fully handled here, so the actual available
7093 * inbound capacity may be slightly higher than this.
7095 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
7098 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
7099 * the peer is connected, and (c) no monitor update failure is pending resolution.
7101 bool ChannelDetails_get_is_live(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
7104 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
7105 * the peer is connected, and (c) no monitor update failure is pending resolution.
7107 void ChannelDetails_set_is_live(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
7110 * Creates a copy of the ChannelDetails
7112 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
7115 * Frees any resources used by the PaymentSendFailure
7117 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
7120 * Creates a copy of the PaymentSendFailure
7122 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
7125 * Constructs a new ChannelManager to hold several channels and route between them.
7127 * This is the main \"logic hub\" for all channel-related actions, and implements
7128 * ChannelMessageHandler.
7130 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
7132 * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
7134 * Users need to notify the new ChannelManager when a new block is connected or
7135 * disconnected using its `block_connected` and `block_disconnected` methods, starting
7136 * from after `params.latest_hash`.
7138 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);
7141 * Creates a new outbound channel to the given remote node and with the given value.
7143 * user_id will be provided back as user_channel_id in FundingGenerationReady and
7144 * FundingBroadcastSafe events to allow tracking of which events correspond with which
7145 * create_channel call. Note that user_channel_id defaults to 0 for inbound channels, so you
7146 * may wish to avoid using 0 for user_id here.
7148 * If successful, will generate a SendOpenChannel message event, so you should probably poll
7149 * PeerManager::process_events afterwards.
7151 * Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
7152 * greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
7154 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);
7157 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
7160 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
7163 * Gets the list of usable channels, in random order. Useful as an argument to
7164 * get_route to ensure non-announced channels are used.
7166 * These are guaranteed to have their is_live value set to true, see the documentation for
7167 * ChannelDetails::is_live for more info on exactly what the criteria are.
7169 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
7172 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
7173 * will be accepted on the given channel, and after additional timeout/the closing of all
7174 * pending HTLCs, the channel will be closed on chain.
7176 * May generate a SendShutdown message event on success, which should be relayed.
7178 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
7181 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
7182 * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
7184 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
7187 * Force close all channels, immediately broadcasting the latest local commitment transaction
7188 * for each to the chain and rejecting new HTLCs on each.
7190 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
7193 * Sends a payment along a given route.
7195 * Value parameters are provided via the last hop in route, see documentation for RouteHop
7196 * fields for more info.
7198 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
7199 * payment), we don't do anything to stop you! We always try to ensure that if the provided
7200 * next hop knows the preimage to payment_hash they can claim an additional amount as
7201 * specified in the last hop in the route! Thus, you should probably do your own
7202 * payment_preimage tracking (which you should already be doing as they represent \"proof of
7203 * payment\") and prevent double-sends yourself.
7205 * May generate SendHTLCs message(s) event on success, which should be relayed.
7207 * Each path may have a different return value, and PaymentSendValue may return a Vec with
7208 * each entry matching the corresponding-index entry in the route paths, see
7209 * PaymentSendFailure for more info.
7211 * In general, a path may raise:
7212 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
7213 * node public key) is specified.
7214 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
7215 * (including due to previous monitor update failure or new permanent monitor update
7217 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
7220 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
7221 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
7222 * different route unless you intend to pay twice!
7224 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
7225 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
7226 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
7227 * must not contain multiple paths as multi-path payments require a recipient-provided
7229 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
7230 * bit set (either as required or as available). If multiple paths are present in the Route,
7231 * we assume the invoice had the basic_mpp feature set.
7233 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);
7236 * Call this upon creation of a funding transaction for the given channel.
7238 * Note that ALL inputs in the transaction pointed to by funding_txo MUST spend SegWit outputs
7239 * or your counterparty can steal your funds!
7241 * Panics if a funding transaction has already been provided for this channel.
7243 * May panic if the funding_txo is duplicative with some other channel (note that this should
7244 * be trivially prevented by using unique funding transaction keys per-channel).
7246 void ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKOutPoint funding_txo);
7249 * Generates a signed node_announcement from the given arguments and creates a
7250 * BroadcastNodeAnnouncement event. Note that such messages will be ignored unless peers have
7251 * seen a channel_announcement from us (ie unless we have public channels open).
7253 * RGB is a node \"color\" and alias is a printable human-readable string to describe this node
7254 * to humans. They carry no in-protocol meaning.
7256 * addresses represent the set (possibly empty) of socket addresses on which this node accepts
7257 * incoming connections. These will be broadcast to the network, publicly tying these
7258 * addresses together. If you wish to preserve user privacy, addresses should likely contain
7259 * only Tor Onion addresses.
7261 * Panics if addresses is absurdly large (more than 500).
7263 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
7266 * Processes HTLCs which are pending waiting on random forward delay.
7268 * Should only really ever be called in response to a PendingHTLCsForwardable event.
7269 * Will likely generate further events.
7271 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
7274 * If a peer is disconnected we mark any channels with that peer as 'disabled'.
7275 * After some time, if channels are still disabled we need to broadcast a ChannelUpdate
7276 * to inform the network about the uselessness of these channels.
7278 * This method handles all the details, and must be called roughly once per minute.
7280 * Note that in some rare cases this may generate a `chain::Watch::update_channel` call.
7282 void ChannelManager_timer_chan_freshness_every_min(const struct LDKChannelManager *NONNULL_PTR this_arg);
7285 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
7286 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
7287 * along the path (including in our own channel on which we received it).
7288 * Returns false if no payment was found to fail backwards, true if the process of failing the
7289 * HTLC backwards has been started.
7291 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);
7294 * Provides a payment preimage in response to a PaymentReceived event, returning true and
7295 * generating message events for the net layer to claim the payment, if possible. Thus, you
7296 * should probably kick the net layer to go send messages if this returns true!
7298 * You must specify the expected amounts for this HTLC, and we will only claim HTLCs
7299 * available within a few percent of the expected amount. This is critical for several
7300 * reasons : a) it avoids providing senders with `proof-of-payment` (in the form of the
7301 * payment_preimage without having provided the full value and b) it avoids certain
7302 * privacy-breaking recipient-probing attacks which may reveal payment activity to
7303 * motivated attackers.
7305 * Note that the privacy concerns in (b) are not relevant in payments with a payment_secret
7306 * set. Thus, for such payments we will claim any payments which do not under-pay.
7308 * May panic if called except in response to a PaymentReceived event.
7310 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);
7313 * Gets the node_id held by this ChannelManager
7315 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
7318 * Restores a single, given channel to normal operation after a
7319 * ChannelMonitorUpdateErr::TemporaryFailure was returned from a channel monitor update
7322 * All ChannelMonitor updates up to and including highest_applied_update_id must have been
7323 * fully committed in every copy of the given channels' ChannelMonitors.
7325 * Note that there is no effect to calling with a highest_applied_update_id other than the
7326 * current latest ChannelMonitorUpdate and one call to this function after multiple
7327 * ChannelMonitorUpdateErr::TemporaryFailures is fine. The highest_applied_update_id field
7328 * exists largely only to prevent races between this and concurrent update_monitor calls.
7330 * Thus, the anticipated use is, at a high level:
7331 * 1) You register a chain::Watch with this ChannelManager,
7332 * 2) it stores each update to disk, and begins updating any remote (eg watchtower) copies of
7333 * said ChannelMonitors as it can, returning ChannelMonitorUpdateErr::TemporaryFailures
7334 * any time it cannot do so instantly,
7335 * 3) update(s) are applied to each remote copy of a ChannelMonitor,
7336 * 4) once all remote copies are updated, you call this function with the update_id that
7337 * completed, and once it is the latest the Channel will be re-enabled.
7339 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);
7342 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
7343 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
7345 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
7348 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
7349 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
7351 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
7354 * Constructs a new Listen which calls the relevant methods on this_arg.
7355 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
7357 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
7360 * Updates channel state based on transactions seen in a connected block.
7362 void ChannelManager_block_connected(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
7365 * Updates channel state based on a disconnected block.
7367 * If necessary, the channel may be force-closed without letting the counterparty participate
7370 void ChannelManager_block_disconnected(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80]);
7373 * Blocks until ChannelManager needs to be persisted. Only one listener on
7374 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
7377 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
7380 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
7381 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
7383 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
7386 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
7388 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
7391 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
7393 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
7396 * The keys provider which will give us relevant keys. Some keys will be loaded during
7397 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
7400 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
7403 * The keys provider which will give us relevant keys. Some keys will be loaded during
7404 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
7407 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
7410 * The fee_estimator for use in the ChannelManager in the future.
7412 * No calls to the FeeEstimator will be made during deserialization.
7414 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
7417 * The fee_estimator for use in the ChannelManager in the future.
7419 * No calls to the FeeEstimator will be made during deserialization.
7421 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
7424 * The chain::Watch for use in the ChannelManager in the future.
7426 * No calls to the chain::Watch will be made during deserialization. It is assumed that
7427 * you have deserialized ChannelMonitors separately and will add them to your
7428 * chain::Watch after deserializing this ChannelManager.
7430 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
7433 * The chain::Watch for use in the ChannelManager in the future.
7435 * No calls to the chain::Watch will be made during deserialization. It is assumed that
7436 * you have deserialized ChannelMonitors separately and will add them to your
7437 * chain::Watch after deserializing this ChannelManager.
7439 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
7442 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
7443 * used to broadcast the latest local commitment transactions of channels which must be
7444 * force-closed during deserialization.
7446 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
7449 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
7450 * used to broadcast the latest local commitment transactions of channels which must be
7451 * force-closed during deserialization.
7453 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
7456 * The Logger for use in the ChannelManager and which may be used to log information during
7459 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
7462 * The Logger for use in the ChannelManager and which may be used to log information during
7465 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
7468 * Default settings used for new channels. Any existing channels will continue to use the
7469 * runtime settings which were stored when the ChannelManager was serialized.
7471 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
7474 * Default settings used for new channels. Any existing channels will continue to use the
7475 * runtime settings which were stored when the ChannelManager was serialized.
7477 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
7480 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
7481 * HashMap for you. This is primarily useful for C bindings where it is not practical to
7482 * populate a HashMap directly from C.
7484 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);
7487 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
7489 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
7492 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
7494 void DecodeError_free(struct LDKDecodeError this_obj);
7497 * Creates a copy of the DecodeError
7499 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
7502 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
7504 void Init_free(struct LDKInit this_obj);
7507 * The relevant features which the sender supports
7509 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
7512 * The relevant features which the sender supports
7514 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
7517 * Constructs a new Init given each field
7519 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
7522 * Creates a copy of the Init
7524 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
7527 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
7529 void ErrorMessage_free(struct LDKErrorMessage this_obj);
7532 * The channel ID involved in the error
7534 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
7537 * The channel ID involved in the error
7539 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7542 * A possibly human-readable error description.
7543 * The string should be sanitized before it is used (e.g. emitted to logs
7544 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
7545 * vulnerability in the terminal emulator or the logging subsystem.
7547 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
7550 * A possibly human-readable error description.
7551 * The string should be sanitized before it is used (e.g. emitted to logs
7552 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
7553 * vulnerability in the terminal emulator or the logging subsystem.
7555 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
7558 * Constructs a new ErrorMessage given each field
7560 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg);
7563 * Creates a copy of the ErrorMessage
7565 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
7568 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
7570 void Ping_free(struct LDKPing this_obj);
7573 * The desired response length
7575 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
7578 * The desired response length
7580 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
7583 * The ping packet size.
7584 * This field is not sent on the wire. byteslen zeros are sent.
7586 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
7589 * The ping packet size.
7590 * This field is not sent on the wire. byteslen zeros are sent.
7592 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
7595 * Constructs a new Ping given each field
7597 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
7600 * Creates a copy of the Ping
7602 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
7605 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
7607 void Pong_free(struct LDKPong this_obj);
7610 * The pong packet size.
7611 * This field is not sent on the wire. byteslen zeros are sent.
7613 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
7616 * The pong packet size.
7617 * This field is not sent on the wire. byteslen zeros are sent.
7619 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
7622 * Constructs a new Pong given each field
7624 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
7627 * Creates a copy of the Pong
7629 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
7632 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
7634 void OpenChannel_free(struct LDKOpenChannel this_obj);
7637 * The genesis hash of the blockchain where the channel is to be opened
7639 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
7642 * The genesis hash of the blockchain where the channel is to be opened
7644 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7647 * A temporary channel ID, until the funding outpoint is announced
7649 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
7652 * A temporary channel ID, until the funding outpoint is announced
7654 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7659 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7664 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
7667 * The amount to push to the counterparty as part of the open, in milli-satoshi
7669 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7672 * The amount to push to the counterparty as part of the open, in milli-satoshi
7674 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
7677 * The threshold below which outputs on transactions broadcast by sender will be omitted
7679 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7682 * The threshold below which outputs on transactions broadcast by sender will be omitted
7684 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
7687 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
7689 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7692 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
7694 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
7697 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
7699 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7702 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
7704 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
7707 * The minimum HTLC size incoming to sender, in milli-satoshi
7709 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7712 * The minimum HTLC size incoming to sender, in milli-satoshi
7714 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
7717 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
7719 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7722 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
7724 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
7727 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
7729 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7732 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
7734 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
7737 * The maximum number of inbound HTLCs towards sender
7739 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7742 * The maximum number of inbound HTLCs towards sender
7744 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
7747 * The sender's key controlling the funding transaction
7749 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7752 * The sender's key controlling the funding transaction
7754 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7757 * Used to derive a revocation key for transactions broadcast by counterparty
7759 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7762 * Used to derive a revocation key for transactions broadcast by counterparty
7764 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7767 * A payment key to sender for transactions broadcast by counterparty
7769 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7772 * A payment key to sender for transactions broadcast by counterparty
7774 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7777 * Used to derive a payment key to sender for transactions broadcast by sender
7779 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7782 * Used to derive a payment key to sender for transactions broadcast by sender
7784 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7787 * Used to derive an HTLC payment key to sender
7789 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7792 * Used to derive an HTLC payment key to sender
7794 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7797 * The first to-be-broadcast-by-sender transaction's per commitment point
7799 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7802 * The first to-be-broadcast-by-sender transaction's per commitment point
7804 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7809 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
7814 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
7817 * Creates a copy of the OpenChannel
7819 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
7822 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
7824 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
7827 * A temporary channel ID, until the funding outpoint is announced
7829 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
7832 * A temporary channel ID, until the funding outpoint is announced
7834 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7837 * The threshold below which outputs on transactions broadcast by sender will be omitted
7839 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
7842 * The threshold below which outputs on transactions broadcast by sender will be omitted
7844 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
7847 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
7849 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
7852 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
7854 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
7857 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
7859 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
7862 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
7864 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
7867 * The minimum HTLC size incoming to sender, in milli-satoshi
7869 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
7872 * The minimum HTLC size incoming to sender, in milli-satoshi
7874 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
7877 * Minimum depth of the funding transaction before the channel is considered open
7879 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
7882 * Minimum depth of the funding transaction before the channel is considered open
7884 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
7887 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
7889 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
7892 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
7894 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
7897 * The maximum number of inbound HTLCs towards sender
7899 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
7902 * The maximum number of inbound HTLCs towards sender
7904 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
7907 * The sender's key controlling the funding transaction
7909 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
7912 * The sender's key controlling the funding transaction
7914 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7917 * Used to derive a revocation key for transactions broadcast by counterparty
7919 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
7922 * Used to derive a revocation key for transactions broadcast by counterparty
7924 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7927 * A payment key to sender for transactions broadcast by counterparty
7929 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
7932 * A payment key to sender for transactions broadcast by counterparty
7934 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7937 * Used to derive a payment key to sender for transactions broadcast by sender
7939 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
7942 * Used to derive a payment key to sender for transactions broadcast by sender
7944 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7947 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
7949 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
7952 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
7954 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7957 * The first to-be-broadcast-by-sender transaction's per commitment point
7959 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
7962 * The first to-be-broadcast-by-sender transaction's per commitment point
7964 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
7967 * Creates a copy of the AcceptChannel
7969 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
7972 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
7974 void FundingCreated_free(struct LDKFundingCreated this_obj);
7977 * A temporary channel ID, until the funding is established
7979 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
7982 * A temporary channel ID, until the funding is established
7984 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7987 * The funding transaction ID
7989 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
7992 * The funding transaction ID
7994 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
7997 * The specific output index funding this channel
7999 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
8002 * The specific output index funding this channel
8004 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
8007 * The signature of the channel initiator (funder) on the funding transaction
8009 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
8012 * The signature of the channel initiator (funder) on the funding transaction
8014 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
8017 * Constructs a new FundingCreated given each field
8019 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);
8022 * Creates a copy of the FundingCreated
8024 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
8027 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
8029 void FundingSigned_free(struct LDKFundingSigned this_obj);
8034 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
8039 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8042 * The signature of the channel acceptor (fundee) on the funding transaction
8044 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
8047 * The signature of the channel acceptor (fundee) on the funding transaction
8049 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
8052 * Constructs a new FundingSigned given each field
8054 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
8057 * Creates a copy of the FundingSigned
8059 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
8062 * Frees any resources used by the FundingLocked, if is_owned is set and inner is non-NULL.
8064 void FundingLocked_free(struct LDKFundingLocked this_obj);
8069 const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32];
8074 void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8077 * The per-commitment point of the second commitment transaction
8079 struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr);
8082 * The per-commitment point of the second commitment transaction
8084 void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8087 * Constructs a new FundingLocked given each field
8089 MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
8092 * Creates a copy of the FundingLocked
8094 struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
8097 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
8099 void Shutdown_free(struct LDKShutdown this_obj);
8104 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
8109 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8112 * The destination of this peer's funds on closing.
8113 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
8115 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
8118 * The destination of this peer's funds on closing.
8119 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
8121 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
8124 * Constructs a new Shutdown given each field
8126 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
8129 * Creates a copy of the Shutdown
8131 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
8134 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
8136 void ClosingSigned_free(struct LDKClosingSigned this_obj);
8141 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
8146 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8149 * The proposed total fee for the closing transaction
8151 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
8154 * The proposed total fee for the closing transaction
8156 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
8159 * A signature on the closing transaction
8161 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
8164 * A signature on the closing transaction
8166 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
8169 * Constructs a new ClosingSigned given each field
8171 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg);
8174 * Creates a copy of the ClosingSigned
8176 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
8179 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
8181 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
8186 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
8191 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8196 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
8201 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
8204 * The HTLC value in milli-satoshi
8206 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
8209 * The HTLC value in milli-satoshi
8211 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
8214 * The payment hash, the pre-image of which controls HTLC redemption
8216 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
8219 * The payment hash, the pre-image of which controls HTLC redemption
8221 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8224 * The expiry height of the HTLC
8226 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
8229 * The expiry height of the HTLC
8231 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
8234 * Creates a copy of the UpdateAddHTLC
8236 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
8239 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
8241 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
8246 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
8251 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8256 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
8261 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
8264 * The pre-image of the payment hash, allowing HTLC redemption
8266 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
8269 * The pre-image of the payment hash, allowing HTLC redemption
8271 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8274 * Constructs a new UpdateFulfillHTLC given each field
8276 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
8279 * Creates a copy of the UpdateFulfillHTLC
8281 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
8284 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
8286 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
8291 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
8296 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8301 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
8306 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
8309 * Creates a copy of the UpdateFailHTLC
8311 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
8314 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
8316 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
8321 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
8326 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8331 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
8336 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
8341 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
8346 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
8349 * Creates a copy of the UpdateFailMalformedHTLC
8351 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
8354 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
8356 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
8361 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
8366 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8369 * A signature on the commitment transaction
8371 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
8374 * A signature on the commitment transaction
8376 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
8379 * Signatures on the HTLC transactions
8381 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
8384 * Constructs a new CommitmentSigned given each field
8386 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
8389 * Creates a copy of the CommitmentSigned
8391 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
8394 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
8396 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
8401 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
8406 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8409 * The secret corresponding to the per-commitment point
8411 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
8414 * The secret corresponding to the per-commitment point
8416 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8419 * The next sender-broadcast commitment transaction's per-commitment point
8421 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
8424 * The next sender-broadcast commitment transaction's per-commitment point
8426 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8429 * Constructs a new RevokeAndACK given each field
8431 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);
8434 * Creates a copy of the RevokeAndACK
8436 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
8439 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
8441 void UpdateFee_free(struct LDKUpdateFee this_obj);
8446 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
8451 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8454 * Fee rate per 1000-weight of the transaction
8456 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
8459 * Fee rate per 1000-weight of the transaction
8461 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
8464 * Constructs a new UpdateFee given each field
8466 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
8469 * Creates a copy of the UpdateFee
8471 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
8474 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
8476 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
8479 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
8480 * belonging to the recipient
8482 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
8485 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
8486 * belonging to the recipient
8488 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8491 * The sender's per-commitment point for their current commitment transaction
8493 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
8496 * The sender's per-commitment point for their current commitment transaction
8498 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8501 * Constructs a new DataLossProtect given each field
8503 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
8506 * Creates a copy of the DataLossProtect
8508 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
8511 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
8513 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
8518 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
8523 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8526 * The next commitment number for the sender
8528 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
8531 * The next commitment number for the sender
8533 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
8536 * The next commitment number for the recipient
8538 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
8541 * The next commitment number for the recipient
8543 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
8546 * Creates a copy of the ChannelReestablish
8548 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
8551 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
8553 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
8558 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
8563 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8566 * The short channel ID
8568 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
8571 * The short channel ID
8573 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
8576 * A signature by the node key
8578 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
8581 * A signature by the node key
8583 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
8586 * A signature by the funding key
8588 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
8591 * A signature by the funding key
8593 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
8596 * Constructs a new AnnouncementSignatures given each field
8598 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);
8601 * Creates a copy of the AnnouncementSignatures
8603 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
8606 * Frees any resources used by the NetAddress
8608 void NetAddress_free(struct LDKNetAddress this_ptr);
8611 * Creates a copy of the NetAddress
8613 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
8616 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
8618 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
8621 * Read a Result from a byte array, created by Result_write
8623 struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
8626 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
8628 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
8631 * The advertised features
8633 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
8636 * The advertised features
8638 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
8641 * A strictly monotonic announcement counter, with gaps allowed
8643 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
8646 * A strictly monotonic announcement counter, with gaps allowed
8648 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
8651 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
8654 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
8657 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
8660 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8663 * An RGB color for UI purposes
8665 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
8668 * An RGB color for UI purposes
8670 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
8673 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
8676 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
8679 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
8682 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8685 * List of addresses on which this node is reachable
8687 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
8690 * Creates a copy of the UnsignedNodeAnnouncement
8692 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
8695 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
8697 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
8700 * The signature by the node key
8702 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
8705 * The signature by the node key
8707 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
8710 * The actual content of the announcement
8712 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
8715 * The actual content of the announcement
8717 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
8720 * Constructs a new NodeAnnouncement given each field
8722 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
8725 * Creates a copy of the NodeAnnouncement
8727 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
8730 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
8732 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
8735 * The advertised channel features
8737 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
8740 * The advertised channel features
8742 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
8745 * The genesis hash of the blockchain where the channel is to be opened
8747 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
8750 * The genesis hash of the blockchain where the channel is to be opened
8752 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8755 * The short channel ID
8757 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
8760 * The short channel ID
8762 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
8765 * One of the two node_ids which are endpoints of this channel
8767 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
8770 * One of the two node_ids which are endpoints of this channel
8772 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8775 * The other of the two node_ids which are endpoints of this channel
8777 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
8780 * The other of the two node_ids which are endpoints of this channel
8782 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8785 * The funding key for the first node
8787 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
8790 * The funding key for the first node
8792 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8795 * The funding key for the second node
8797 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
8800 * The funding key for the second node
8802 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
8805 * Creates a copy of the UnsignedChannelAnnouncement
8807 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
8810 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
8812 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
8815 * Authentication of the announcement by the first public node
8817 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
8820 * Authentication of the announcement by the first public node
8822 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
8825 * Authentication of the announcement by the second public node
8827 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
8830 * Authentication of the announcement by the second public node
8832 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
8835 * Proof of funding UTXO ownership by the first public node
8837 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
8840 * Proof of funding UTXO ownership by the first public node
8842 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
8845 * Proof of funding UTXO ownership by the second public node
8847 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
8850 * Proof of funding UTXO ownership by the second public node
8852 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
8855 * The actual announcement
8857 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
8860 * The actual announcement
8862 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
8865 * Constructs a new ChannelAnnouncement given each field
8867 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);
8870 * Creates a copy of the ChannelAnnouncement
8872 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
8875 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
8877 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
8880 * The genesis hash of the blockchain where the channel is to be opened
8882 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
8885 * The genesis hash of the blockchain where the channel is to be opened
8887 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
8890 * The short channel ID
8892 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
8895 * The short channel ID
8897 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
8900 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
8902 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
8905 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
8907 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
8912 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
8917 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
8920 * The number of blocks to subtract from incoming HTLC cltv_expiry values
8922 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
8925 * The number of blocks to subtract from incoming HTLC cltv_expiry values
8927 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
8930 * The minimum HTLC size incoming to sender, in milli-satoshi
8932 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
8935 * The minimum HTLC size incoming to sender, in milli-satoshi
8937 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
8940 * The base HTLC fee charged by sender, in milli-satoshi
8942 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
8945 * The base HTLC fee charged by sender, in milli-satoshi
8947 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
8950 * The amount to fee multiplier, in micro-satoshi
8952 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
8955 * The amount to fee multiplier, in micro-satoshi
8957 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
8960 * Creates a copy of the UnsignedChannelUpdate
8962 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
8965 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
8967 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
8970 * A signature of the channel update
8972 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
8975 * A signature of the channel update
8977 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
8980 * The actual channel update
8982 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
8985 * The actual channel update
8987 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
8990 * Constructs a new ChannelUpdate given each field
8992 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
8995 * Creates a copy of the ChannelUpdate
8997 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
9000 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
9002 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
9005 * The genesis hash of the blockchain being queried
9007 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
9010 * The genesis hash of the blockchain being queried
9012 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
9015 * The height of the first block for the channel UTXOs being queried
9017 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
9020 * The height of the first block for the channel UTXOs being queried
9022 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
9025 * The number of blocks to include in the query results
9027 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
9030 * The number of blocks to include in the query results
9032 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
9035 * Constructs a new QueryChannelRange given each field
9037 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
9040 * Creates a copy of the QueryChannelRange
9042 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
9045 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
9047 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
9050 * The genesis hash of the blockchain being queried
9052 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
9055 * The genesis hash of the blockchain being queried
9057 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
9060 * The height of the first block in the range of the reply
9062 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
9065 * The height of the first block in the range of the reply
9067 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
9070 * The number of blocks included in the range of the reply
9072 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
9075 * The number of blocks included in the range of the reply
9077 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
9080 * True when this is the final reply for a query
9082 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
9085 * True when this is the final reply for a query
9087 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
9090 * The short_channel_ids in the channel range
9092 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
9095 * Constructs a new ReplyChannelRange given each field
9097 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);
9100 * Creates a copy of the ReplyChannelRange
9102 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
9105 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
9107 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
9110 * The genesis hash of the blockchain being queried
9112 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
9115 * The genesis hash of the blockchain being queried
9117 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
9120 * The short_channel_ids that are being queried
9122 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
9125 * Constructs a new QueryShortChannelIds given each field
9127 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
9130 * Creates a copy of the QueryShortChannelIds
9132 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
9135 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
9137 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
9140 * The genesis hash of the blockchain that was queried
9142 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
9145 * The genesis hash of the blockchain that was queried
9147 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
9150 * Indicates if the query recipient maintains up-to-date channel
9151 * information for the chain_hash
9153 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
9156 * Indicates if the query recipient maintains up-to-date channel
9157 * information for the chain_hash
9159 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
9162 * Constructs a new ReplyShortChannelIdsEnd given each field
9164 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
9167 * Creates a copy of the ReplyShortChannelIdsEnd
9169 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
9172 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
9174 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
9177 * The genesis hash of the blockchain for channel and node information
9179 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
9182 * The genesis hash of the blockchain for channel and node information
9184 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
9187 * The starting unix timestamp
9189 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
9192 * The starting unix timestamp
9194 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
9197 * The range of information in seconds
9199 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
9202 * The range of information in seconds
9204 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
9207 * Constructs a new GossipTimestampFilter given each field
9209 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
9212 * Creates a copy of the GossipTimestampFilter
9214 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
9217 * Frees any resources used by the ErrorAction
9219 void ErrorAction_free(struct LDKErrorAction this_ptr);
9222 * Creates a copy of the ErrorAction
9224 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
9227 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
9229 void LightningError_free(struct LDKLightningError this_obj);
9232 * A human-readable message describing the error
9234 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
9237 * A human-readable message describing the error
9239 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
9242 * The action which should be taken against the offending peer.
9244 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
9247 * The action which should be taken against the offending peer.
9249 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
9252 * Constructs a new LightningError given each field
9254 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKCVec_u8Z err_arg, struct LDKErrorAction action_arg);
9257 * Creates a copy of the LightningError
9259 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
9262 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
9264 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
9267 * update_add_htlc messages which should be sent
9269 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
9272 * update_fulfill_htlc messages which should be sent
9274 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
9277 * update_fail_htlc messages which should be sent
9279 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
9282 * update_fail_malformed_htlc messages which should be sent
9284 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
9287 * An update_fee message which should be sent
9289 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
9292 * An update_fee message which should be sent
9294 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
9297 * Finally, the commitment_signed message which should be sent
9299 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
9302 * Finally, the commitment_signed message which should be sent
9304 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
9307 * Constructs a new CommitmentUpdate given each field
9309 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);
9312 * Creates a copy of the CommitmentUpdate
9314 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
9317 * Frees any resources used by the HTLCFailChannelUpdate
9319 void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr);
9322 * Creates a copy of the HTLCFailChannelUpdate
9324 struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig);
9327 * Calls the free function if one is set
9329 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
9332 * Calls the free function if one is set
9334 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
9337 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
9339 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
9342 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
9344 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
9347 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
9349 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
9352 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
9354 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
9357 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
9359 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
9362 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
9364 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
9367 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
9369 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
9372 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
9374 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
9377 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
9379 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
9382 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
9384 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
9387 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
9389 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
9392 * Read a FundingCreated from a byte array, created by FundingCreated_write
9394 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
9397 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
9399 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
9402 * Read a FundingSigned from a byte array, created by FundingSigned_write
9404 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
9407 * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
9409 struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
9412 * Read a FundingLocked from a byte array, created by FundingLocked_write
9414 struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
9417 * Serialize the Init object into a byte array which can be read by Init_read
9419 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
9422 * Read a Init from a byte array, created by Init_write
9424 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
9427 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
9429 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
9432 * Read a OpenChannel from a byte array, created by OpenChannel_write
9434 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
9437 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
9439 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
9442 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
9444 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
9447 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
9449 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
9452 * Read a Shutdown from a byte array, created by Shutdown_write
9454 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
9457 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
9459 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
9462 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
9464 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
9467 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
9469 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
9472 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
9474 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
9477 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
9479 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
9482 * Read a UpdateFee from a byte array, created by UpdateFee_write
9484 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
9487 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
9489 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
9492 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
9494 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
9497 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
9499 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
9502 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
9504 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
9507 * Serialize the Ping object into a byte array which can be read by Ping_read
9509 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
9512 * Read a Ping from a byte array, created by Ping_write
9514 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
9517 * Serialize the Pong object into a byte array which can be read by Pong_read
9519 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
9522 * Read a Pong from a byte array, created by Pong_write
9524 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
9527 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
9529 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
9532 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
9534 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
9537 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
9539 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
9542 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
9544 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
9547 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
9549 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
9552 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
9554 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
9557 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
9559 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
9562 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
9564 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
9567 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
9569 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
9572 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
9574 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
9577 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
9579 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
9582 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
9584 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
9587 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
9589 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
9592 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
9594 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
9597 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
9599 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
9602 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
9604 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
9607 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
9609 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
9612 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
9614 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
9617 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
9619 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
9622 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
9624 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
9627 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
9629 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
9632 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
9634 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
9637 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
9639 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
9642 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
9644 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
9647 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
9649 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
9652 * Constructs a new IgnoringMessageHandler given each field
9654 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
9657 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
9658 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
9660 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
9663 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
9664 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
9666 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
9669 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
9671 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
9674 * Constructs a new ErroringMessageHandler
9676 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
9679 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
9680 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
9682 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
9685 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
9686 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
9688 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
9691 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
9693 void MessageHandler_free(struct LDKMessageHandler this_obj);
9696 * A message handler which handles messages specific to channels. Usually this is just a
9697 * ChannelManager object or a ErroringMessageHandler.
9699 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
9702 * A message handler which handles messages specific to channels. Usually this is just a
9703 * ChannelManager object or a ErroringMessageHandler.
9705 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
9708 * A message handler which handles messages updating our knowledge of the network channel
9709 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
9711 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
9714 * A message handler which handles messages updating our knowledge of the network channel
9715 * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
9717 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
9720 * Constructs a new MessageHandler given each field
9722 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
9725 * Creates a copy of a SocketDescriptor
9727 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
9730 * Calls the free function if one is set
9732 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
9735 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
9737 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
9740 * Used to indicate that we probably can't make any future connections to this peer, implying
9741 * we should go ahead and force-close any channels we have with it.
9743 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
9746 * Used to indicate that we probably can't make any future connections to this peer, implying
9747 * we should go ahead and force-close any channels we have with it.
9749 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
9752 * Constructs a new PeerHandleError given each field
9754 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
9757 * Creates a copy of the PeerHandleError
9759 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
9762 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
9764 void PeerManager_free(struct LDKPeerManager this_obj);
9767 * Constructs a new PeerManager with the given message handlers and node_id secret key
9768 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
9769 * cryptographically secure random bytes.
9771 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);
9774 * Get the list of node ids for peers which have completed the initial handshake.
9776 * For outbound connections, this will be the same as the their_node_id parameter passed in to
9777 * new_outbound_connection, however entries will only appear once the initial handshake has
9778 * completed and we are sure the remote peer has the private key for the given node_id.
9780 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
9783 * Indicates a new outbound connection has been established to a node with the given node_id.
9784 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
9785 * descriptor but must disconnect the connection immediately.
9787 * Returns a small number of bytes to send to the remote node (currently always 50).
9789 * Panics if descriptor is duplicative with some other descriptor which has not yet had a
9790 * socket_disconnected().
9792 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);
9795 * Indicates a new inbound connection has been established.
9797 * May refuse the connection by returning an Err, but will never write bytes to the remote end
9798 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
9799 * call socket_disconnected for the new descriptor but must disconnect the connection
9802 * Panics if descriptor is duplicative with some other descriptor which has not yet had
9803 * socket_disconnected called.
9805 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor);
9808 * Indicates that there is room to write data to the given socket descriptor.
9810 * May return an Err to indicate that the connection should be closed.
9812 * Will most likely call send_data on the descriptor passed in (or the descriptor handed into
9813 * new_*\\_connection) before returning. Thus, be very careful with reentrancy issues! The
9814 * invariants around calling write_buffer_space_avail in case a write did not fully complete
9815 * must still hold - be ready to call write_buffer_space_avail again if a write call generated
9816 * here isn't sufficient! Panics if the descriptor was not previously registered in a
9817 * new_\\*_connection event.
9819 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
9822 * Indicates that data was read from the given socket descriptor.
9824 * May return an Err to indicate that the connection should be closed.
9826 * Will *not* call back into send_data on any descriptors to avoid reentrancy complexity.
9827 * Thus, however, you almost certainly want to call process_events() after any read_event to
9828 * generate send_data calls to handle responses.
9830 * If Ok(true) is returned, further read_events should not be triggered until a send_data call
9831 * on this file descriptor has resume_read set (preventing DoS issues in the send buffer).
9833 * Panics if the descriptor was not previously registered in a new_*_connection event.
9835 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);
9838 * Checks for any events generated by our handlers and processes them. Includes sending most
9839 * response messages as well as messages generated by calls to handler functions directly (eg
9840 * functions like ChannelManager::process_pending_htlc_forward or send_payment).
9842 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
9845 * Indicates that the given socket descriptor's connection is now closed.
9847 * This must only be called if the socket has been disconnected by the peer or your own
9848 * decision to disconnect it and must NOT be called in any case where other parts of this
9849 * library (eg PeerHandleError, explicit disconnect_socket calls) instruct you to disconnect
9852 * Panics if the descriptor was not previously registered in a successful new_*_connection event.
9854 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
9857 * Disconnect a peer given its node id.
9859 * Set no_connection_possible to true to prevent any further connection with this peer,
9860 * force-closing any channels we have with it.
9862 * If a peer is connected, this will call `disconnect_socket` on the descriptor for the peer,
9863 * so be careful about reentrancy issues.
9865 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
9868 * This function should be called roughly once every 30 seconds.
9869 * It will send pings to each peer and disconnect those which did not respond to the last round of pings.
9870 * Will most likely call send_data on all of the registered descriptors, thus, be very careful with reentrancy issues!
9872 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
9875 * Build the commitment secret from the seed and the commitment number
9877 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
9880 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
9881 * from the base secret and the per_commitment_point.
9883 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
9884 * generated (ie our own).
9886 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
9889 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
9890 * from the base point and the per_commitment_key. This is the public equivalent of
9891 * derive_private_key - using only public keys to derive a public key instead of private keys.
9893 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
9894 * generated (ie our own).
9896 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
9899 * Derives a per-commitment-transaction revocation key from its constituent parts.
9901 * Only the cheating participant owns a valid witness to propagate a revoked
9902 * commitment transaction, thus per_commitment_secret always come from cheater
9903 * and revocation_base_secret always come from punisher, which is the broadcaster
9904 * of the transaction spending with this key knowledge.
9906 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
9907 * generated (ie our own).
9909 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
9912 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
9913 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
9914 * public key instead of private keys.
9916 * Only the cheating participant owns a valid witness to propagate a revoked
9917 * commitment transaction, thus per_commitment_point always come from cheater
9918 * and revocation_base_point always come from punisher, which is the broadcaster
9919 * of the transaction spending with this key knowledge.
9921 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
9922 * generated (ie our own).
9924 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
9927 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
9929 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
9932 * The broadcaster's per-commitment public key which was used to derive the other keys.
9934 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
9937 * The broadcaster's per-commitment public key which was used to derive the other keys.
9939 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
9942 * The revocation key which is used to allow the broadcaster of the commitment
9943 * transaction to provide their counterparty the ability to punish them if they broadcast
9946 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
9949 * The revocation key which is used to allow the broadcaster of the commitment
9950 * transaction to provide their counterparty the ability to punish them if they broadcast
9953 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
9956 * Broadcaster's HTLC Key
9958 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
9961 * Broadcaster's HTLC Key
9963 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
9966 * Countersignatory's HTLC Key
9968 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
9971 * Countersignatory's HTLC Key
9973 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
9976 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
9978 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
9981 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
9983 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
9986 * Constructs a new TxCreationKeys given each field
9988 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);
9991 * Creates a copy of the TxCreationKeys
9993 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
9996 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
9998 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
10001 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
10003 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
10006 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
10008 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
10011 * The public key which is used to sign all commitment transactions, as it appears in the
10012 * on-chain channel lock-in 2-of-2 multisig output.
10014 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
10017 * The public key which is used to sign all commitment transactions, as it appears in the
10018 * on-chain channel lock-in 2-of-2 multisig output.
10020 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10023 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
10024 * revocation keys. This is combined with the per-commitment-secret generated by the
10025 * counterparty to create a secret which the counterparty can reveal to revoke previous
10028 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
10031 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
10032 * revocation keys. This is combined with the per-commitment-secret generated by the
10033 * counterparty to create a secret which the counterparty can reveal to revoke previous
10036 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10039 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
10040 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
10041 * static across every commitment transaction.
10043 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
10046 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
10047 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
10048 * static across every commitment transaction.
10050 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10053 * The base point which is used (with derive_public_key) to derive a per-commitment payment
10054 * public key which receives non-HTLC-encumbered funds which are only available for spending
10055 * after some delay (or can be claimed via the revocation path).
10057 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
10060 * The base point which is used (with derive_public_key) to derive a per-commitment payment
10061 * public key which receives non-HTLC-encumbered funds which are only available for spending
10062 * after some delay (or can be claimed via the revocation path).
10064 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10067 * The base point which is used (with derive_public_key) to derive a per-commitment public key
10068 * which is used to encumber HTLC-in-flight outputs.
10070 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
10073 * The base point which is used (with derive_public_key) to derive a per-commitment public key
10074 * which is used to encumber HTLC-in-flight outputs.
10076 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10079 * Constructs a new ChannelPublicKeys given each field
10081 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);
10084 * Creates a copy of the ChannelPublicKeys
10086 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
10089 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
10091 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
10094 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
10096 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
10099 * Create per-state keys from channel base points and the per-commitment point.
10100 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
10102 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);
10105 * Generate per-state keys from channel static keys.
10106 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
10108 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);
10111 * A script either spendable by the revocation
10112 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
10113 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
10115 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
10118 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
10120 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
10123 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
10124 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
10125 * need to compare this value to whether the commitment transaction in question is that of
10126 * the counterparty or our own.
10128 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
10131 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
10132 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
10133 * need to compare this value to whether the commitment transaction in question is that of
10134 * the counterparty or our own.
10136 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
10139 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
10140 * this divided by 1000.
10142 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
10145 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
10146 * this divided by 1000.
10148 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
10151 * The CLTV lock-time at which this HTLC expires.
10153 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
10156 * The CLTV lock-time at which this HTLC expires.
10158 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
10161 * The hash of the preimage which unlocks this HTLC.
10163 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
10166 * The hash of the preimage which unlocks this HTLC.
10168 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10171 * Creates a copy of the HTLCOutputInCommitment
10173 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
10176 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
10178 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
10181 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
10183 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
10186 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
10187 * does not need to have its previous_output_index filled.
10189 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys);
10192 * Gets the redeemscript for a funding output from the two funding public keys.
10193 * Note that the order of funding public keys does not matter.
10195 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
10198 * panics if htlc.transaction_output_index.is_none()!
10200 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);
10203 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
10205 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
10208 * Holder public keys
10210 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
10213 * Holder public keys
10215 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
10218 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
10220 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
10223 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
10225 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
10228 * Whether the holder is the initiator of this channel.
10229 * This is an input to the commitment number obscure factor computation.
10231 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
10234 * Whether the holder is the initiator of this channel.
10235 * This is an input to the commitment number obscure factor computation.
10237 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
10240 * The late-bound counterparty channel transaction parameters.
10241 * These parameters are populated at the point in the protocol where the counterparty provides them.
10243 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
10246 * The late-bound counterparty channel transaction parameters.
10247 * These parameters are populated at the point in the protocol where the counterparty provides them.
10249 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
10252 * The late-bound funding outpoint
10254 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
10257 * The late-bound funding outpoint
10259 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
10262 * Constructs a new ChannelTransactionParameters given each field
10264 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);
10267 * Creates a copy of the ChannelTransactionParameters
10269 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
10272 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
10274 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
10277 * Counter-party public keys
10279 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
10282 * Counter-party public keys
10284 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
10287 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
10289 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
10292 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
10294 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
10297 * Constructs a new CounterpartyChannelTransactionParameters given each field
10299 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
10302 * Creates a copy of the CounterpartyChannelTransactionParameters
10304 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
10307 * Whether the late bound parameters are populated.
10309 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
10312 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
10313 * given that the holder is the broadcaster.
10315 * self.is_populated() must be true before calling this function.
10317 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
10320 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
10321 * given that the counterparty is the broadcaster.
10323 * self.is_populated() must be true before calling this function.
10325 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
10328 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
10330 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
10333 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
10335 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
10338 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
10340 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
10343 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
10345 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
10348 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
10350 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
10353 * Get the channel pubkeys for the broadcaster
10355 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
10358 * Get the channel pubkeys for the countersignatory
10360 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
10363 * Get the contest delay applicable to the transactions.
10364 * Note that the contest delay was selected by the countersignatory.
10366 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
10369 * Whether the channel is outbound from the broadcaster.
10371 * The boolean representing the side that initiated the channel is
10372 * an input to the commitment number obscure factor computation.
10374 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
10377 * The funding outpoint
10379 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
10382 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
10384 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
10387 * Our counterparty's signature for the transaction
10389 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
10392 * Our counterparty's signature for the transaction
10394 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
10397 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
10399 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
10402 * Creates a copy of the HolderCommitmentTransaction
10404 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
10407 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
10409 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
10412 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
10414 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
10417 * Create a new holder transaction with the given counterparty signatures.
10418 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
10420 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);
10423 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
10425 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
10428 * The commitment transaction
10430 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
10433 * The commitment transaction
10435 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
10438 * The txid for the commitment transaction.
10440 * This is provided as a performance optimization, instead of calling transaction.txid()
10443 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
10446 * The txid for the commitment transaction.
10448 * This is provided as a performance optimization, instead of calling transaction.txid()
10451 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
10454 * Constructs a new BuiltCommitmentTransaction given each field
10456 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
10459 * Creates a copy of the BuiltCommitmentTransaction
10461 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
10464 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
10466 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
10469 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
10471 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
10474 * Get the SIGHASH_ALL sighash value of the transaction.
10476 * This can be used to verify a signature.
10478 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);
10481 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
10482 * because we are about to broadcast a holder transaction.
10484 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);
10487 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
10489 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
10492 * Creates a copy of the CommitmentTransaction
10494 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
10497 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
10499 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
10502 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
10504 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
10507 * The backwards-counting commitment number
10509 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
10512 * The value to be sent to the broadcaster
10514 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
10517 * The value to be sent to the counterparty
10519 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
10522 * The feerate paid per 1000-weight-unit in this commitment transaction.
10524 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
10527 * Trust our pre-built transaction and derived transaction creation public keys.
10529 * Applies a wrapper which allows access to these fields.
10531 * This should only be used if you fully trust the builder of this object. It should not
10532 *\tbe used by an external signer - instead use the verify function.
10534 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
10537 * Verify our pre-built transaction and derived transaction creation public keys.
10539 * Applies a wrapper which allows access to these fields.
10541 * An external validating signer must call this method before signing
10542 * or using the built transaction.
10544 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);
10547 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
10549 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
10552 * The transaction ID of the built Bitcoin transaction
10554 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
10557 * The pre-built Bitcoin commitment transaction
10559 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
10562 * The pre-calculated transaction creation public keys.
10564 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
10567 * Get a signature for each HTLC which was included in the commitment transaction (ie for
10568 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
10570 * The returned Vec has one entry for each HTLC, and in the same order.
10572 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);
10575 * Get the transaction number obscure factor
10577 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
10580 * Creates a copy of the InitFeatures
10582 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
10585 * Creates a copy of the NodeFeatures
10587 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
10590 * Creates a copy of the ChannelFeatures
10592 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
10595 * Creates a copy of the InvoiceFeatures
10597 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
10600 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
10602 void InitFeatures_free(struct LDKInitFeatures this_obj);
10605 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
10607 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
10610 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
10612 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
10615 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
10617 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
10620 * Create a blank Features with no features set
10622 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
10625 * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
10627 * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
10629 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
10632 * Create a blank Features with no features set
10634 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
10637 * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
10639 * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
10641 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
10644 * Create a blank Features with no features set
10646 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
10649 * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
10651 * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
10653 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
10656 * Create a blank Features with no features set
10658 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
10661 * Creates features known by the implementation as defined by [`T::KNOWN_FEATURE_FLAGS`].
10663 * [`T::KNOWN_FEATURE_FLAGS`]: sealed/trait.Context.html#associatedconstant.KNOWN_FEATURE_FLAGS
10665 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
10668 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
10670 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
10673 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
10675 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
10678 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
10680 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
10683 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
10685 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
10688 * Read a InitFeatures from a byte array, created by InitFeatures_write
10690 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
10693 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
10695 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
10698 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
10700 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
10703 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
10705 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
10708 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
10710 void RouteHop_free(struct LDKRouteHop this_obj);
10713 * The node_id of the node at this hop.
10715 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
10718 * The node_id of the node at this hop.
10720 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10723 * The node_announcement features of the node at this hop. For the last hop, these may be
10724 * amended to match the features present in the invoice this node generated.
10726 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
10729 * The node_announcement features of the node at this hop. For the last hop, these may be
10730 * amended to match the features present in the invoice this node generated.
10732 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
10735 * The channel that should be used from the previous hop to reach this node.
10737 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
10740 * The channel that should be used from the previous hop to reach this node.
10742 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
10745 * The channel_announcement features of the channel that should be used from the previous hop
10746 * to reach this node.
10748 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
10751 * The channel_announcement features of the channel that should be used from the previous hop
10752 * to reach this node.
10754 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
10757 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
10758 * For the last hop, this should be the full value of the payment (might be more than
10759 * requested if we had to match htlc_minimum_msat).
10761 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
10764 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
10765 * For the last hop, this should be the full value of the payment (might be more than
10766 * requested if we had to match htlc_minimum_msat).
10768 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
10771 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
10772 * expected at the destination, in excess of the current block height.
10774 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
10777 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
10778 * expected at the destination, in excess of the current block height.
10780 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
10783 * Constructs a new RouteHop given each field
10785 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);
10788 * Creates a copy of the RouteHop
10790 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
10793 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
10795 void Route_free(struct LDKRoute this_obj);
10798 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
10799 * last RouteHop in each path must be the same.
10800 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
10801 * destination. Thus, this must always be at least length one. While the maximum length of any
10802 * given path is variable, keeping the length of any path to less than 20 should currently
10803 * ensure it is viable.
10805 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
10808 * Constructs a new Route given each field
10810 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
10813 * Creates a copy of the Route
10815 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
10818 * Serialize the Route object into a byte array which can be read by Route_read
10820 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
10823 * Read a Route from a byte array, created by Route_write
10825 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
10828 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
10830 void RouteHint_free(struct LDKRouteHint this_obj);
10833 * The node_id of the non-target end of the route
10835 struct LDKPublicKey RouteHint_get_src_node_id(const struct LDKRouteHint *NONNULL_PTR this_ptr);
10838 * The node_id of the non-target end of the route
10840 void RouteHint_set_src_node_id(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
10843 * The short_channel_id of this channel
10845 uint64_t RouteHint_get_short_channel_id(const struct LDKRouteHint *NONNULL_PTR this_ptr);
10848 * The short_channel_id of this channel
10850 void RouteHint_set_short_channel_id(struct LDKRouteHint *NONNULL_PTR this_ptr, uint64_t val);
10853 * The fees which must be paid to use this channel
10855 struct LDKRoutingFees RouteHint_get_fees(const struct LDKRouteHint *NONNULL_PTR this_ptr);
10858 * The fees which must be paid to use this channel
10860 void RouteHint_set_fees(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
10863 * The difference in CLTV values between this node and the next node.
10865 uint16_t RouteHint_get_cltv_expiry_delta(const struct LDKRouteHint *NONNULL_PTR this_ptr);
10868 * The difference in CLTV values between this node and the next node.
10870 void RouteHint_set_cltv_expiry_delta(struct LDKRouteHint *NONNULL_PTR this_ptr, uint16_t val);
10873 * Creates a copy of the RouteHint
10875 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
10878 * Gets a route from us (payer) to the given target node (payee).
10880 * If the payee provided features in their invoice, they should be provided via payee_features.
10881 * Without this, MPP will only be used if the payee's features are available in the network graph.
10883 * Extra routing hops between known nodes and the target will be used if they are included in
10886 * If some channels aren't announced, it may be useful to fill in a first_hops with the
10887 * results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
10888 * view of our local channels (from net_graph_msg_handler) will be ignored, and only those
10889 * in first_hops will be used.
10891 * Panics if first_hops contains channels without short_channel_ids
10892 * (ChannelManager::list_usable_channels will never include such channels).
10894 * The fees on channels from us to next-hops are ignored (as they are assumed to all be
10895 * equal), however the enabled/disabled bit on such channels as well as the
10896 * htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
10898 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);
10901 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
10903 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
10906 * Creates a copy of the NetworkGraph
10908 struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
10911 * Frees any resources used by the LockedNetworkGraph, if is_owned is set and inner is non-NULL.
10913 void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj);
10916 * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
10918 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
10921 * Creates a new tracker of the actual state of the network of channels and nodes,
10922 * assuming a fresh network graph.
10923 * Chain monitor is used to make sure announced channels exist on-chain,
10924 * channel data is correct, and that the announcement is signed with
10925 * channel owners' keys.
10927 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger);
10930 * Creates a new tracker of the actual state of the network of channels and nodes,
10931 * assuming an existing Network Graph.
10933 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph);
10936 * Adds a provider used to check new announcements. Does not affect
10937 * existing announcements unless they are updated.
10938 * Add, update or remove the provider would replace the current one.
10940 void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKAccess *chain_access);
10943 * Take a read lock on the network_graph and return it in the C-bindings
10944 * newtype helper. This is likely only useful when called via the C
10945 * bindings as you can call `self.network_graph.read().unwrap()` in Rust
10948 MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
10951 * Get a reference to the NetworkGraph which this read-lock contains.
10953 MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg);
10956 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
10957 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
10959 struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
10962 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
10963 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
10965 struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
10968 * Frees any resources used by the DirectionalChannelInfo, if is_owned is set and inner is non-NULL.
10970 void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_obj);
10973 * When the last update to the channel direction was issued.
10974 * Value is opaque, as set in the announcement.
10976 uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
10979 * When the last update to the channel direction was issued.
10980 * Value is opaque, as set in the announcement.
10982 void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val);
10985 * Whether the channel can be currently used for payments (in this one direction).
10987 bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
10990 * Whether the channel can be currently used for payments (in this one direction).
10992 void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, bool val);
10995 * The difference in CLTV values that you must have when routing through this channel.
10997 uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
11000 * The difference in CLTV values that you must have when routing through this channel.
11002 void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint16_t val);
11005 * The minimum value, which must be relayed to the next hop via the channel
11007 uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
11010 * The minimum value, which must be relayed to the next hop via the channel
11012 void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val);
11015 * Fees charged when the channel is used for routing
11017 struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
11020 * Fees charged when the channel is used for routing
11022 void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
11025 * Most recent update for the channel received from the network
11026 * Mostly redundant with the data we store in fields explicitly.
11027 * Everything else is useful only for sending out for initial routing sync.
11028 * Not stored if contains excess data to prevent DoS.
11030 struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
11033 * Most recent update for the channel received from the network
11034 * Mostly redundant with the data we store in fields explicitly.
11035 * Everything else is useful only for sending out for initial routing sync.
11036 * Not stored if contains excess data to prevent DoS.
11038 void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
11041 * Creates a copy of the DirectionalChannelInfo
11043 struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig);
11046 * Serialize the DirectionalChannelInfo object into a byte array which can be read by DirectionalChannelInfo_read
11048 struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj);
11051 * Read a DirectionalChannelInfo from a byte array, created by DirectionalChannelInfo_write
11053 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser);
11056 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
11058 void ChannelInfo_free(struct LDKChannelInfo this_obj);
11061 * Protocol features of a channel communicated during its announcement
11063 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
11066 * Protocol features of a channel communicated during its announcement
11068 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
11071 * Source node of the first direction of a channel
11073 struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
11076 * Source node of the first direction of a channel
11078 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11081 * Details about the first direction of a channel
11083 struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
11086 * Details about the first direction of a channel
11088 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
11091 * Source node of the second direction of a channel
11093 struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
11096 * Source node of the second direction of a channel
11098 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
11101 * Details about the second direction of a channel
11103 struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
11106 * Details about the second direction of a channel
11108 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
11111 * An initial announcement of the channel
11112 * Mostly redundant with the data we store in fields explicitly.
11113 * Everything else is useful only for sending out for initial routing sync.
11114 * Not stored if contains excess data to prevent DoS.
11116 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
11119 * An initial announcement of the channel
11120 * Mostly redundant with the data we store in fields explicitly.
11121 * Everything else is useful only for sending out for initial routing sync.
11122 * Not stored if contains excess data to prevent DoS.
11124 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
11127 * Creates a copy of the ChannelInfo
11129 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
11132 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
11134 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
11137 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
11139 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
11142 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
11144 void RoutingFees_free(struct LDKRoutingFees this_obj);
11147 * Flat routing fee in satoshis
11149 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
11152 * Flat routing fee in satoshis
11154 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
11157 * Liquidity-based routing fee in millionths of a routed amount.
11158 * In other words, 10000 is 1%.
11160 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
11163 * Liquidity-based routing fee in millionths of a routed amount.
11164 * In other words, 10000 is 1%.
11166 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
11169 * Constructs a new RoutingFees given each field
11171 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
11174 * Creates a copy of the RoutingFees
11176 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
11179 * Read a RoutingFees from a byte array, created by RoutingFees_write
11181 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
11184 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
11186 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
11189 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
11191 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
11194 * Protocol features the node announced support for
11196 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
11199 * Protocol features the node announced support for
11201 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
11204 * When the last known update to the node state was issued.
11205 * Value is opaque, as set in the announcement.
11207 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
11210 * When the last known update to the node state was issued.
11211 * Value is opaque, as set in the announcement.
11213 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
11216 * Color assigned to the node
11218 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
11221 * Color assigned to the node
11223 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
11226 * Moniker assigned to the node.
11227 * May be invalid or malicious (eg control chars),
11228 * should not be exposed to the user.
11230 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
11233 * Moniker assigned to the node.
11234 * May be invalid or malicious (eg control chars),
11235 * should not be exposed to the user.
11237 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
11240 * Internet-level addresses via which one can connect to the node
11242 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
11245 * An initial announcement of the node
11246 * Mostly redundant with the data we store in fields explicitly.
11247 * Everything else is useful only for sending out for initial routing sync.
11248 * Not stored if contains excess data to prevent DoS.
11250 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
11253 * An initial announcement of the node
11254 * Mostly redundant with the data we store in fields explicitly.
11255 * Everything else is useful only for sending out for initial routing sync.
11256 * Not stored if contains excess data to prevent DoS.
11258 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
11261 * Constructs a new NodeAnnouncementInfo given each field
11263 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);
11266 * Creates a copy of the NodeAnnouncementInfo
11268 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
11271 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
11273 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
11276 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
11278 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
11281 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
11283 void NodeInfo_free(struct LDKNodeInfo this_obj);
11286 * All valid channels a node has announced
11288 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
11291 * Lowest fees enabling routing via any of the enabled, known channels to a node.
11292 * The two fields (flat and proportional fee) are independent,
11293 * meaning they don't have to refer to the same channel.
11295 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
11298 * Lowest fees enabling routing via any of the enabled, known channels to a node.
11299 * The two fields (flat and proportional fee) are independent,
11300 * meaning they don't have to refer to the same channel.
11302 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
11305 * More information about a node from node_announcement.
11306 * Optional because we store a Node entry after learning about it from
11307 * a channel announcement, but before receiving a node announcement.
11309 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
11312 * More information about a node from node_announcement.
11313 * Optional because we store a Node entry after learning about it from
11314 * a channel announcement, but before receiving a node announcement.
11316 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
11319 * Constructs a new NodeInfo given each field
11321 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
11324 * Creates a copy of the NodeInfo
11326 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
11329 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
11331 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
11334 * Read a NodeInfo from a byte array, created by NodeInfo_write
11336 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
11339 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
11341 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
11344 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
11346 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
11349 * Creates a new, empty, network graph.
11351 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
11354 * For an already known node (from channel announcements), update its stored properties from a
11355 * given node announcement.
11357 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
11358 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
11359 * routing messages from a source using a protocol other than the lightning P2P protocol.
11361 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
11364 * For an already known node (from channel announcements), update its stored properties from a
11365 * given node announcement without verifying the associated signatures. Because we aren't
11366 * given the associated signatures here we cannot relay the node announcement to any of our
11369 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
11372 * Store or update channel info from a channel announcement.
11374 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
11375 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
11376 * routing messages from a source using a protocol other than the lightning P2P protocol.
11378 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
11379 * the corresponding UTXO exists on chain and is correctly-formatted.
11381 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);
11384 * Store or update channel info from a channel announcement without verifying the associated
11385 * signatures. Because we aren't given the associated signatures here we cannot relay the
11386 * channel announcement to any of our peers.
11388 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
11389 * the corresponding UTXO exists on chain and is correctly-formatted.
11391 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);
11394 * Close a channel if a corresponding HTLC fail was sent.
11395 * If permanent, removes a channel from the local storage.
11396 * May cause the removal of nodes too, if this was their last channel.
11397 * If not permanent, makes channels unavailable for routing.
11399 void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
11402 * For an already known (from announcement) channel, update info about one of the directions
11405 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
11406 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
11407 * routing messages from a source using a protocol other than the lightning P2P protocol.
11409 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
11412 * For an already known (from announcement) channel, update info about one of the directions
11413 * of the channel without verifying the associated signatures. Because we aren't given the
11414 * associated signatures here we cannot relay the channel update to any of our peers.
11416 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
11418 /* Text to put at the end of the generated file */